Documentation
¶
Overview ¶
Package xrapid contains custom generators and other utilities for working with the pgregory.net/rapid testing framework.
Index ¶
- func Envelope() *rapid.Generator[*envelopepb.Envelope]
- func Identity() *rapid.Generator[*identitypb.Identity]
- func Nillable[T any](gen *rapid.Generator[*T]) *rapid.Generator[*T]
- func SampledFromSeq[T any](seq iter.Seq[T]) *rapid.Generator[T]
- func SampledFromSeq2[K, V any](seq iter.Seq2[K, V]) *rapid.Generator[Pair[K, V]]
- func Time() *rapid.Generator[time.Time]
- func Timestamp() *rapid.Generator[*timestamppb.Timestamp]
- type Pair
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 ¶
Nillable creates a generator that produces either nil or a value from the provided generator.
func SampledFromSeq ¶
SampledFromSeq returns a generator that produces random elements from the given sequence.
func SampledFromSeq2 ¶
SampledFromSeq2 returns a generator that produces random elements from the given sequence.
func Timestamp ¶
func Timestamp() *rapid.Generator[*timestamppb.Timestamp]
Timestamp returns a generator of random *timestamppb.Timestamp values.