Documentation ¶
Index ¶
- func AccAddr() sdk.AccAddress
- func Bytes(len int) []byte
- func BytesBetween(minLength int, maxLength int) []byte
- func HexStr(len int) string
- func I64Between(lower int64, upper int64) int64
- func PosI64() int64
- func Str(len int) string
- func StrBetween(minLength int, maxLength int) string
- func ValAddr() sdk.ValAddress
- type BoolGen
- type DistinctStrGen
- type DistrGen
- type I64Gen
- type StringGen
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesBetween ¶
BytesBetween returns a random byte slice of random length in the given limits (inclusive)
func I64Between ¶
I64Between returns a random integer between lower (inclusive) and upper (exclusive). It panics if upper <= lower.
func StrBetween ¶
StrBetween returns a random string of random length in the given limits (inclusive)
Types ¶
type BoolGen ¶
type BoolGen struct {
// contains filtered or unexported fields
}
BoolGen represents an random bool generator. Call Stop when done so dangling goroutines can be cleaned up.
type DistinctStrGen ¶
type DistinctStrGen struct { StringGen // contains filtered or unexported fields }
DistinctStrGen represents an random string generator which returns distinct strings. Call Stop when done so dangling goroutines can be cleaned up.
func (DistinctStrGen) Next ¶
func (g DistinctStrGen) Next() string
Next returns a single random string that is distinct from all previously generated strings.
func (DistinctStrGen) Take ¶
func (g DistinctStrGen) Take(count int) []string
Take returns a slice of distinct random strings of the given length.
type DistrGen ¶
type DistrGen struct {
// contains filtered or unexported fields
}
DistrGen represents a probability distribution that can be sampled
type I64Gen ¶
type I64Gen struct {
// contains filtered or unexported fields
}
I64Gen represents an random integer generator to generate a sequence of integers with the same properties. Call Stop when done so dangling goroutines can be cleaned up.
func I64GenBetween ¶
I64GenBetween returns a random integer generator for numbers between lower (inclusive) and upper (exclusive). It panics if upper <= lower.
func PInt64Gen ¶
func PInt64Gen() I64Gen
PInt64Gen returns a random integer generator for positive integers.
type StringGen ¶
type StringGen struct {
// contains filtered or unexported fields
}
StringGen represents an random string generator. Call Stop when done so dangling goroutines can be cleaned up.
func HexStrings ¶
HexStrings returns a random hex string generator that produces hex strings with given length
func Strings ¶
Strings returns a random string generator that produces strings from the default alphabet of random length in the given limits (inclusive)
func (StringGen) Distinct ¶
func (g StringGen) Distinct() DistinctStrGen
Distinct returns a new unique string
func (StringGen) WithAlphabet ¶
WithAlphabet returns a random string generator that produces strings from the given alphabet of length between the given limits (inclusive)