Versions in this module Expand all Collapse all v0 v0.6.1 Aug 17, 2024 v0.6.0 Aug 14, 2024 Changes in this version + func Bool() bool + func ChineseName() string + func Duration(min time.Duration, max time.Duration) time.Duration + func EnglishName() string + func FloatN[F constraints.Float](n F) F + func Float[F constraints.Float](min, max F) F + func HostName() string + func IPv4Address() string + func IPv4Host() string + func IPv6Address() string + func IPv6Host() string + func IntN[I constraints.Int](n I) I + func Int[I constraints.Int](min, max I) I + func MAC() string + func NumberVerificationCode(length int) string + func Port() int + func Probability(p int, full ...int) bool + func ProbabilityChooseOne(ps ...int) int + func ProbabilitySliceIndex[T any](getProbabilityHandle func(data T) float64, data ...T) (hit T, index int, miss bool) + func ProbabilitySlice[T any](getProbabilityHandle func(data T) float64, data ...T) (hit T, miss bool) + func UsablePort() int + func VerificationCode(length int) string + func WeightMapKey[K comparable, T any](getWeightHandle func(data T) int64, data map[K]T) (item T, key K) + func WeightMap[K comparable, T any](getWeightHandle func(data T) int64, data map[K]T) T + func WeightSliceIndex[T any](getWeightHandle func(data T) int64, data ...T) (item T, index int) + func WeightSlice[T any](getWeightHandle func(data T) int64, data ...T) T + type NameGenerator struct + func DefaultChineseNameGenerator() *NameGenerator + func DefaultEnglishNameGenerator() *NameGenerator + func (n *NameGenerator) AddFirstNames(firstNames ...string) + func (n *NameGenerator) AddLastNames(lastNames ...string) + func (n *NameGenerator) RandomName() string + func (n *NameGenerator) SetFirstNameCount(count int)