Documentation ¶
Index ¶
- func New(p ...Part) *gen
- type Part
- func Group(p ...Part) Part
- func Literal(s string) Part
- func OneOf(p ...Part) Part
- func OneOfByte(b []byte) Part
- func OneOfRune(r []rune) Part
- func OneOfString(s []string) Part
- func Potentially(c float64, p Part) Part
- func Repeat(min uint32, max uint32, p ...Part) Part
- func Sequence(start uint64, max uint64, width int) Part
- func Shuffle(p ...Part) Part
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Part ¶
Part is a part of a pattern.
func OneOfRune ¶
OneOfRune returns a Part that will select one of r randomly in each iteration. The length of the alphabet must be less than 2^32.
func OneOfString ¶
OneOfString returns a Part that will output one of s randomly in each iteration.
func Potentially ¶
Potentially returns a Part that will include p with probability c.
Panics if c is < 0.
func Repeat ¶
Repeat returns a Part that repeats p between min and max times randomly. If min == max, the Part will be repeated exactly max times in each iteration.
func Sequence ¶
Sequence returns a Part that will on each iteration increment a number from start to max. The number will be zero-padded to width. The output number will reset to start when max is reached.