Documentation ¶
Overview ¶
Package protorand provides a random number generator for the protobuf message struct. You can simply generate the protobuf message struct with random values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Chars = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
Chars is the set of characters used to generate random strings.
Functions ¶
This section is empty.
Types ¶
type ProtoRand ¶
type ProtoRand struct { MaxCollectionElements int // MaxDepth is the maximum stack depth for recursion, which prevents stack overflows if a message is (directly or // transitively) self-referential. MaxDepth int // contains filtered or unexported fields }
ProtoRand is a source of random values for protobuf fields.
func (*ProtoRand) Gen ¶
Gen generates a new proto.Message having random values in its fields. The input is used to specify the type of the generated message. The input itself is immutable.
func (*ProtoRand) NewDynamicProtoRand ¶
func (p *ProtoRand) NewDynamicProtoRand(mds protoreflect.MessageDescriptor) (*dynamicpb.Message, error)
NewDynamicProtoRand creates dynamicpb with assigning random values to a proto.
Click to show internal directories.
Click to hide internal directories.