Versions in this module Expand all Collapse all v0 v0.19.4 Nov 1, 2026 Changes in this version + const ALPHA_BYTES + const DEC_BYTES + const HEX_BYTES + const LETTER_BYTES + const LETTER_IDX_BITS + const LETTER_IDX_MASK + const LETTER_IDX_MAX + var SurnameData = []SurnameInfo + func ClearAllGenerators() + func FRandAlphaBytes(n int) []byte + func FRandAlphaString(n int) string + func FRandBool() bool + func FRandBytes(n int) []byte + func FRandBytesJSON(length int) (string, error) + func FRandBytesLetters(n int, letters string) []byte + func FRandDecBytes(n int) []byte + func FRandDecString(n int) string + func FRandHexBytes(n int) []byte + func FRandHexString(n int) string + func FRandInt(min, max int) int + func FRandString(n int) string + func FRandTime() time.Time + func FRandUint32(min, max uint32) uint32 + func FastIntn(n int) int + func FastRand() uint32 + func FastRand64() uint64 + func FastRandn(n uint32) uint32 + func FastRandu() uint + func GenerateAvailablePort(ports ...int) (int, error) + func GenerateRandModel(model interface{}, opts ...*GenerateRandModelOptions) (interface{}, string, error) + func JoinDomainsWithTLDs(domains []string, tlds []string, priorityTLDs ...string) []string + func ListRegisteredGenerators() []string + func NewRand(seed ...int64) *rand.Rand + func RandBusinessHour() time.Time + func RandDate(startDate, endDate time.Time) time.Time + func RandDuration(min, max time.Duration) time.Duration + func RandFloat(min, max float64) (v float64) + func RandHex(bytesLen int, customBytes ...string) string + func RandHour() int + func RandInt(min, max int) (v int) + func RandMinute() int + func RandMonth() time.Month + func RandNumber(length int, customBytes ...string) string + func RandNumericalLargeSlice[T types.Numerical](largeSize ...int) []T + func RandNumericalWithRandomStep[T types.Numerical](start, end, minStep, maxStep T) []T + func RandNumerical[T types.Numerical](start, end T, step ...T) []T + func RandSecond() int + func RandString(n int, mode RandType) string + func RandStringSlice(count, len int, mode RandType) (result []string) + func RandTimeBetween(start, end time.Time) time.Time + func RandTimeInFuture(duration time.Duration) time.Time + func RandTimeInPast(duration time.Duration) time.Time + func RandTimeOfDay() time.Time + func RandUnixTimestamp(minTimestamp, maxTimestamp int64) int64 + func RandWeekday() time.Weekday + func RandomCompany() string + func RandomEmail() string + func RandomIDCard() string + func RandomName() string + func RandomPhone() string + func RegisterGenerator(name string, generator RandGeneratorFunc) + func UUID() string + func UnregisterGenerator(name string) + type DomainKeywordBuilder struct + func NewDomainKeywordBuilder(baseKeyword string) *DomainKeywordBuilder + func (b *DomainKeywordBuilder) Generate() []string + func (b *DomainKeywordBuilder) GenerateAndJoinWithTLDs(tlds []string, separator string) string + func (b *DomainKeywordBuilder) WithCount(count int) *DomainKeywordBuilder + func (b *DomainKeywordBuilder) WithMaxBaseKeywordLength(maxLen int) *DomainKeywordBuilder + func (b *DomainKeywordBuilder) WithPrefixLength(min, max int) *DomainKeywordBuilder + func (b *DomainKeywordBuilder) WithSuffixLength(min, max int) *DomainKeywordBuilder + type GenerateRandModelOptions struct + FillNilPtr bool + MaxDepth int + MaxMapLen int + MaxSliceLen int + StringLength int + UseCustomTags bool + func DefaultOptions() *GenerateRandModelOptions + type RandGeneratorFunc func() interface + func GetGenerator(name string) (RandGeneratorFunc, bool) + type RandGeneratorRegistry struct + type RandType int + const CAPITAL + const LOWERCASE + const NUMBER + const SPECIAL + type SurnameInfo struct + AllPinyins []string + CorrectPinyin string + Initial string + Surname string + type SurnameManager struct + func NewSurnameManager(data ...[]SurnameInfo) *SurnameManager + func (m *SurnameManager) AppendData(newData ...SurnameInfo) + func (m *SurnameManager) Data() []SurnameInfo + func (m *SurnameManager) FilterByPinyin(pinyin string) *SurnameManager + func (m *SurnameManager) FilterBySurname(surname string) *SurnameManager + func (m *SurnameManager) Print() + func (m *SurnameManager) RandomSurname() (SurnameInfo, error) + func (m *SurnameManager) ToJSON() (string, error)