xrapid

package
v0.0.0-...-3e3b9c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package xrapid contains custom generators and other utilities for working with the pgregory.net/rapid testing framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Envelope

func Envelope() *rapid.Generator[*envelopepb.Envelope]

Envelope returns a generator of random *envelopepb.Envelope values.

By design, the message type and data encoded within the envelope is not necessarily valid.

func Identity

func Identity() *rapid.Generator[*identitypb.Identity]

Identity returns a generator of random *identitypb.Identity values.

func Nillable

func Nillable[T any](gen *rapid.Generator[*T]) *rapid.Generator[*T]

Nillable creates a generator that produces either nil or a value from the provided generator.

func SampledFromSeq

func SampledFromSeq[T any](seq iter.Seq[T]) *rapid.Generator[T]

SampledFromSeq returns a generator that produces random elements from the given sequence.

func SampledFromSeq2

func SampledFromSeq2[K, V any](seq iter.Seq2[K, V]) *rapid.Generator[Pair[K, V]]

SampledFromSeq2 returns a generator that produces random elements from the given sequence.

func Time

func Time() *rapid.Generator[time.Time]

Time returns a generator of random time.Time values.

func Timestamp

func Timestamp() *rapid.Generator[*timestamppb.Timestamp]

Timestamp returns a generator of random *timestamppb.Timestamp values.

Types

type Pair

type Pair[K, V any] struct {
	Key   K
	Value V
}

Pair is a key/value pair.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL