Documentation ¶
Overview ¶
Package gofakeit provides a set of functions that generate random data
Example ¶
Seed(11) fmt.Println("Name:", Name()) fmt.Println("Email:", Email()) fmt.Println("Phone:", Phone()) fmt.Println("Address:", Address().Address) fmt.Println("BS:", BS()) fmt.Println("Beer Name:", BeerName()) fmt.Println("Color:", Color()) fmt.Println("Company:", Company()) fmt.Println("Credit Card:", CreditCardNumber(nil)) fmt.Println("Hacker Phrase:", HackerPhrase()) fmt.Println("Job Title:", JobTitle()) fmt.Println("Password:", Password(true, true, true, true, false, 32))
Output: Name: Sonny Stiedemann Email: codydonnelly@leannon.biz Phone: 7598907999 Address: 4737 Port Hillstown, Santa Ana, Alabama 41026 BS: enable Beer Name: Chocolate St Color: Turquoise Company: Boundless Credit Card: 6282690620525711 Hacker Phrase: Try to bundle the PNG firewall, maybe it will deconstruct the open-source bandwidth! Job Title: Assistant Password: Nyf8p8ka1Kvgn...3H*.w7j01yM1vkc2
Example (Custom) ¶
Seed(11) AddFuncLookup("friendname", Info{ Category: "custom", Description: "Random friend name", Example: "bill", Output: "string", Generate: func(f *Faker, m *MapParams, info *Info) (any, error) { return RandomString([]string{"bill", "bob", "sally"}), nil }, }) type Foo struct { FriendName string `fake:"{friendname}"` } var f Foo Struct(&f) fmt.Printf("%s", f.FriendName)
Output: sally
Example (Custom_with_params) ¶
Seed(11) AddFuncLookup("jumbleword", Info{ Category: "jumbleword", Description: "Take a word and jumple it up", Example: "loredlowlh", Output: "string", Params: []Param{ {Field: "word", Type: "int", Description: "Word you want to jumble"}, }, Generate: func(f *Faker, m *MapParams, info *Info) (any, error) { word, err := info.GetString(m, "word") if err != nil { return nil, err } split := strings.Split(word, "") f.ShuffleStrings(split) return strings.Join(split, ""), nil }, }) type Foo struct { JumbleWord string `fake:"{jumbleword:helloworld}"` } var f Foo Struct(&f) fmt.Printf("%s", f.JumbleWord)
Output: hldoolewrl
Index ¶
- Variables
- func AchAccount() string
- func AchRouting() string
- func AddFuncLookup(functionName string, info Info)
- func Adjective() string
- func AdjectiveDemonstrative() string
- func AdjectiveDescriptive() string
- func AdjectiveIndefinite() string
- func AdjectiveInterrogative() string
- func AdjectivePossessive() string
- func AdjectiveProper() string
- func AdjectiveQuantitative() string
- func Adverb() string
- func AdverbDegree() string
- func AdverbFrequencyDefinite() string
- func AdverbFrequencyIndefinite() string
- func AdverbManner() string
- func AdverbPlace() string
- func AdverbTimeDefinite() string
- func AdverbTimeIndefinite() string
- func Animal() string
- func AnimalType() string
- func AppAuthor() string
- func AppName() string
- func AppVersion() string
- func BS() string
- func BeerAlcohol() string
- func BeerBlg() string
- func BeerHop() string
- func BeerIbu() string
- func BeerMalt() string
- func BeerName() string
- func BeerStyle() string
- func BeerYeast() string
- func Bird() string
- func BitcoinAddress() string
- func BitcoinPrivateKey() string
- func Blurb() string
- func BookAuthor() string
- func BookGenre() string
- func BookTitle() string
- func Bool() bool
- func Breakfast() string
- func BuzzWord() string
- func CSV(co *CSVOptions) ([]byte, error)
- func CarFuelType() string
- func CarMaker() string
- func CarModel() string
- func CarTransmissionType() string
- func CarType() string
- func Cat() string
- func Categories() map[string][]string
- func CelebrityActor() string
- func CelebrityBusiness() string
- func CelebritySport() string
- func ChromeUserAgent() string
- func City() string
- func Color() string
- func Comment() string
- func Company() string
- func CompanySuffix() string
- func Connective() string
- func ConnectiveCasual() string
- func ConnectiveComparative() string
- func ConnectiveComplaint() string
- func ConnectiveExamplify() string
- func ConnectiveListing() string
- func ConnectiveTime() string
- func Country() string
- func CountryAbr() string
- func CreditCardCvv() string
- func CreditCardExp() string
- func CreditCardNumber(cco *CreditCardOptions) string
- func CreditCardType() string
- func CurrencyLong() string
- func CurrencyShort() string
- func Cusip() string
- func Date() time.Time
- func DateRange(start, end time.Time) time.Time
- func Day() int
- func Dessert() string
- func Dice(numDice uint, sides []uint) []uint
- func Digit() string
- func DigitN(n uint) string
- func Dinner() string
- func Dog() string
- func DomainName() string
- func DomainSuffix() string
- func Drink() string
- func Email() string
- func EmailText(co *EmailOptions) (string, error)
- func Emoji() string
- func EmojiAlias() string
- func EmojiCategory() string
- func EmojiDescription() string
- func EmojiTag() string
- func Error() error
- func ErrorDatabase() error
- func ErrorGRPC() error
- func ErrorHTTP() error
- func ErrorHTTPClient() error
- func ErrorHTTPServer() error
- func ErrorObject() error
- func ErrorRuntime() error
- func ErrorValidation() error
- func FarmAnimal() string
- func FileExtension() string
- func FileMimeType() string
- func FirefoxUserAgent() string
- func FirstName() string
- func FixedWidth(co *FixedWidthOptions) (string, error)
- func FlipACoin() string
- func Float32() float32
- func Float32Range(min, max float32) float32
- func Float64() float64
- func Float64Range(min, max float64) float64
- func Fruit() string
- func FutureDate() time.Time
- func Gamertag() string
- func Gender() string
- func Generate(dataVal string) (string, error)
- func HTTPMethod() string
- func HTTPStatusCode() int
- func HTTPStatusCodeSimple() int
- func HTTPVersion() string
- func HackerAbbreviation() string
- func HackerAdjective() string
- func HackerNoun() string
- func HackerPhrase() string
- func HackerVerb() string
- func HackeringVerb() string
- func HexColor() string
- func HexUint(bitSize int) string
- func HipsterParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
- func HipsterSentence(wordCount int) string
- func HipsterWord() string
- func Hobby() string
- func Hour() int
- func IPv4Address() string
- func IPv6Address() string
- func Image(width int, height int) *img.RGBA
- func ImageJpeg(width int, height int) []byte
- func ImagePng(width int, height int) []byte
- func InputName() string
- func Int() int
- func Int16() int16
- func Int32() int32
- func Int64() int64
- func Int8() int8
- func IntN(n int) int
- func IntRange(min, max int) int
- func Interjection() string
- func Isin() string
- func JSON(jo *JSONOptions) ([]byte, error)
- func JobDescriptor() string
- func JobLevel() string
- func JobTitle() string
- func Language() string
- func LanguageAbbreviation() string
- func LanguageBCP() string
- func LastName() string
- func Latitude() float64
- func LatitudeInRange(min, max float64) (float64, error)
- func Letter() string
- func LetterN(n uint) string
- func Lexify(str string) string
- func LogLevel(logType string) string
- func Longitude() float64
- func LongitudeInRange(min, max float64) (float64, error)
- func LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
- func LoremIpsumSentence(wordCount int) string
- func LoremIpsumWord() string
- func Lunch() string
- func MacAddress() string
- func Map() map[string]any
- func Markdown(co *MarkdownOptions) (string, error)
- func MiddleName() string
- func MinecraftAnimal() string
- func MinecraftArmorPart() string
- func MinecraftArmorTier() string
- func MinecraftBiome() string
- func MinecraftDye() string
- func MinecraftFood() string
- func MinecraftMobBoss() string
- func MinecraftMobHostile() string
- func MinecraftMobNeutral() string
- func MinecraftMobPassive() string
- func MinecraftOre() string
- func MinecraftTool() string
- func MinecraftVillagerJob() string
- func MinecraftVillagerLevel() string
- func MinecraftVillagerStation() string
- func MinecraftWeapon() string
- func MinecraftWeather() string
- func MinecraftWood() string
- func Minute() int
- func Month() int
- func MonthString() string
- func MovieGenre() string
- func MovieName() string
- func Name() string
- func NamePrefix() string
- func NameSuffix() string
- func NanoSecond() int
- func NiceColors() []string
- func Noun() string
- func NounAbstract() string
- func NounCollectiveAnimal() string
- func NounCollectivePeople() string
- func NounCollectiveThing() string
- func NounCommon() string
- func NounConcrete() string
- func NounCountable() string
- func NounDeterminer() string
- func NounProper() string
- func NounUncountable() string
- func Number(min int, max int) int
- func Numerify(str string) string
- func OperaUserAgent() string
- func Paragraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
- func Password(lower bool, upper bool, numeric bool, special bool, space bool, num int) string
- func PastDate() time.Time
- func PetName() string
- func Phone() string
- func PhoneFormatted() string
- func Phrase() string
- func PhraseAdverb() string
- func PhraseNoun() string
- func PhrasePreposition() string
- func PhraseVerb() string
- func Preposition() string
- func PrepositionCompound() string
- func PrepositionDouble() string
- func PrepositionSimple() string
- func Price(min, max float64) float64
- func ProductAudience() []string
- func ProductBenefit() string
- func ProductCategory() string
- func ProductDescription() string
- func ProductDimension() string
- func ProductFeature() string
- func ProductMaterial() string
- func ProductName() string
- func ProductSuffix() string
- func ProductUPC() string
- func ProductUseCase() string
- func ProgrammingLanguage() string
- func Pronoun() string
- func PronounDemonstrative() string
- func PronounIndefinite() string
- func PronounInterrogative() string
- func PronounObject() string
- func PronounPersonal() string
- func PronounPossessive() string
- func PronounReflective() string
- func PronounRelative() string
- func Question() string
- func Quote() string
- func RGBColor() []int
- func RandomInt(i []int) int
- func RandomMapKey(mapI any) any
- func RandomString(a []string) string
- func RandomUint(u []uint) uint
- func Regex(regexStr string) string
- func RemoveFuncLookup(functionName string)
- func SQL(so *SQLOptions) (string, error)
- func SSN() string
- func SafariUserAgent() string
- func SafeColor() string
- func School() string
- func Second() int
- func Seed(args ...any) error
- func Sentence(wordCount int) string
- func SentenceSimple() string
- func ShuffleAnySlice(v any)
- func ShuffleInts(a []int)
- func ShuffleStrings(a []string)
- func Slice(v any)
- func Slogan() string
- func Snack() string
- func State() string
- func StateAbr() string
- func Street() string
- func StreetName() string
- func StreetNumber() string
- func StreetPrefix() string
- func StreetSuffix() string
- func Struct(v any) error
- func Svg(options *SVGOptions) string
- func Teams(peopleArray []string, teamsArray []string) map[string][]string
- func Template(template string, co *TemplateOptions) (string, error)
- func TimeZone() string
- func TimeZoneAbv() string
- func TimeZoneFull() string
- func TimeZoneOffset() float32
- func TimeZoneRegion() string
- func URL() string
- func UUID() string
- func Uint() uint
- func Uint16() uint16
- func Uint32() uint32
- func Uint64() uint64
- func Uint8() uint8
- func UintN(n uint) uint
- func UintRange(min, max uint) uint
- func UserAgent() string
- func Username() string
- func Vegetable() string
- func Verb() string
- func VerbAction() string
- func VerbHelping() string
- func VerbIntransitive() string
- func VerbLinking() string
- func VerbTransitive() string
- func Vowel() string
- func WeekDay() string
- func Weighted(options []any, weights []float32) (any, error)
- func Word() string
- func XML(xo *XMLOptions) ([]byte, error)
- func Year() int
- func Zip() string
- type AddressInfo
- type BookInfo
- type CSVOptions
- type CarInfo
- type ContactInfo
- type CreditCardInfo
- type CreditCardOptions
- type CurrencyInfo
- type EmailOptions
- type Fakeable
- type Faker
- func (f *Faker) AchAccount() string
- func (f *Faker) AchRouting() string
- func (f *Faker) Address() *AddressInfo
- func (f *Faker) Adjective() string
- func (f *Faker) AdjectiveDemonstrative() string
- func (f *Faker) AdjectiveDescriptive() string
- func (f *Faker) AdjectiveIndefinite() string
- func (f *Faker) AdjectiveInterrogative() string
- func (f *Faker) AdjectivePossessive() string
- func (f *Faker) AdjectiveProper() string
- func (f *Faker) AdjectiveQuantitative() string
- func (f *Faker) Adverb() string
- func (f *Faker) AdverbDegree() string
- func (f *Faker) AdverbFrequencyDefinite() string
- func (f *Faker) AdverbFrequencyIndefinite() string
- func (f *Faker) AdverbManner() string
- func (f *Faker) AdverbPlace() string
- func (f *Faker) AdverbTimeDefinite() string
- func (f *Faker) AdverbTimeIndefinite() string
- func (f *Faker) Animal() string
- func (f *Faker) AnimalType() string
- func (f *Faker) AppAuthor() string
- func (f *Faker) AppName() string
- func (f *Faker) AppVersion() string
- func (f *Faker) BS() string
- func (f *Faker) BeerAlcohol() string
- func (f *Faker) BeerBlg() string
- func (f *Faker) BeerHop() string
- func (f *Faker) BeerIbu() string
- func (f *Faker) BeerMalt() string
- func (f *Faker) BeerName() string
- func (f *Faker) BeerStyle() string
- func (f *Faker) BeerYeast() string
- func (f *Faker) Bird() string
- func (f *Faker) BitcoinAddress() string
- func (f *Faker) BitcoinPrivateKey() string
- func (f *Faker) Blurb() string
- func (f *Faker) Book() *BookInfo
- func (f *Faker) BookAuthor() string
- func (f *Faker) BookGenre() string
- func (f *Faker) BookTitle() string
- func (f *Faker) Bool() bool
- func (f *Faker) Breakfast() string
- func (f *Faker) BuzzWord() string
- func (f *Faker) CSV(co *CSVOptions) ([]byte, error)
- func (f *Faker) Car() *CarInfo
- func (f *Faker) CarFuelType() string
- func (f *Faker) CarMaker() string
- func (f *Faker) CarModel() string
- func (f *Faker) CarTransmissionType() string
- func (f *Faker) CarType() string
- func (f *Faker) Cat() string
- func (f *Faker) CelebrityActor() string
- func (f *Faker) CelebrityBusiness() string
- func (f *Faker) CelebritySport() string
- func (f *Faker) ChromeUserAgent() string
- func (f *Faker) City() string
- func (f *Faker) Color() string
- func (f *Faker) Comment() string
- func (f *Faker) Company() string
- func (f *Faker) CompanySuffix() string
- func (f *Faker) Connective() string
- func (f *Faker) ConnectiveCasual() string
- func (f *Faker) ConnectiveComparative() string
- func (f *Faker) ConnectiveComplaint() string
- func (f *Faker) ConnectiveExamplify() string
- func (f *Faker) ConnectiveListing() string
- func (f *Faker) ConnectiveTime() string
- func (f *Faker) Contact() *ContactInfo
- func (f *Faker) Country() string
- func (f *Faker) CountryAbr() string
- func (f *Faker) CreditCard() *CreditCardInfo
- func (f *Faker) CreditCardCvv() string
- func (f *Faker) CreditCardExp() string
- func (f *Faker) CreditCardNumber(cco *CreditCardOptions) string
- func (f *Faker) CreditCardType() string
- func (f *Faker) Currency() *CurrencyInfo
- func (f *Faker) CurrencyLong() string
- func (f *Faker) CurrencyShort() string
- func (f *Faker) Cusip() string
- func (f *Faker) Date() time.Time
- func (f *Faker) DateRange(start, end time.Time) time.Time
- func (f *Faker) Day() int
- func (f *Faker) Dessert() string
- func (f *Faker) Dice(numDice uint, sides []uint) []uint
- func (f *Faker) Digit() string
- func (f *Faker) DigitN(n uint) string
- func (f *Faker) Dinner() string
- func (f *Faker) Dog() string
- func (f *Faker) DomainName() string
- func (f *Faker) DomainSuffix() string
- func (f *Faker) Drink() string
- func (f *Faker) Email() string
- func (f *Faker) EmailText(co *EmailOptions) (string, error)
- func (f *Faker) Emoji() string
- func (f *Faker) EmojiAlias() string
- func (f *Faker) EmojiCategory() string
- func (f *Faker) EmojiDescription() string
- func (f *Faker) EmojiTag() string
- func (f *Faker) Error() error
- func (f *Faker) ErrorDatabase() error
- func (f *Faker) ErrorGRPC() error
- func (f *Faker) ErrorHTTP() error
- func (f *Faker) ErrorHTTPClient() error
- func (f *Faker) ErrorHTTPServer() error
- func (f *Faker) ErrorObject() error
- func (f *Faker) ErrorRuntime() error
- func (f *Faker) ErrorValidation() error
- func (f *Faker) FarmAnimal() string
- func (f *Faker) FileExtension() string
- func (f *Faker) FileMimeType() string
- func (f *Faker) FirefoxUserAgent() string
- func (f *Faker) FirstName() string
- func (f *Faker) FixedWidth(co *FixedWidthOptions) (string, error)
- func (f *Faker) FlipACoin() string
- func (f *Faker) Float32() float32
- func (f *Faker) Float32Range(min, max float32) float32
- func (f *Faker) Float64() float64
- func (f *Faker) Float64Range(min, max float64) float64
- func (f *Faker) Fruit() string
- func (f *Faker) FutureDate() time.Time
- func (f *Faker) Gamertag() string
- func (f *Faker) Gender() string
- func (f *Faker) Generate(dataVal string) (string, error)
- func (f *Faker) HTTPMethod() string
- func (f *Faker) HTTPStatusCode() int
- func (f *Faker) HTTPStatusCodeSimple() int
- func (f *Faker) HTTPVersion() string
- func (f *Faker) HackerAbbreviation() string
- func (f *Faker) HackerAdjective() string
- func (f *Faker) HackerNoun() string
- func (f *Faker) HackerPhrase() string
- func (f *Faker) HackerVerb() string
- func (f *Faker) HackeringVerb() string
- func (f *Faker) HexColor() string
- func (f *Faker) HexUint(bitSize int) string
- func (f *Faker) HipsterParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
- func (f *Faker) HipsterSentence(wordCount int) string
- func (f *Faker) HipsterWord() string
- func (f *Faker) Hobby() string
- func (f *Faker) Hour() int
- func (f *Faker) IPv4Address() string
- func (f *Faker) IPv6Address() string
- func (f *Faker) Image(width int, height int) *img.RGBA
- func (f *Faker) ImageJpeg(width int, height int) []byte
- func (f *Faker) ImagePng(width int, height int) []byte
- func (f *Faker) InputName() string
- func (f *Faker) Int() int
- func (f *Faker) Int16() int16
- func (f *Faker) Int32() int32
- func (f *Faker) Int64() int64
- func (f *Faker) Int8() int8
- func (f *Faker) IntN(n int) int
- func (f *Faker) IntRange(min, max int) int
- func (f *Faker) Interjection() string
- func (f *Faker) Isin() string
- func (f *Faker) JSON(jo *JSONOptions) ([]byte, error)
- func (f *Faker) Job() *JobInfo
- func (f *Faker) JobDescriptor() string
- func (f *Faker) JobLevel() string
- func (f *Faker) JobTitle() string
- func (f *Faker) Language() string
- func (f *Faker) LanguageAbbreviation() string
- func (f *Faker) LanguageBCP() string
- func (f *Faker) LastName() string
- func (f *Faker) Latitude() float64
- func (f *Faker) LatitudeInRange(min, max float64) (float64, error)
- func (f *Faker) Letter() string
- func (f *Faker) LetterN(n uint) string
- func (f *Faker) Lexify(str string) string
- func (f *Faker) LogLevel(logType string) string
- func (f *Faker) Longitude() float64
- func (f *Faker) LongitudeInRange(min, max float64) (float64, error)
- func (f *Faker) LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
- func (f *Faker) LoremIpsumSentence(wordCount int) string
- func (f *Faker) LoremIpsumWord() string
- func (f *Faker) Lunch() string
- func (f *Faker) MacAddress() string
- func (f *Faker) Map() map[string]any
- func (f *Faker) Markdown(co *MarkdownOptions) (string, error)
- func (f *Faker) MiddleName() string
- func (f *Faker) MinecraftAnimal() string
- func (f *Faker) MinecraftArmorPart() string
- func (f *Faker) MinecraftArmorTier() string
- func (f *Faker) MinecraftBiome() string
- func (f *Faker) MinecraftDye() string
- func (f *Faker) MinecraftFood() string
- func (f *Faker) MinecraftMobBoss() string
- func (f *Faker) MinecraftMobHostile() string
- func (f *Faker) MinecraftMobNeutral() string
- func (f *Faker) MinecraftMobPassive() string
- func (f *Faker) MinecraftOre() string
- func (f *Faker) MinecraftTool() string
- func (f *Faker) MinecraftVillagerJob() string
- func (f *Faker) MinecraftVillagerLevel() string
- func (f *Faker) MinecraftVillagerStation() string
- func (f *Faker) MinecraftWeapon() string
- func (f *Faker) MinecraftWeather() string
- func (f *Faker) MinecraftWood() string
- func (f *Faker) Minute() int
- func (f *Faker) Month() int
- func (f *Faker) MonthString() string
- func (f *Faker) Movie() *MovieInfo
- func (f *Faker) MovieGenre() string
- func (f *Faker) MovieName() string
- func (f *Faker) Name() string
- func (f *Faker) NamePrefix() string
- func (f *Faker) NameSuffix() string
- func (f *Faker) NanoSecond() int
- func (f *Faker) NiceColors() []string
- func (f *Faker) Noun() string
- func (f *Faker) NounAbstract() string
- func (f *Faker) NounCollectiveAnimal() string
- func (f *Faker) NounCollectivePeople() string
- func (f *Faker) NounCollectiveThing() string
- func (f *Faker) NounCommon() string
- func (f *Faker) NounConcrete() string
- func (f *Faker) NounCountable() string
- func (f *Faker) NounDeterminer() string
- func (f *Faker) NounProper() string
- func (f *Faker) NounUncountable() string
- func (f *Faker) Number(min int, max int) int
- func (f *Faker) Numerify(str string) string
- func (f *Faker) OperaUserAgent() string
- func (f *Faker) Paragraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
- func (f *Faker) Password(lower bool, upper bool, numeric bool, special bool, space bool, num int) string
- func (f *Faker) PastDate() time.Time
- func (f *Faker) Person() *PersonInfo
- func (f *Faker) PetName() string
- func (f *Faker) Phone() string
- func (f *Faker) PhoneFormatted() string
- func (f *Faker) Phrase() string
- func (f *Faker) PhraseAdverb() string
- func (f *Faker) PhraseNoun() string
- func (f *Faker) PhrasePreposition() string
- func (f *Faker) PhraseVerb() string
- func (f *Faker) Preposition() string
- func (f *Faker) PrepositionCompound() string
- func (f *Faker) PrepositionDouble() string
- func (f *Faker) PrepositionSimple() string
- func (f *Faker) Price(min, max float64) float64
- func (f *Faker) Product() *ProductInfo
- func (f *Faker) ProductAudience() []string
- func (f *Faker) ProductBenefit() string
- func (f *Faker) ProductCategory() string
- func (f *Faker) ProductDescription() string
- func (f *Faker) ProductDimension() string
- func (f *Faker) ProductFeature() string
- func (f *Faker) ProductMaterial() string
- func (f *Faker) ProductName() string
- func (f *Faker) ProductSuffix() string
- func (f *Faker) ProductUPC() string
- func (f *Faker) ProductUseCase() string
- func (f *Faker) ProgrammingLanguage() string
- func (f *Faker) Pronoun() string
- func (f *Faker) PronounDemonstrative() string
- func (f *Faker) PronounIndefinite() string
- func (f *Faker) PronounInterrogative() string
- func (f *Faker) PronounObject() string
- func (f *Faker) PronounPersonal() string
- func (f *Faker) PronounPossessive() string
- func (f *Faker) PronounReflective() string
- func (f *Faker) PronounRelative() string
- func (f *Faker) Question() string
- func (f *Faker) Quote() string
- func (f *Faker) RGBColor() []int
- func (f *Faker) RandomInt(i []int) int
- func (f *Faker) RandomMapKey(mapI any) any
- func (f *Faker) RandomString(a []string) string
- func (f *Faker) RandomUint(u []uint) uint
- func (f *Faker) Regex(regexStr string) string
- func (f *Faker) SQL(so *SQLOptions) (string, error)
- func (f *Faker) SSN() string
- func (f *Faker) SafariUserAgent() string
- func (f *Faker) SafeColor() string
- func (f *Faker) School() string
- func (f *Faker) Second() int
- func (f *Faker) Seed(args ...any) error
- func (f *Faker) Sentence(wordCount int) string
- func (f *Faker) SentenceSimple() string
- func (f *Faker) ShuffleAnySlice(v any)
- func (f *Faker) ShuffleInts(a []int)
- func (f *Faker) ShuffleStrings(a []string)
- func (f *Faker) Slice(v any)
- func (f *Faker) Slogan() string
- func (f *Faker) Snack() string
- func (f *Faker) State() string
- func (f *Faker) StateAbr() string
- func (f *Faker) Street() string
- func (f *Faker) StreetName() string
- func (f *Faker) StreetNumber() string
- func (f *Faker) StreetPrefix() string
- func (f *Faker) StreetSuffix() string
- func (f *Faker) Struct(v any) error
- func (f *Faker) Svg(options *SVGOptions) string
- func (f *Faker) Teams(peopleArray []string, teamsArray []string) map[string][]string
- func (f *Faker) Template(template string, co *TemplateOptions) (string, error)
- func (f *Faker) TimeZone() string
- func (f *Faker) TimeZoneAbv() string
- func (f *Faker) TimeZoneFull() string
- func (f *Faker) TimeZoneOffset() float32
- func (f *Faker) TimeZoneRegion() string
- func (f *Faker) URL() string
- func (f *Faker) UUID() string
- func (f *Faker) Uint() uint
- func (f *Faker) Uint16() uint16
- func (f *Faker) Uint32() uint32
- func (f *Faker) Uint64() uint64
- func (f *Faker) Uint8() uint8
- func (f *Faker) UintN(n uint) uint
- func (f *Faker) UintRange(min, max uint) uint
- func (f *Faker) UserAgent() string
- func (f *Faker) Username() string
- func (f *Faker) Vegetable() string
- func (f *Faker) Verb() string
- func (f *Faker) VerbAction() string
- func (f *Faker) VerbHelping() string
- func (f *Faker) VerbIntransitive() string
- func (f *Faker) VerbLinking() string
- func (f *Faker) VerbTransitive() string
- func (f *Faker) Vowel() string
- func (f *Faker) WeekDay() string
- func (f *Faker) Weighted(options []any, weights []float32) (any, error)
- func (f *Faker) Word() string
- func (f *Faker) XML(xo *XMLOptions) ([]byte, error)
- func (f *Faker) Year() int
- func (f *Faker) Zip() string
- type Field
- type FixedWidthOptions
- type Info
- func (i *Info) GetAny(m *MapParams, field string) (any, error)
- func (i *Info) GetBool(m *MapParams, field string) (bool, error)
- func (i *Info) GetField(m *MapParams, field string) (*Param, []string, error)
- func (i *Info) GetFloat32(m *MapParams, field string) (float32, error)
- func (i *Info) GetFloat32Array(m *MapParams, field string) ([]float32, error)
- func (i *Info) GetFloat64(m *MapParams, field string) (float64, error)
- func (i *Info) GetInt(m *MapParams, field string) (int, error)
- func (i *Info) GetIntArray(m *MapParams, field string) ([]int, error)
- func (i *Info) GetMap(m *MapParams, field string) (map[string]any, error)
- func (i *Info) GetString(m *MapParams, field string) (string, error)
- func (i *Info) GetStringArray(m *MapParams, field string) ([]string, error)
- func (i *Info) GetUint(m *MapParams, field string) (uint, error)
- func (i *Info) GetUintArray(m *MapParams, field string) ([]uint, error)
- type JSONOptions
- type JobInfo
- type MapParams
- type MapParamsValue
- type MarkdownOptions
- type MovieInfo
- type Param
- type PersonInfo
- type ProductInfo
- type SQLOptions
- type SVGOptions
- type TemplateOptions
- type XMLOptions
Examples ¶
- Package
- Package (Custom)
- Package (Custom_with_params)
- AchAccount
- AchRouting
- Address
- Adjective
- AdjectiveDemonstrative
- AdjectiveDescriptive
- AdjectiveIndefinite
- AdjectiveInterrogative
- AdjectivePossessive
- AdjectiveProper
- AdjectiveQuantitative
- Adverb
- AdverbDegree
- AdverbFrequencyDefinite
- AdverbFrequencyIndefinite
- AdverbManner
- AdverbPlace
- AdverbTimeDefinite
- AdverbTimeIndefinite
- Animal
- AnimalType
- AppAuthor
- AppName
- AppVersion
- BS
- BeerAlcohol
- BeerBlg
- BeerHop
- BeerIbu
- BeerMalt
- BeerName
- BeerStyle
- BeerYeast
- Bird
- BitcoinAddress
- BitcoinPrivateKey
- Blurb
- Book
- BookAuthor
- BookGenre
- BookTitle
- Bool
- Breakfast
- BuzzWord
- CSV (Array)
- Car
- CarFuelType
- CarMaker
- CarModel
- CarTransmissionType
- CarType
- Cat
- CelebrityActor
- CelebrityBusiness
- CelebritySport
- ChromeUserAgent
- City
- Color
- Comment
- Company
- CompanySuffix
- Connective
- ConnectiveCasual
- ConnectiveComparative
- ConnectiveComplaint
- ConnectiveExamplify
- ConnectiveListing
- ConnectiveTime
- Contact
- Country
- CountryAbr
- CreditCard
- CreditCardCvv
- CreditCardExp
- CreditCardNumber
- CreditCardType
- Currency
- CurrencyLong
- CurrencyShort
- Cusip
- Date
- DateRange
- Day
- Dessert
- Dice
- Digit
- DigitN
- Dinner
- Dog
- DomainName
- DomainSuffix
- Drink
- EmailText
- Emoji
- EmojiAlias
- EmojiCategory
- EmojiDescription
- EmojiTag
- Error
- ErrorDatabase
- ErrorGRPC
- ErrorHTTP
- ErrorHTTPClient
- ErrorHTTPServer
- ErrorObject
- ErrorRuntime
- ErrorValidation
- Fakeable
- Fakeable (Employee)
- Fakeable (GammaFloat64)
- Faker.AchAccount
- Faker.AchRouting
- Faker.Address
- Faker.Adjective
- Faker.AdjectiveDemonstrative
- Faker.AdjectiveDescriptive
- Faker.AdjectiveIndefinite
- Faker.AdjectiveInterrogative
- Faker.AdjectivePossessive
- Faker.AdjectiveProper
- Faker.AdjectiveQuantitative
- Faker.Adverb
- Faker.AdverbDegree
- Faker.AdverbFrequencyDefinite
- Faker.AdverbFrequencyIndefinite
- Faker.AdverbManner
- Faker.AdverbPlace
- Faker.AdverbTimeDefinite
- Faker.AdverbTimeIndefinite
- Faker.Animal
- Faker.AnimalType
- Faker.AppAuthor
- Faker.AppName
- Faker.AppVersion
- Faker.BS
- Faker.BeerAlcohol
- Faker.BeerBlg
- Faker.BeerHop
- Faker.BeerIbu
- Faker.BeerMalt
- Faker.BeerName
- Faker.BeerStyle
- Faker.BeerYeast
- Faker.Bird
- Faker.BitcoinAddress
- Faker.BitcoinPrivateKey
- Faker.Blurb
- Faker.Book
- Faker.BookAuthor
- Faker.BookGenre
- Faker.BookTitle
- Faker.Bool
- Faker.Breakfast
- Faker.BuzzWord
- Faker.CSV (Array)
- Faker.Car
- Faker.CarFuelType
- Faker.CarMaker
- Faker.CarModel
- Faker.CarTransmissionType
- Faker.CarType
- Faker.Cat
- Faker.CelebrityActor
- Faker.CelebrityBusiness
- Faker.CelebritySport
- Faker.ChromeUserAgent
- Faker.City
- Faker.Color
- Faker.Comment
- Faker.Company
- Faker.CompanySuffix
- Faker.Connective
- Faker.ConnectiveCasual
- Faker.ConnectiveComparative
- Faker.ConnectiveComplaint
- Faker.ConnectiveExamplify
- Faker.ConnectiveListing
- Faker.ConnectiveTime
- Faker.Contact
- Faker.Country
- Faker.CountryAbr
- Faker.CreditCard
- Faker.CreditCardCvv
- Faker.CreditCardExp
- Faker.CreditCardNumber
- Faker.CreditCardType
- Faker.Currency
- Faker.CurrencyLong
- Faker.CurrencyShort
- Faker.Cusip
- Faker.Date
- Faker.DateRange
- Faker.Day
- Faker.Dessert
- Faker.Dice
- Faker.Digit
- Faker.DigitN
- Faker.Dinner
- Faker.Dog
- Faker.DomainName
- Faker.DomainSuffix
- Faker.Drink
- Faker.Email
- Faker.EmailText
- Faker.Emoji
- Faker.EmojiAlias
- Faker.EmojiCategory
- Faker.EmojiDescription
- Faker.EmojiTag
- Faker.Error
- Faker.ErrorDatabase
- Faker.ErrorGRPC
- Faker.ErrorHTTP
- Faker.ErrorHTTPClient
- Faker.ErrorHTTPServer
- Faker.ErrorObject
- Faker.ErrorRuntime
- Faker.ErrorValidation
- Faker.FarmAnimal
- Faker.FileExtension
- Faker.FileMimeType
- Faker.FirefoxUserAgent
- Faker.FirstName
- Faker.FixedWidth
- Faker.FlipACoin
- Faker.Float32
- Faker.Float32Range
- Faker.Float64
- Faker.Float64Range
- Faker.Fruit
- Faker.FutureDate
- Faker.Gamertag
- Faker.Gender
- Faker.Generate
- Faker.HTTPMethod
- Faker.HTTPStatusCode
- Faker.HTTPStatusCodeSimple
- Faker.HTTPVersion
- Faker.HackerAbbreviation
- Faker.HackerAdjective
- Faker.HackerNoun
- Faker.HackerPhrase
- Faker.HackerVerb
- Faker.HackeringVerb
- Faker.HexColor
- Faker.HexUint
- Faker.HipsterParagraph
- Faker.HipsterSentence
- Faker.HipsterWord
- Faker.Hobby
- Faker.Hour
- Faker.IPv4Address
- Faker.IPv6Address
- Faker.Image
- Faker.ImageJpeg
- Faker.ImagePng
- Faker.InputName
- Faker.Int16
- Faker.Int32
- Faker.Int64
- Faker.Int8
- Faker.IntRange
- Faker.Interjection
- Faker.Isin
- Faker.JSON (Array)
- Faker.JSON (Object)
- Faker.Job
- Faker.JobDescriptor
- Faker.JobLevel
- Faker.JobTitle
- Faker.Language
- Faker.LanguageAbbreviation
- Faker.LanguageBCP
- Faker.LastName
- Faker.Latitude
- Faker.LatitudeInRange
- Faker.Letter
- Faker.LetterN
- Faker.Lexify
- Faker.LogLevel
- Faker.Longitude
- Faker.LongitudeInRange
- Faker.LoremIpsumParagraph
- Faker.LoremIpsumSentence
- Faker.LoremIpsumWord
- Faker.Lunch
- Faker.MacAddress
- Faker.Map
- Faker.Markdown
- Faker.MiddleName
- Faker.MinecraftAnimal
- Faker.MinecraftArmorPart
- Faker.MinecraftArmorTier
- Faker.MinecraftBiome
- Faker.MinecraftDye
- Faker.MinecraftFood
- Faker.MinecraftMobBoss
- Faker.MinecraftMobHostile
- Faker.MinecraftMobNeutral
- Faker.MinecraftMobPassive
- Faker.MinecraftOre
- Faker.MinecraftTool
- Faker.MinecraftVillagerJob
- Faker.MinecraftVillagerLevel
- Faker.MinecraftVillagerStation
- Faker.MinecraftWeapon
- Faker.MinecraftWeather
- Faker.MinecraftWood
- Faker.Minute
- Faker.Month
- Faker.MonthString
- Faker.Movie
- Faker.MovieGenre
- Faker.MovieName
- Faker.Name
- Faker.NamePrefix
- Faker.NameSuffix
- Faker.NanoSecond
- Faker.NiceColors
- Faker.Noun
- Faker.NounAbstract
- Faker.NounCollectiveAnimal
- Faker.NounCollectivePeople
- Faker.NounCollectiveThing
- Faker.NounCommon
- Faker.NounConcrete
- Faker.NounCountable
- Faker.NounDeterminer
- Faker.NounProper
- Faker.NounUncountable
- Faker.Number
- Faker.Numerify
- Faker.OperaUserAgent
- Faker.Paragraph
- Faker.Password
- Faker.PastDate
- Faker.Person
- Faker.PetName
- Faker.Phone
- Faker.PhoneFormatted
- Faker.Phrase
- Faker.PhraseAdverb
- Faker.PhraseNoun
- Faker.PhrasePreposition
- Faker.PhraseVerb
- Faker.Preposition
- Faker.PrepositionCompound
- Faker.PrepositionDouble
- Faker.PrepositionSimple
- Faker.Price
- Faker.Product
- Faker.ProductAudience
- Faker.ProductBenefit
- Faker.ProductCategory
- Faker.ProductDescription
- Faker.ProductDimension
- Faker.ProductFeature
- Faker.ProductMaterial
- Faker.ProductName
- Faker.ProductSuffix
- Faker.ProductUPC
- Faker.ProductUseCase
- Faker.ProgrammingLanguage
- Faker.Pronoun
- Faker.PronounDemonstrative
- Faker.PronounIndefinite
- Faker.PronounInterrogative
- Faker.PronounObject
- Faker.PronounPersonal
- Faker.PronounPossessive
- Faker.PronounReflective
- Faker.PronounRelative
- Faker.Question
- Faker.Quote
- Faker.RGBColor
- Faker.RandomInt
- Faker.RandomString
- Faker.RandomUint
- Faker.Regex
- Faker.SQL
- Faker.SSN
- Faker.SafariUserAgent
- Faker.SafeColor
- Faker.School
- Faker.Second
- Faker.Sentence
- Faker.SentenceSimple
- Faker.ShuffleAnySlice
- Faker.ShuffleInts
- Faker.ShuffleStrings
- Faker.Slice
- Faker.Slice (Struct)
- Faker.Slogan
- Faker.Snack
- Faker.State
- Faker.StateAbr
- Faker.Street
- Faker.StreetName
- Faker.StreetNumber
- Faker.StreetPrefix
- Faker.StreetSuffix
- Faker.Struct
- Faker.Struct (Array)
- Faker.Svg
- Faker.Teams
- Faker.Template
- Faker.TimeZone
- Faker.TimeZoneAbv
- Faker.TimeZoneFull
- Faker.TimeZoneOffset
- Faker.TimeZoneRegion
- Faker.URL
- Faker.UUID
- Faker.Uint16
- Faker.Uint32
- Faker.Uint64
- Faker.Uint8
- Faker.UintRange
- Faker.UserAgent
- Faker.Username
- Faker.Vegetable
- Faker.Verb
- Faker.VerbAction
- Faker.VerbHelping
- Faker.VerbIntransitive
- Faker.VerbLinking
- Faker.VerbTransitive
- Faker.Vowel
- Faker.WeekDay
- Faker.Word
- Faker.XML (Array)
- Faker.XML (Single)
- Faker.Year
- Faker.Zip
- FarmAnimal
- FileExtension
- FileMimeType
- FirefoxUserAgent
- FirstName
- FixedWidth
- FixedWidth (Default)
- FixedWidth (NoHeader)
- FlipACoin
- Float32
- Float32Range
- Float64
- Float64Range
- Fruit
- FutureDate
- Gamertag
- Gender
- Generate
- HTTPMethod
- HTTPStatusCode
- HTTPStatusCodeSimple
- HTTPVersion
- HackerAbbreviation
- HackerAdjective
- HackerNoun
- HackerPhrase
- HackerVerb
- HackeringVerb
- HexColor
- HexUint
- HipsterParagraph
- HipsterSentence
- HipsterWord
- Hobby
- Hour
- IPv4Address
- IPv6Address
- Image
- ImageJpeg
- ImagePng
- InputName
- Int16
- Int32
- Int64
- Int8
- IntRange
- Interjection
- Isin
- JSON (Array)
- JSON (NumberWithTag)
- JSON (Object)
- Job
- JobDescriptor
- JobLevel
- JobTitle
- Language
- LanguageAbbreviation
- LanguageBCP
- LastName
- Latitude
- LatitudeInRange
- Letter
- LetterN
- Lexify
- LogLevel
- Longitude
- LongitudeInRange
- LoremIpsumParagraph
- LoremIpsumSentence
- LoremIpsumWord
- Lunch
- MacAddress
- Map
- Markdown
- MiddleName
- MinecraftAnimal
- MinecraftArmorPart
- MinecraftArmorTier
- MinecraftBiome
- MinecraftDye
- MinecraftFood
- MinecraftMobBoss
- MinecraftMobHostile
- MinecraftMobNeutral
- MinecraftMobPassive
- MinecraftOre
- MinecraftTool
- MinecraftVillagerJob
- MinecraftVillagerLevel
- MinecraftVillagerStation
- MinecraftWeapon
- MinecraftWeather
- MinecraftWood
- Minute
- Month
- MonthString
- Movie
- MovieGenre
- MovieName
- Name
- NamePrefix
- NameSuffix
- NanoSecond
- New
- NewFaker
- NiceColors
- Noun
- NounAbstract
- NounCollectiveAnimal
- NounCollectivePeople
- NounCollectiveThing
- NounCommon
- NounConcrete
- NounCountable
- NounDeterminer
- NounProper
- NounUncountable
- Number
- Numerify
- OperaUserAgent
- Paragraph
- Password
- PastDate
- Person
- PetName
- Phone
- PhoneFormatted
- Phrase
- PhraseAdverb
- PhraseNoun
- PhrasePreposition
- PhraseVerb
- Preposition
- PrepositionCompound
- PrepositionDouble
- PrepositionSimple
- Price
- Product
- ProductAudience
- ProductBenefit
- ProductCategory
- ProductDescription
- ProductDimension
- ProductFeature
- ProductMaterial
- ProductName
- ProductSuffix
- ProductUPC
- ProductUseCase
- ProgrammingLanguage
- Pronoun
- PronounDemonstrative
- PronounIndefinite
- PronounInterrogative
- PronounObject
- PronounPersonal
- PronounPossessive
- PronounReflective
- PronounRelative
- Question
- Quote
- RGBColor
- RandomInt
- RandomString
- RandomUint
- Regex
- SQL
- SSN
- SafariUserAgent
- SafeColor
- School
- Second
- Sentence
- SentenceSimple
- ShuffleAnySlice
- ShuffleInts
- ShuffleStrings
- Slice
- Slice (Struct)
- Slogan
- Snack
- State
- StateAbr
- Street
- StreetName
- StreetNumber
- StreetPrefix
- StreetSuffix
- Struct
- Struct (Array)
- Svg
- Teams
- Template
- TimeZone
- TimeZoneAbv
- TimeZoneFull
- TimeZoneOffset
- TimeZoneRegion
- URL
- UUID
- Uint16
- Uint32
- Uint64
- Uint8
- UintRange
- UserAgent
- Username
- Vegetable
- Verb
- VerbAction
- VerbHelping
- VerbIntransitive
- VerbLinking
- VerbTransitive
- Vowel
- WeekDay
- Weighted
- Word
- XML (Array)
- XML (Single)
- Year
- Zip
Constants ¶
This section is empty.
Variables ¶
var FuncLookups map[string]Info
FuncLookups is the primary map array with mapping to all available data
Functions ¶
func AchAccount ¶
func AchAccount() string
AchAccount will generate a 12 digit account number
Example ¶
Seed(11) fmt.Println(AchAccount())
Output: 881252759890
func AchRouting ¶
func AchRouting() string
AchRouting will generate a 9 digit routing number
Example ¶
Seed(11) fmt.Println(AchRouting())
Output: 881252759
func AddFuncLookup ¶
AddFuncLookup takes a field and adds it to map
func Adjective ¶
func Adjective() string
Adjective will generate a random adjective
Example ¶
Seed(11) fmt.Println(Adjective())
Output: none
func AdjectiveDemonstrative ¶
func AdjectiveDemonstrative() string
AdjectiveDemonstrative will generate a random demonstrative adjective
Example ¶
Seed(11) fmt.Println(AdjectiveDemonstrative())
Output: it
func AdjectiveDescriptive ¶
func AdjectiveDescriptive() string
AdjectiveDescriptive will generate a random descriptive adjective
Example ¶
Seed(11) fmt.Println(AdjectiveDescriptive())
Output: tired
func AdjectiveIndefinite ¶
func AdjectiveIndefinite() string
AdjectiveIndefinite will generate a random indefinite adjective
Example ¶
Seed(11) fmt.Println(AdjectiveIndefinite())
Output: several
func AdjectiveInterrogative ¶
func AdjectiveInterrogative() string
AdjectiveInterrogative will generate a random interrogative adjective
Example ¶
Seed(11) fmt.Println(AdjectiveInterrogative())
Output: which
func AdjectivePossessive ¶
func AdjectivePossessive() string
AdjectivePossessive will generate a random possessive adjective
Example ¶
Seed(11) fmt.Println(AdjectivePossessive())
Output: their
func AdjectiveProper ¶
func AdjectiveProper() string
AdjectiveProper will generate a random proper adjective
Example ¶
Seed(11) fmt.Println(AdjectiveProper())
Output: Swiss
func AdjectiveQuantitative ¶
func AdjectiveQuantitative() string
AdjectiveQuantitative will generate a random quantitative adjective
Example ¶
Seed(11) fmt.Println(AdjectiveQuantitative())
Output: sparse
func Adverb ¶
func Adverb() string
Adverb will generate a random adverb
Example ¶
Seed(11) fmt.Println(Adverb())
Output: ever
func AdverbDegree ¶
func AdverbDegree() string
AdverbDegree will generate a random degree adverb
Example ¶
Seed(11) fmt.Println(AdverbDegree())
Output: too
func AdverbFrequencyDefinite ¶
func AdverbFrequencyDefinite() string
AdverbFrequencyDefinite will generate a random frequency definite adverb
Example ¶
Seed(11) fmt.Println(AdverbFrequencyDefinite())
Output: yearly
func AdverbFrequencyIndefinite ¶
func AdverbFrequencyIndefinite() string
AdverbFrequencyIndefinite will generate a random frequency indefinite adverb
Example ¶
Seed(11) fmt.Println(AdverbFrequencyIndefinite())
Output: generally
func AdverbManner ¶
func AdverbManner() string
AdverbManner will generate a random manner adverb
Example ¶
Seed(11) fmt.Println(AdverbManner())
Output: tensely
func AdverbPlace ¶
func AdverbPlace() string
AdverbPlace will generate a random place adverb
Example ¶
Seed(11) fmt.Println(AdverbPlace())
Output: under
func AdverbTimeDefinite ¶
func AdverbTimeDefinite() string
AdverbTimeDefinite will generate a random time definite adverb
Example ¶
Seed(11) fmt.Println(AdverbTimeDefinite())
Output: yesterday
func AdverbTimeIndefinite ¶
func AdverbTimeIndefinite() string
AdverbTimeIndefinite will generate a random time indefinite adverb
Example ¶
Seed(11) fmt.Println(AdverbTimeIndefinite())
Output: soon
func Animal ¶
func Animal() string
Animal will return a random animal
Example ¶
Seed(11) fmt.Println(Animal())
Output: turtle
func AnimalType ¶
func AnimalType() string
AnimalType will return a random animal type
Example ¶
Seed(11) fmt.Println(AnimalType())
Output: reptiles
func AppAuthor ¶
func AppAuthor() string
AppAuthor will generate a random company or person name
Example ¶
Seed(11) fmt.Println(AppAuthor())
Output: StreetEasy
func AppName ¶
func AppName() string
AppName will generate a random app name
Example ¶
Seed(11) fmt.Println(AppName())
Output: Swanthink
func AppVersion ¶
func AppVersion() string
AppVersion will generate a random app version
Example ¶
Seed(11) fmt.Println(AppVersion())
Output: 5.18.4
func BS ¶
func BS() string
BS will generate a random company bs string
Example ¶
Seed(11) fmt.Println(BS())
Output: models
func BeerAlcohol ¶
func BeerAlcohol() string
BeerAlcohol will return a random beer alcohol level between 2.0 and 10.0
Example ¶
Seed(11) fmt.Println(BeerAlcohol())
Output: 8.2%
func BeerBlg ¶
func BeerBlg() string
BeerBlg will return a random beer blg between 5.0 and 20.0
Example ¶
Seed(11) fmt.Println(BeerBlg())
Output: 16.6°Blg
func BeerHop ¶
func BeerHop() string
BeerHop will return a random beer hop
Example ¶
Seed(11) fmt.Println(BeerHop())
Output: TriplePearl
func BeerIbu ¶
func BeerIbu() string
BeerIbu will return a random beer ibu value between 10 and 100
Example ¶
Seed(11) fmt.Println(BeerIbu())
Output: 91 IBU
func BeerMalt ¶
func BeerMalt() string
BeerMalt will return a random beer malt
Example ¶
Seed(11) fmt.Println(BeerMalt())
Output: Munich
func BeerName ¶
func BeerName() string
BeerName will return a random beer name
Example ¶
Seed(11) fmt.Println(BeerName())
Output: Sierra Nevada Bigfoot Barleywine Style Ale
func BeerStyle ¶
func BeerStyle() string
BeerStyle will return a random beer style
Example ¶
Seed(11) fmt.Println(BeerStyle())
Output: Vegetable Beer
func BeerYeast ¶
func BeerYeast() string
BeerYeast will return a random beer yeast
Example ¶
Seed(11) fmt.Println(BeerYeast())
Output: 2308 - Munich Lager
func Bird ¶
func Bird() string
Bird will return a random bird species
Example ¶
Seed(11) fmt.Println(Bird())
Output: toucan
func BitcoinAddress ¶
func BitcoinAddress() string
BitcoinAddress will generate a random bitcoin address consisting of numbers, upper and lower characters
Example ¶
Seed(11) fmt.Println(BitcoinAddress())
Output: 13blsBo8bffq7a35c5nwLT4eXWu0pReLF1
func BitcoinPrivateKey ¶
func BitcoinPrivateKey() string
BitcoinPrivateKey will generate a random bitcoin private key base58 consisting of numbers, upper and lower characters
Example ¶
Seed(11) fmt.Println(BitcoinPrivateKey())
Output: 5JMZxkQX2PgaasaHc8wnWLNdMu7rxeU7xS64ev7RWNinacicPfm
func Blurb ¶
func Blurb() string
Blurb will generate a random company blurb string
Example ¶
Seed(11) fmt.Println(Blurb())
Output: Teamwork
func BookAuthor ¶
func BookAuthor() string
Example ¶
Seed(11) fmt.Println(BookAuthor())
Output: Vladimir Nabokov
func BookGenre ¶
func BookGenre() string
Example ¶
Seed(11) fmt.Println(BookGenre())
Output: Thriller
func BookTitle ¶
func BookTitle() string
Example ¶
Seed(11) fmt.Println(BookTitle())
Output: Things Fall Apart
func Bool ¶
func Bool() bool
Bool will generate a random boolean value
Example ¶
Seed(11) fmt.Println(Bool())
Output: false
func Breakfast ¶
func Breakfast() string
Breakfast will return a random breakfast name
Example ¶
Seed(11) fmt.Println(Breakfast())
Output: Purple cow
func BuzzWord ¶
func BuzzWord() string
BuzzWord will generate a random company buzz word string
Example ¶
Seed(11) fmt.Println(BuzzWord())
Output: open system
func CSV ¶
func CSV(co *CSVOptions) ([]byte, error)
CSV generates an object or an array of objects in json format A nil CSVOptions returns a randomly structured CSV.
Example (Array) ¶
Seed(11) value, err := CSV(&CSVOptions{ RowCount: 3, Fields: []Field{ {Name: "id", Function: "autoincrement"}, {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: id,first_name,last_name,password 1,Sonny,Stiedemann,8nwf0o3sBXcR 2,Verda,Brakus,3beWLpq75Lua 3,Jules,Cremin,Uu38J14Y8W82
func CarFuelType ¶
func CarFuelType() string
CarFuelType will return a random fuel type
Example ¶
Seed(11) fmt.Println(CarFuelType())
Output: Electric
func CarMaker ¶
func CarMaker() string
CarMaker will return a random car maker
Example ¶
Seed(11) fmt.Println(CarMaker())
Output: Spyker
func CarModel ¶
func CarModel() string
CarModel will return a random car model
Example ¶
Seed(11) fmt.Println(CarModel())
Output: Prius
func CarTransmissionType ¶
func CarTransmissionType() string
CarTransmissionType will return a random transmission type
Example ¶
Seed(11) fmt.Println(CarTransmissionType())
Output: Manual
func CarType ¶
func CarType() string
CarType will generate a random car type string
Example ¶
Seed(11) fmt.Println(CarType())
Output: Passenger car heavy
func Cat ¶
func Cat() string
Cat will return a random cat breed
Example ¶
Seed(11) fmt.Println(Cat())
Output: Sokoke
func Categories ¶
Categories will return a map string array of available data categories and sub categories
func CelebrityActor ¶
func CelebrityActor() string
CelebrityActor will generate a random celebrity actor
Example ¶
Seed(11) fmt.Println(CelebrityActor())
Output: Shah Rukh Khan
func CelebrityBusiness ¶
func CelebrityBusiness() string
CelebrityBusiness will generate a random celebrity business person
Example ¶
Seed(11) fmt.Println(CelebrityBusiness())
Output: Prescott Bush
func CelebritySport ¶
func CelebritySport() string
CelebritySport will generate a random celebrity sport person
Example ¶
Seed(11) fmt.Println(CelebritySport())
Output: Grete Waitz
func ChromeUserAgent ¶
func ChromeUserAgent() string
ChromeUserAgent will generate a random chrome browser user agent string
Example ¶
Seed(11) fmt.Println(ChromeUserAgent())
Output: Mozilla/5.0 (Windows CE) AppleWebKit/5362 (KHTML, like Gecko) Chrome/36.0.820.0 Mobile Safari/5362
func City ¶
func City() string
City will generate a random city string
Example ¶
Seed(11) fmt.Println(City())
Output: Reno
func Color ¶
func Color() string
Color will generate a random color string
Example ¶
Seed(11) fmt.Println(Color())
Output: SlateGray
func Comment ¶
func Comment() string
Comment will generate a random statement or remark expressing an opinion, observation, or reaction
Example ¶
Seed(11) fmt.Println(Comment())
Output: Fear Drink To Heart.
func Company ¶
func Company() string
Company will generate a random company name string
Example ¶
Seed(11) fmt.Println(Company())
Output: TransparaGov
func CompanySuffix ¶
func CompanySuffix() string
CompanySuffix will generate a random company suffix string
Example ¶
Seed(11) fmt.Println(CompanySuffix())
Output: Inc
func Connective ¶
func Connective() string
Connective will generate a random connective
Example ¶
Seed(11) fmt.Println(Connective())
Output: through
func ConnectiveCasual ¶
func ConnectiveCasual() string
ConnectiveCasual will generate a random casual connective
Example ¶
Seed(11) fmt.Println(ConnectiveCasual())
Output: though
func ConnectiveComparative ¶
func ConnectiveComparative() string
ConnectiveComparative will generate a random comparative connective
Example ¶
Seed(11) fmt.Println(ConnectiveComparative())
Output: after all
func ConnectiveComplaint ¶
func ConnectiveComplaint() string
ConnectiveComplaint will generate a random complaint connective
Example ¶
Seed(11) fmt.Println(ConnectiveComplaint())
Output: i.e.
func ConnectiveExamplify ¶
func ConnectiveExamplify() string
ConnectiveExamplify will generate a random examplify connective
Example ¶
Seed(11) fmt.Println(ConnectiveExamplify())
Output: unless
func ConnectiveListing ¶
func ConnectiveListing() string
ConnectiveListing will generate a random listing connective
Example ¶
Seed(11) fmt.Println(ConnectiveListing())
Output: in summation
func ConnectiveTime ¶
func ConnectiveTime() string
ConnectiveTime will generate a random connective time
Example ¶
Seed(11) fmt.Println(ConnectiveTime())
Output: when
func Country ¶
func Country() string
Country will generate a random country string
Example ¶
Seed(11) fmt.Println(Country())
Output: Tonga
func CountryAbr ¶
func CountryAbr() string
CountryAbr will generate a random abbreviated country string
Example ¶
Seed(11) fmt.Println(CountryAbr())
Output: TO
func CreditCardCvv ¶
func CreditCardCvv() string
CreditCardCvv will generate a random CVV number Its a string because you could have 017 as an exp date
Example ¶
Seed(11) fmt.Println(CreditCardCvv())
Output: 881
func CreditCardExp ¶
func CreditCardExp() string
CreditCardExp will generate a random credit card expiration date string Exp date will always be a future date
Example ¶
Seed(11) fmt.Println(CreditCardExp())
Output: 11/33
func CreditCardNumber ¶
func CreditCardNumber(cco *CreditCardOptions) string
CreditCardNumber will generate a random luhn credit card number
Example ¶
Seed(11) fmt.Println(CreditCardNumber(nil)) fmt.Println(CreditCardNumber(&CreditCardOptions{Types: []string{"visa", "discover"}})) fmt.Println(CreditCardNumber(&CreditCardOptions{Bins: []string{"4111"}})) fmt.Println(CreditCardNumber(&CreditCardOptions{Gaps: true}))
Output: 6376121252759896 6449344737930519 4111026894059156 6706 2052 5709 6
func CreditCardType ¶
func CreditCardType() string
CreditCardType will generate a random credit card type string
Example ¶
Seed(11) fmt.Println(CreditCardType())
Output: Hiper
func CurrencyLong ¶
func CurrencyLong() string
CurrencyLong will generate a random long currency name
Example ¶
Seed(11) fmt.Println(CurrencyLong())
Output: Uganda Shilling
func CurrencyShort ¶
func CurrencyShort() string
CurrencyShort will generate a random short currency value
Example ¶
Seed(11) fmt.Println(CurrencyShort())
Output: UGX
func Cusip ¶
func Cusip() string
CUSIP
Example ¶
CUSIP Tests
Seed(11) fmt.Println(Cusip())
Output: 64HHTI0T8
func Date ¶
Date will generate a random time.Time struct
Example ¶
Seed(11) fmt.Println(Date())
Output: 2011-11-07 04:31:13.726582492 +0000 UTC
func DateRange ¶
DateRange will generate a random time.Time struct between a start and end date
Example ¶
Seed(11) fmt.Println(DateRange(time.Unix(0, 484633944473634951), time.Unix(0, 1431318744473668209))) // May 10, 1985 years to May 10, 2015
Output: 2012-03-26 09:20:49.250961474 +0000 UTC
func Day ¶
func Day() int
Day will generate a random day between 1 - 31
Example ¶
Seed(11) fmt.Println(Day())
Output: 28
func Dessert ¶
func Dessert() string
Dessert will return a random dessert name
Example ¶
Seed(11) fmt.Println(Dessert())
Output: Amish cream pie
func Dice ¶
Dice will generate a random set of dice
Example ¶
Seed(11) fmt.Println(Dice(1, []uint{6}))
Output: [6]
func Digit ¶
func Digit() string
Digit will generate a single ASCII digit
Example ¶
Seed(11) fmt.Println(Digit())
Output: 8
func DigitN ¶
DigitN will generate a random string of length N consists of ASCII digits. Note that the string generated can start with 0 and this function returns a string with a length of 1 when 0 is passed.
Example ¶
Seed(11) fmt.Println(DigitN(10))
Output: 8812527598
func Dinner ¶
func Dinner() string
Dinner will return a random dinner name
Example ¶
Seed(11) fmt.Println(Dinner())
Output: German apple cake with cream cheese frosting
func Dog ¶
func Dog() string
Dog will return a random dog breed
Example ¶
Seed(11) fmt.Println(Dog())
Output: Rat Terrier
func DomainName ¶
func DomainName() string
DomainName will generate a random url domain name
Example ¶
Seed(11) fmt.Println(DomainName())
Output: productinfrastructures.biz
func DomainSuffix ¶
func DomainSuffix() string
DomainSuffix will generate a random domain suffix
Example ¶
Seed(11) fmt.Println(DomainSuffix())
Output: io
func Drink ¶
func Drink() string
Drink will return a random drink name
Example ¶
Seed(11) fmt.Println(Drink())
Output: Wine
func Email ¶
func Email() string
Email will generate a random email string
Example ¶
Seed(11) fmt.Println(Email())
Output: sonnystiedemann@donnelly.biz
func EmailText ¶
func EmailText(co *EmailOptions) (string, error)
EmailText will return a single random text email template document
Example ¶
Seed(11) value, err := EmailText(&EmailOptions{}) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: Subject: Hi from Russ! Dear Donnelly, Greetings! I hope your day is going well. I trust this email finds you well. Sending good vibes your way. Galaxy they how shall cut lastly that someone additionally ambulance. Could a tennis occur why depend heels out can fire. Anyone sometimes that leap whom troop now scarcely since dance. Huh somebody constantly Italian outfit certain weekly murder who cackle. Because her break write nobody could according whoa bevy we. Them summation to oxygen Greek how previously a what answer. Handle daily ouch upon encourage that after his every she. Wearily still he herself huge failure for yay sparse thoughtfully. Box anyway Jungian regularly world great daily recently whose Elizabethan. Outside to theirs block while French closely sit you to. Out fight bored yours those bale Parisian host which so. Today Ecuadorian hourly decidedly his everybody this play this little. Them on recently eager usually bunch daily whose somebody them. Few tonight dishonesty spell battery less patience whose inside hair. Your answer hand tonight these she team which today Einsteinian. I'm eager to hear your feedback on it. If you have a moment, please feel free to check out the project on GitLab Your insights would be invaluable. Your thoughts matter to me. I appreciate your attention to this matter. Your feedback is greatly appreciated. Sincerely Hyman Rogahn mervingottlieb@goldner.com 1-275-132-4165
func Emoji ¶
func Emoji() string
Emoji will return a random fun emoji
Example ¶
Seed(11) fmt.Println(Emoji())
Output: 🇫🇴
func EmojiAlias ¶
func EmojiAlias() string
EmojiAlias will return a random fun emoji alias
Example ¶
Seed(11) fmt.Println(EmojiAlias())
Output: eritrea
func EmojiCategory ¶
func EmojiCategory() string
EmojiCategory will return a random fun emoji category
Example ¶
Seed(11) fmt.Println(EmojiCategory())
Output: Flags
func EmojiDescription ¶
func EmojiDescription() string
EmojiDescription will return a random fun emoji description
Example ¶
Seed(11) fmt.Println(EmojiDescription())
Output: flag: European Union
func EmojiTag ¶
func EmojiTag() string
EmojiTag will return a random fun emoji tag
Example ¶
Seed(11) fmt.Println(EmojiTag())
Output: toilet
func Error ¶
func Error() error
Error will return a random generic error
Example ¶
Seed(11) fmt.Println(Error())
Output: variable assigned before declaration
func ErrorDatabase ¶
func ErrorDatabase() error
ErrorDatabase will return a random database error
Example ¶
Seed(11) fmt.Println(ErrorDatabase())
Output: destination pointer is nil
func ErrorGRPC ¶
func ErrorGRPC() error
ErrorGRPC will return a random gRPC error
Example ¶
Seed(11) fmt.Println(ErrorGRPC())
Output: connection refused
func ErrorHTTP ¶
func ErrorHTTP() error
ErrorHTTP will return a random HTTP error
Example ¶
Seed(11) fmt.Println(ErrorHTTP())
Output: wrote more than the declared Content-Length
func ErrorHTTPClient ¶
func ErrorHTTPClient() error
ErrorHTTPClient will return a random HTTP client error response (400-418)
Example ¶
Seed(11) fmt.Println(ErrorHTTPClient())
Output: expectation failed
func ErrorHTTPServer ¶
func ErrorHTTPServer() error
ErrorHTTPServer will return a random HTTP server error response (500-511)
Example ¶
Seed(11) fmt.Println(ErrorHTTPServer())
Output: not extended
func ErrorObject ¶
func ErrorObject() error
ErrorObject will return a random error object word
Example ¶
Seed(11) fmt.Println(ErrorObject())
Output: url
func ErrorRuntime ¶
func ErrorRuntime() error
ErrorRuntime will return a random runtime error
Example ¶
Seed(11) fmt.Println(ErrorRuntime())
Output: expected 2 arguments, got 3
func ErrorValidation ¶
func ErrorValidation() error
ErrorValidation will return a random validation error
Example ¶
Seed(11) fmt.Println(ErrorValidation())
Output: payment details cannot be verified
func FarmAnimal ¶
func FarmAnimal() string
FarmAnimal will return a random animal that usually lives on a farm
Example ¶
Seed(11) fmt.Println(FarmAnimal())
Output: Sheep
func FileExtension ¶
func FileExtension() string
FileExtension will generate a random file extension
Example ¶
Seed(11) fmt.Println(FileExtension())
Output: dtd
func FileMimeType ¶
func FileMimeType() string
FileMimeType will generate a random mime file type
Example ¶
Seed(11) fmt.Println(FileMimeType())
Output: application/x-wri
func FirefoxUserAgent ¶
func FirefoxUserAgent() string
FirefoxUserAgent will generate a random firefox broswer user agent string
Example ¶
Seed(11) fmt.Println(FirefoxUserAgent())
Output: Mozilla/5.0 (Windows CE; en-US; rv:1.9.3.20) Gecko/2011-11-07 Firefox/36.0
func FirstName ¶
func FirstName() string
FirstName will generate a random first name
Example ¶
Seed(11) fmt.Println(FirstName())
Output: Sonny
func FixedWidth ¶
func FixedWidth(co *FixedWidthOptions) (string, error)
FixedWidth generates an table of random data in fixed width format A nil FixedWidthOptions returns a randomly structured FixedWidth.
Example ¶
Seed(11) value, err := FixedWidth(&FixedWidthOptions{ RowCount: 3, Fields: []Field{ {Name: "Name", Function: "{firstname} {lastname}"}, {Name: "Email", Function: "email"}, {Name: "Password", Function: "password", Params: MapParams{"special": {"false"}}}, {Name: "Age", Function: "{number:1,100}"}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: Name Email Password Age Sonny Stiedemann mollielegros@wilderman.org 3T8l34B5F0eb 62 Cody Donnelly stevebins@robel.io 3fnu2C12baqe 9 Julius Farrell tomasaullrich@hane.name e8W8SJGZi1Y4 77
Example (Default) ¶
Seed(11) value, err := FixedWidth(nil) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: Name Email Password Russ Donnelly missourigrimes@rohan.io N3xh07881HKv Cole Leannon evanadams@marquardt.com n2fja08VHMgw Darien Rempel thorajerde@cormier.com ZhMPq5v8z6iP Kaitlyn Wilderman constancenienow@smitham.io MkoTT5v5Mv6Q Rahul Turner irvingbins@lemke.io 8Wy0UV016u88 April Robel beaulahmayert@kautzer.net ykgR5bO83YSa Tomasa Waters lelandwaelchi@beahan.net k68Ew58F9a0V Sunny Hane dawnbaumbach@mcdermott.biz AbUjm6x5dwd8 Hilma Jast lavernerobel@bailey.io MyY49BLUWKCh
Example (NoHeader) ¶
Seed(11) value, err := FixedWidth(&FixedWidthOptions{ RowCount: 3, Fields: []Field{ {Name: "", Function: "{firstname} {lastname}"}, {Name: "", Function: "email"}, {Name: "", Function: "password", Params: MapParams{"special": {"false"}}}, {Name: "", Function: "{number:1,100}"}, }, }) if err != nil { fmt.Println(err) } fmt.Println(value)
Output: Sonny Stiedemann mollielegros@wilderman.org 3T8l34B5F0eb 62 Cody Donnelly stevebins@robel.io 3fnu2C12baqe 9 Julius Farrell tomasaullrich@hane.name e8W8SJGZi1Y4 77
func FlipACoin ¶
func FlipACoin() string
FlipACoin will return a random value of Heads or Tails
Example ¶
Seed(11) fmt.Println(FlipACoin())
Output: Tails
func Float32 ¶
func Float32() float32
Float32 will generate a random float32 value
Example ¶
Seed(11) fmt.Println(Float32())
Output: 0.3462876
func Float32Range ¶
Float32Range will generate a random float32 value between min and max
Example ¶
Seed(11) fmt.Println(Float32Range(0, 9999999))
Output: 3.4628758e+06
func Float64 ¶
func Float64() float64
Float64 will generate a random float64 value
Example ¶
Seed(11) fmt.Println(Float64())
Output: 0.7703009321621068
func Float64Range ¶
Float64Range will generate a random float64 value between min and max
Example ¶
Seed(11) fmt.Println(Float64Range(0, 9999999))
Output: 7.703008551320136e+06
func Fruit ¶
func Fruit() string
Fruit will return a random fruit name
Example ¶
Seed(11) fmt.Println(Fruit())
Output: Redcurrant
func FutureDate ¶
FutureDate will generate a random future time.Time struct
Example ¶
Seed(11) fmt.Println(FutureDate())
Output:
func Gamertag ¶
func Gamertag() string
Gamertag will generate a random video game username
Example ¶
Seed(11) fmt.Println(Gamertag())
Output: TurkeyThinker
func Gender ¶
func Gender() string
Gender will generate a random gender string
Example ¶
Seed(11) fmt.Println(Gender())
Output: female
func Generate ¶
Generate fake information from given string. Replaceable values should be within {}
Functions Ex: {firstname} - billy Ex: {sentence:3} - Record river mind. Ex: {number:1,10} - 4 Ex: {uuid} - 590c1440-9888-45b0-bd51-a817ee07c3f2
Letters/Numbers Ex: ### - 481 - random numbers Ex: ??? - fda - random letters
For a complete list of runnable functions use FuncsLookup
Example ¶
Seed(11) genStr, _ := Generate("{firstname} {lastname} {email} #?#?#?") fmt.Println(genStr) genStr, _ = Generate("{sentence:3}") fmt.Println(genStr) genStr, _ = Generate("{shuffleints:[1,2,3]}") fmt.Println(genStr) genStr, _ = Generate("{randomint:[1,2,3,-4]}") fmt.Println(genStr) genStr, _ = Generate("{randomuint:[1,2,3,4]}") fmt.Println(genStr) genStr, _ = Generate("{number:1,50}") fmt.Println(genStr) genStr, _ = Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}") fmt.Println(genStr)
Output: Mollie Legros vanceschroeder@turner.com 8K8b1M Something am elsewhere. [3 2 1] 3 3 18 [key:value a:b int:string 1:2]
func HTTPMethod ¶
func HTTPMethod() string
HTTPMethod will generate a random http method
Example ¶
Seed(11) fmt.Println(HTTPMethod())
Output: DELETE
func HTTPStatusCode ¶
func HTTPStatusCode() int
HTTPStatusCode will generate a random status code
Example ¶
Seed(11) fmt.Println(HTTPStatusCode())
Output: 502
func HTTPStatusCodeSimple ¶
func HTTPStatusCodeSimple() int
HTTPStatusCodeSimple will generate a random simple status code
Example ¶
Seed(11) fmt.Println(HTTPStatusCodeSimple())
Output: 500
func HTTPVersion ¶
func HTTPVersion() string
HTTPVersion will generate a random http version
Example ¶
Seed(11) fmt.Println(HTTPVersion())
Output: HTTP/2.0
func HackerAbbreviation ¶
func HackerAbbreviation() string
HackerAbbreviation will return a random hacker abbreviation
Example ¶
Seed(11) fmt.Println(HackerAbbreviation())
Output: SCSI
func HackerAdjective ¶
func HackerAdjective() string
HackerAdjective will return a random hacker adjective
Example ¶
Seed(11) fmt.Println(HackerAdjective())
Output: solid state
func HackerNoun ¶
func HackerNoun() string
HackerNoun will return a random hacker noun
Example ¶
Seed(11) fmt.Println(HackerNoun())
Output: circuit
func HackerPhrase ¶
func HackerPhrase() string
HackerPhrase will return a random hacker sentence
Example ¶
Seed(11) fmt.Println(HackerPhrase())
Output: Use the optical CSS microchip, then you can write the open-source monitor!
func HackerVerb ¶
func HackerVerb() string
HackerVerb will return a random hacker verb
Example ¶
Seed(11) fmt.Println(HackerVerb())
Output: lock
func HackeringVerb ¶
func HackeringVerb() string
HackeringVerb will return a random hacker ingverb
Example ¶
Seed(11) fmt.Println(HackeringVerb())
Output: compressing
func HexColor ¶
func HexColor() string
HexColor will generate a random hexadecimal color string
Example ¶
Seed(11) fmt.Println(HexColor())
Output: #ef759a
func HexUint ¶
HexUint will generate a random uint hex value with "0x" prefix
Example ¶
Seed(11) fmt.Println(HexUint(16))
Output: 0x425b
func HipsterParagraph ¶
func HipsterParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
HipsterParagraph will generate a random paragraphGenerator Set Paragraph Count Set Sentence Count Set Word Count Set Paragraph Separator
Example ¶
Seed(11) fmt.Println(HipsterParagraph(3, 5, 12, "\n"))
Output: Semiotics everyday you probably haven't heard of them you probably haven't heard of them portland austin tattooed retro cardigan Yuccie cred hoodie. Vice pug pug cred intelligentsia roof helvetica squid chambray literally ennui ugh. Chicharrones messenger bag narwhal ennui flannel twee art party mustache sartorial gluten-free cardigan cronut. Hoodie kickstarter cardigan Thundercats heirloom hashtag bitters salvia cleanse forage chartreuse keffiyeh. Sustainable tofu mustache bespoke vice aesthetic iPhone ugh lo-fi health put a bird on it blue bottle. Pop-up pabst pitchfork literally roof tattooed tilde shoreditch green juice ethical celiac tilde. Kombucha kinfolk occupy tacos ramps 90's echo meditation kale chips gluten-free humblebrag keffiyeh. Lo-fi bespoke wayfarers chicharrones crucifix green juice humblebrag organic viral shabby chic locavore cred. Roof forage farm-to-table YOLO williamsburg crucifix blog everyday green juice listicle wayfarers post-ironic. Single-origin coffee cray organic YOLO disrupt venmo tofu meggings fanny pack master craft beer tofu. Hella helvetica microdosing literally meh etsy echo pabst goth readymade +1 marfa. Pork belly hammock kale chips yr green juice stumptown crucifix hella pork belly franzen wolf austin. Offal cred chartreuse freegan intelligentsia twee trust fund paleo pinterest austin typewriter kogi. Pug single-origin coffee ethical irony helvetica beard green juice viral post-ironic Godard slow-carb put a bird on it. Schlitz hammock beard chia kitsch cred salvia irony farm-to-table loko truffaut ramps.
func HipsterSentence ¶
HipsterSentence will generate a random sentence
Example ¶
Seed(11) fmt.Println(HipsterSentence(5))
Output: Semiotics everyday you probably haven't heard of them you probably haven't heard of them portland.
func HipsterWord ¶
func HipsterWord() string
HipsterWord will return a single hipster word
Example ¶
Seed(11) fmt.Println(HipsterWord())
Output: semiotics
func Hobby ¶
func Hobby() string
Hobby will generate a random hobby string
Example ¶
Seed(11) fmt.Println(Hobby())
Output: Marching band
func Hour ¶
func Hour() int
Hour will generate a random hour - in military time
Example ¶
Seed(11) fmt.Println(Hour())
Output: 21
func IPv4Address ¶
func IPv4Address() string
IPv4Address will generate a random version 4 ip address
Example ¶
Seed(11) fmt.Println(IPv4Address())
Output: 180.18.181.251
func IPv6Address ¶
func IPv6Address() string
IPv6Address will generate a random version 6 ip address
Example ¶
Seed(11) fmt.Println(IPv6Address())
Output: ddb4:9212:aab5:87fb:4e33:17a4:f7b9:bf8e
func Image ¶
Image generates a random rgba image
Example ¶
Seed(11) fmt.Println(Image(1, 1))
Output: &{[180 18 181 255] 4 (0,0)-(1,1)}
func ImageJpeg ¶
ImageJpeg generates a random rgba jpeg image
Example ¶
Seed(11) fmt.Println(ImageJpeg(1, 1))
Output: [255 216 255 219 0 132 0 8 6 6 7 6 5 8 7 7 7 9 9 8 10 12 20 13 12 11 11 12 25 18 19 15 20 29 26 31 30 29 26 28 28 32 36 46 39 32 34 44 35 28 28 40 55 41 44 48 49 52 52 52 31 39 57 61 56 50 60 46 51 52 50 1 9 9 9 12 11 12 24 13 13 24 50 33 28 33 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 255 192 0 17 8 0 1 0 1 3 1 34 0 2 17 1 3 17 1 255 196 1 162 0 0 1 5 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 16 0 2 1 3 3 2 4 3 5 5 4 4 0 0 1 125 1 2 3 0 4 17 5 18 33 49 65 6 19 81 97 7 34 113 20 50 129 145 161 8 35 66 177 193 21 82 209 240 36 51 98 114 130 9 10 22 23 24 25 26 37 38 39 40 41 42 52 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 225 226 227 228 229 230 231 232 233 234 241 242 243 244 245 246 247 248 249 250 1 0 3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 17 0 2 1 2 4 4 3 4 7 5 4 4 0 1 2 119 0 1 2 3 17 4 5 33 49 6 18 65 81 7 97 113 19 34 50 129 8 20 66 145 161 177 193 9 35 51 82 240 21 98 114 209 10 22 36 52 225 37 241 23 24 25 26 38 39 40 41 42 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 130 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 226 227 228 229 230 231 232 233 234 242 243 244 245 246 247 248 249 250 255 218 0 12 3 1 0 2 17 3 17 0 63 0 229 40 162 138 251 3 239 15 255 217]
func ImagePng ¶
ImagePng generates a random rgba png image
Example ¶
Seed(11) fmt.Println(ImagePng(1, 1))
Output: [137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 0 1 0 0 0 1 8 2 0 0 0 144 119 83 222 0 0 0 16 73 68 65 84 120 156 98 218 34 180 21 16 0 0 255 255 3 1 1 126 242 54 123 184 0 0 0 0 73 69 78 68 174 66 96 130]
func InputName ¶
func InputName() string
InputName will return a random input field name
Example ¶
Seed(11) fmt.Println(InputName())
Output: message
func Int16 ¶
func Int16() int16
Int16 will generate a random int16 value
Example ¶
Seed(11) fmt.Println(Int16())
Output: 23988
func Int32 ¶
func Int32() int32
Int32 will generate a random int32 value
Example ¶
Seed(11) fmt.Println(Int32())
Output: 1923896103
func Int64 ¶
func Int64() int64
Int64 will generate a random int64 value
Example ¶
Seed(11) fmt.Println(Int64())
Output: 7302769650322300340
func Int8 ¶
func Int8() int8
Int8 will generate a random Int8 value
Example ¶
Seed(11) fmt.Println(Int8())
Output: 52
func IntRange ¶
IntRange will generate a random int value between min and max
Example ¶
Seed(11) fmt.Println(IntRange(1, 10))
Output: 9
func Interjection ¶
func Interjection() string
Interjection will generate a random word expressing emotion
Example ¶
Seed(11) fmt.Println(Interjection())
Output: alas
func Isin ¶
func Isin() string
ISIN
Example ¶
ISIN Tests
Seed(11) fmt.Println(Isin())
Output: TO4HHTI0T819
func JSON ¶
func JSON(jo *JSONOptions) ([]byte, error)
JSON generates an object or an array of objects in json format. A nil JSONOptions returns a randomly structured JSON.
Example (Array) ¶
Seed(11) value, err := JSON(&JSONOptions{ Type: "array", Fields: []Field{ {Name: "id", Function: "autoincrement"}, {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, RowCount: 3, Indent: true, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: [ { "id": 1, "first_name": "Sonny", "last_name": "Stiedemann", "password": "8nwf0o3sBXcR" }, { "id": 2, "first_name": "Verda", "last_name": "Brakus", "password": "3beWLpq75Lua" }, { "id": 3, "first_name": "Jules", "last_name": "Cremin", "password": "Uu38J14Y8W82" } ]
Example (NumberWithTag) ¶
Seed(11) type J struct { FieldNumber json.Number `fake:"number:3,7"` FieldInt8 json.Number `fake:"int8"` FieldInt16 json.Number `fake:"int16"` FieldInt32 json.Number `fake:"int32"` FieldInt64 json.Number `fake:"int64"` FieldUint8 json.Number `fake:"uint8"` FieldUint16 json.Number `fake:"uint16"` FieldUint32 json.Number `fake:"uint32"` FieldUint64 json.Number `fake:"uint64"` FieldFloat32 json.Number `fake:"float32"` FieldFloat64 json.Number `fake:"float64range:12,72"` } var obj J Struct(&obj) fmt.Printf("obj.FieldNumber = %+v\n", obj.FieldNumber) fmt.Printf("obj.FieldInt8 = %+v\n", obj.FieldInt8) fmt.Printf("obj.FieldInt16 = %+v\n", obj.FieldInt16) fmt.Printf("obj.FieldInt32 = %+v\n", obj.FieldInt32) fmt.Printf("obj.FieldInt64 = %+v\n", obj.FieldInt64) fmt.Printf("obj.FieldUint8 = %+v\n", obj.FieldUint8) fmt.Printf("obj.FieldUint16 = %+v\n", obj.FieldUint16) fmt.Printf("obj.FieldUint32 = %+v\n", obj.FieldUint32) fmt.Printf("obj.FieldUint64 = %+v\n", obj.FieldUint64) fmt.Printf("obj.FieldFloat32 = %+v\n", obj.FieldFloat32) fmt.Printf("obj.FieldFloat64 = %+v\n", obj.FieldFloat64)
Output: obj.FieldNumber = 7 obj.FieldInt8 = -110 obj.FieldInt16 = 10933 obj.FieldInt32 = 430103905 obj.FieldInt64 = 525217394518216243 obj.FieldUint8 = 164 obj.FieldUint16 = 63417 obj.FieldUint32 = 2307233133 obj.FieldUint64 = 17560678512042153749 obj.FieldFloat32 = 0.11857688426971436 obj.FieldFloat64 = 51.03971481390635
Example (Object) ¶
Seed(11) value, err := JSON(&JSONOptions{ Type: "object", Fields: []Field{ {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "address", Function: "address"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, Indent: true, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: { "first_name": "Sonny", "last_name": "Stiedemann", "address": { "address": "52759 Stationside, San Diego, Oregon 99344", "street": "52759 Stationside", "city": "San Diego", "state": "Oregon", "zip": "99344", "country": "Saint Pierre and Miquelon", "latitude": -30.009814, "longitude": 154.519771 }, "password": "l4338TebFL55" }
func JobDescriptor ¶
func JobDescriptor() string
JobDescriptor will generate a random job descriptor string
Example ¶
Seed(11) fmt.Println(JobDescriptor())
Output: Product
func JobLevel ¶
func JobLevel() string
JobLevel will generate a random job level string
Example ¶
Seed(11) fmt.Println(JobLevel())
Output: Solutions
func JobTitle ¶
func JobTitle() string
JobTitle will generate a random job title string
Example ¶
Seed(11) fmt.Println(JobTitle())
Output: Strategist
func Language ¶
func Language() string
Language will return a random language
Example ¶
Seed(11) fmt.Println(Language())
Output: Turkish
func LanguageAbbreviation ¶
func LanguageAbbreviation() string
LanguageAbbreviation will return a random language abbreviation
Example ¶
Seed(11) fmt.Println(LanguageAbbreviation())
Output: tr
func LanguageBCP ¶
func LanguageBCP() string
LanguageBCP will return a random language BCP (Best Current Practices)
Example ¶
Seed(11) fmt.Println(LanguageBCP())
Output: tr-TR
func LastName ¶
func LastName() string
LastName will generate a random last name
Example ¶
Seed(11) fmt.Println(LastName())
Output: Treutel
func Latitude ¶
func Latitude() float64
Latitude will generate a random latitude float64
Example ¶
Seed(11) fmt.Println(Latitude())
Output: 48.654167
func LatitudeInRange ¶
LatitudeInRange will generate a random latitude within the input range
Example ¶
Seed(11) lat, _ := LatitudeInRange(21, 42) fmt.Println(lat)
Output: 37.176319
func Letter ¶
func Letter() string
Letter will generate a single random lower case ASCII letter
Example ¶
Seed(11) fmt.Println(Letter())
Output: u
func LetterN ¶
LetterN will generate a random ASCII string with length N. Note that this function returns a string with a length of 1 when 0 is passed.
Example ¶
Seed(11) fmt.Println(LetterN(10))
Output: usKKbMlbxq
func Lexify ¶
Lexify will replace ? with random generated letters
Example ¶
Seed(11) fmt.Println(Lexify("?????"))
Output: usKKb
func LogLevel ¶
LogLevel will generate a random log level See data/LogLevels for list of available levels
Example ¶
Seed(11) fmt.Println(LogLevel("")) // This will also use general fmt.Println(LogLevel("syslog")) fmt.Println(LogLevel("apache"))
Output: debug crit alert
func Longitude ¶
func Longitude() float64
Longitude will generate a random longitude float64
Example ¶
Seed(11) fmt.Println(Longitude())
Output: 97.308335
func LongitudeInRange ¶
LongitudeInRange will generate a random longitude within the input range
Example ¶
Seed(11) long, _ := LongitudeInRange(-10, 10) fmt.Println(long)
Output: 5.406018
func LoremIpsumParagraph ¶
func LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
LoremIpsumParagraph will generate a random paragraphGenerator
Example ¶
Seed(11) fmt.Println(LoremIpsumParagraph(3, 5, 12, "\n"))
Output: Eveniet vero velit velit non incidunt est sed tenetur consequatur ut architecto. Quod non non et voluptas et esse quisquam ullam placeat molestiae laboriosam. Consequatur in perferendis molestiae quam voluptatem eaque quia facilis quo hic dignissimos. Architecto ut tenetur aut qui et optio id sint quae rerum labore. Quae deserunt quia mollitia id accusantium itaque nisi aut omnis occaecati repellendus. Ad sunt neque placeat et qui saepe voluptatem blanditiis voluptatum possimus saepe. Velit distinctio quia quas cupiditate sequi dolorum delectus quia quo corrupti labore. Aut mollitia et aut eligendi blanditiis corrupti aut rem voluptatibus veritatis ut. Et ab voluptas delectus repellat eligendi qui eos blanditiis et et eos. Qui ipsum aut ut voluptate nulla officia qui earum repudiandae quidem officia. Fugit esse beatae placeat nihil libero et sunt voluptas velit maiores voluptatem. Reiciendis quia dolor amet blanditiis labore eligendi fugit reiciendis modi est incidunt. Ut ut rerum odit sit voluptatem ipsam consequatur est incidunt aut quis. Non dolorem voluptatum pariatur esse eos blanditiis rem eos commodi accusamus occaecati. Qui voluptatem eos et tempora et id at voluptas suscipit magni cupiditate.
func LoremIpsumSentence ¶
LoremIpsumSentence will generate a random sentence
Example ¶
Seed(11) fmt.Println(LoremIpsumSentence(5))
Output: Eveniet vero velit velit non.
func LoremIpsumWord ¶
func LoremIpsumWord() string
LoremIpsumWord will generate a random word
Example ¶
Seed(11) fmt.Println(LoremIpsumWord())
Output: eveniet
func Lunch ¶
func Lunch() string
Lunch will return a random lunch name
Example ¶
Seed(11) fmt.Println(Lunch())
Output: Quick chile relleno casserole
func MacAddress ¶
func MacAddress() string
MacAddress will generate a random mac address
Example ¶
Seed(11) fmt.Println(MacAddress())
Output: e4:da:32:33:86:3b
func Map ¶
Map will generate a random set of map data
Example ¶
Seed(11) fmt.Println(Map())
Output: map[a:map[that:could] above:[sometimes vast whom us scarcely these huh] am:map[how:9310653] depend:map[hey:5402877] out:381794.78 since:916659.94 these:map[frequently:2314010]]
func Markdown ¶
func Markdown(co *MarkdownOptions) (string, error)
Markdown will return a single random Markdown template document
Example ¶
TemplateMarkdown examples and tests
Seed(11) value, err := Markdown(&MarkdownOptions{}) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: # TurkeyThinker *Author: Tomasa Waters* Cut lastly that someone additionally ambulance could. A tennis occur why depend heels out. Can fire anyone sometimes that leap whom. Troop now scarcely since dance huh somebody. Constantly Italian outfit certain weekly murder who. Cackle because her break write nobody could. According whoa bevy we them summation to. Oxygen Greek how previously a what answer. Handle daily ouch upon encourage that after. His every she wearily still he herself. ## Table of Contents - [Installation](#installation) - [Usage](#usage) - [License](#license) ## Installation '''bash pip install TurkeyThinker ''' ## Usage '''python result = turkeythinker.handle("whimsical story") print("turkeythinker result:", "terminated") ''' ## License MIT
func MiddleName ¶
func MiddleName() string
MiddleName will generate a random middle name
Example ¶
Seed(11) fmt.Println(MiddleName())
Output: Star
func MinecraftAnimal ¶
func MinecraftAnimal() string
MinecraftAnimal will generate a random Minecraft animal
Example ¶
Seed(11) fmt.Println(MinecraftAnimal())
Output: wolf
func MinecraftArmorPart ¶
func MinecraftArmorPart() string
MinecraftArmorPart will generate a random Minecraft armor part
Example ¶
Seed(11) fmt.Println(MinecraftArmorPart())
Output: helmet
func MinecraftArmorTier ¶
func MinecraftArmorTier() string
MinecraftArmorTier will generate a random Minecraft armor tier
Example ¶
Seed(11) fmt.Println(MinecraftArmorTier())
Output: netherite
func MinecraftBiome ¶
func MinecraftBiome() string
MinecraftBiome will generate a random Minecraft biome
Example ¶
Seed(11) fmt.Println(MinecraftBiome())
Output: the nether
func MinecraftDye ¶
func MinecraftDye() string
MinecraftDye will generate a random Minecraft dye
Example ¶
Seed(11) fmt.Println(MinecraftDye())
Output: yellow
func MinecraftFood ¶
func MinecraftFood() string
MinecraftFood will generate a random Minecraft food
Example ¶
Seed(11) fmt.Println(MinecraftFood())
Output: steak
func MinecraftMobBoss ¶
func MinecraftMobBoss() string
MinecraftMobBoss will generate a random Minecraft mob boss
Example ¶
Seed(11) fmt.Println(MinecraftMobBoss())
Output: ender dragon
func MinecraftMobHostile ¶
func MinecraftMobHostile() string
MinecraftMobHostile will generate a random Minecraft mob hostile
Example ¶
Seed(11) fmt.Println(MinecraftMobHostile())
Output: wither skeleton
func MinecraftMobNeutral ¶
func MinecraftMobNeutral() string
MinecraftMobNeutral will generate a random Minecraft mob neutral
Example ¶
Seed(11) fmt.Println(MinecraftMobNeutral())
Output: wolf
func MinecraftMobPassive ¶
func MinecraftMobPassive() string
MinecraftMobPassive will generate a random Minecraft mob passive
Example ¶
Seed(11) fmt.Println(MinecraftMobPassive())
Output: turtle
func MinecraftOre ¶
func MinecraftOre() string
MinecraftOre will generate a random Minecraft ore
Example ¶
Seed(11) fmt.Println(MinecraftOre())
Output: redstone
func MinecraftTool ¶
func MinecraftTool() string
MinecraftTool will generate a random Minecraft tool
Example ¶
Seed(11) fmt.Println(MinecraftTool())
Output: fishing rod
func MinecraftVillagerJob ¶
func MinecraftVillagerJob() string
MinecraftVillagerJob will generate a random Minecraft villager job
Example ¶
Seed(11) fmt.Println(MinecraftVillagerJob())
Output: toolsmith
func MinecraftVillagerLevel ¶
func MinecraftVillagerLevel() string
MinecraftVillagerLevel will generate a random Minecraft villager level
Example ¶
Seed(11) fmt.Println(MinecraftVillagerLevel())
Output: master
func MinecraftVillagerStation ¶
func MinecraftVillagerStation() string
MinecraftVillagerStation will generate a random Minecraft villager station
Example ¶
Seed(11) fmt.Println(MinecraftVillagerStation())
Output: stonecutter
func MinecraftWeapon ¶
func MinecraftWeapon() string
MinecraftWeapon will generate a random Minecraft weapon
Example ¶
Seed(11) fmt.Println(MinecraftWeapon())
Output: shield
func MinecraftWeather ¶
func MinecraftWeather() string
MinecraftWeather will generate a random Minecraft weather
Example ¶
Seed(11) fmt.Println(MinecraftWeather())
Output: thunder
func MinecraftWood ¶
func MinecraftWood() string
MinecraftWood will generate a random Minecraft wood
Example ¶
Seed(11) fmt.Println(MinecraftWood())
Output: dark oak
func Minute ¶
func Minute() int
Minute will generate a random minute
Example ¶
Seed(11) fmt.Println(Minute())
Output: 53
func Month ¶
func Month() int
Month will generate a random month int
Example ¶
Seed(11) fmt.Println(Month())
Output: 11
func MonthString ¶
func MonthString() string
MonthString will generate a random month string
Example ¶
Seed(11) fmt.Println(MonthString())
Output: November
func MovieGenre ¶
func MovieGenre() string
Example ¶
Seed(11) fmt.Println(MovieGenre())
Output: Thriller
func MovieName ¶
func MovieName() string
Example ¶
Seed(11) fmt.Println(MovieName())
Output: The Terminator
func Name ¶
func Name() string
Name will generate a random First and Last Name
Example ¶
Seed(11) fmt.Println(Name())
Output: Sonny Stiedemann
func NamePrefix ¶
func NamePrefix() string
NamePrefix will generate a random name prefix
Example ¶
Seed(11) fmt.Println(NamePrefix())
Output: Dr.
func NameSuffix ¶
func NameSuffix() string
NameSuffix will generate a random name suffix
Example ¶
Seed(11) fmt.Println(NameSuffix())
Output: PhD
func NanoSecond ¶
func NanoSecond() int
NanoSecond will generate a random nano second
Example ¶
Seed(11) fmt.Println(NanoSecond())
Output: 895883936
func NiceColors ¶
func NiceColors() []string
NiceColor will generate a random safe color string
Example ¶
Seed(11) fmt.Println(NiceColors())
Output: [#fffbb7 #a6f6af #66b6ab #5b7c8d #4f2958]
func Noun ¶
func Noun() string
Noun will generate a random noun
Example ¶
Seed(11) fmt.Println(Noun())
Output: nest
func NounAbstract ¶
func NounAbstract() string
NounAbstract will generate a random abstract noun
Example ¶
Seed(11) fmt.Println(NounAbstract())
Output: speed
func NounCollectiveAnimal ¶
func NounCollectiveAnimal() string
NounCollectiveAnimal will generate a random collective noun animal
Example ¶
Seed(11) fmt.Println(NounCollectiveAnimal())
Output: leap
func NounCollectivePeople ¶
func NounCollectivePeople() string
NounCollectivePeople will generate a random collective noun person
Example ¶
Seed(11) fmt.Println(NounCollectivePeople())
Output: posse
func NounCollectiveThing ¶
func NounCollectiveThing() string
NounCollectiveThing will generate a random collective noun thing
Example ¶
Seed(11) fmt.Println(NounCollectiveThing())
Output: hail
func NounCommon ¶
func NounCommon() string
NounCommon will generate a random common noun
Example ¶
Seed(11) fmt.Println(NounCommon())
Output: group
func NounConcrete ¶
func NounConcrete() string
NounConcrete will generate a random concrete noun
Example ¶
Seed(11) fmt.Println(NounConcrete())
Output: theater
func NounCountable ¶
func NounCountable() string
NounCountable will generate a random countable noun
Example ¶
Seed(11) fmt.Println(NounCountable())
Output: smile
func NounDeterminer ¶
func NounDeterminer() string
NounDeterminer will generate a random noun determiner
Example ¶
Seed(11) fmt.Println(NounDeterminer())
Output: every
func NounProper ¶
func NounProper() string
NounProper will generate a random proper noun
Example ¶
Seed(11) fmt.Println(NounProper())
Output: Russ
func NounUncountable ¶
func NounUncountable() string
NounUncountable will generate a random uncountable noun
Example ¶
Seed(11) fmt.Println(NounUncountable())
Output: usage
func Number ¶
Number will generate a random number between given min and max
Example ¶
Seed(11) fmt.Println(Number(50, 23456))
Output: 21019
func Numerify ¶
Numerify will replace # with random numerical values
Example ¶
Seed(11) fmt.Println(Numerify("###-###-####"))
Output: 881-252-7598
func OperaUserAgent ¶
func OperaUserAgent() string
OperaUserAgent will generate a random opera browser user agent string
Example ¶
Seed(11) fmt.Println(OperaUserAgent())
Output: Opera/10.91 (X11; Linux i686; en-US) Presto/2.12.265 Version/11.00
func Paragraph ¶
Paragraph will generate a random paragraphGenerator
Example ¶
Seed(11) fmt.Println(Paragraph(3, 5, 12, "\n"))
Output: Bathe regularly quiver these sprint fight something am elsewhere since previously was. That there a tennis occur why depend heels out can fire anyone. Sometimes that leap whom troop now scarcely since dance huh somebody constantly. Italian outfit certain weekly murder who cackle because her break write nobody. Could according whoa bevy we them summation to oxygen Greek how previously. A what answer handle daily ouch upon encourage that after his every. She wearily still he herself huge failure for yay sparse thoughtfully box. Anyway Jungian regularly world great daily recently whose Elizabethan outside to theirs. Block while French closely sit you to out fight bored yours those. Bale Parisian host which so today Ecuadorian hourly decidedly his everybody this. Play this little them on recently eager usually bunch daily whose somebody. Them few tonight dishonesty spell battery less patience whose inside hair your. Answer hand tonight these she team which today Einsteinian country yesterday for. Phew for now your him hourly infrequently lots drink absolutely when east. Conclude little annually hers nobody since troop it it whoever the park.
func Password ¶
Password will generate a random password. Minimum number length of 5 if less than.
Example ¶
Seed(11) fmt.Println(Password(true, false, false, false, false, 32)) fmt.Println(Password(false, true, false, false, false, 32)) fmt.Println(Password(false, false, true, false, false, 32)) fmt.Println(Password(false, false, false, true, false, 32)) fmt.Println(Password(true, true, true, true, true, 32)) fmt.Println(Password(true, true, true, true, true, 4))
Output: cfelntbponnbbzrhswobuwlxajeeclrx KYEKNGUUNKUYSFBUFFTGDKUVCVYKPONP 43622637275953627791234759581343 @.__-._-!-!_..!-_*_*__-@*.__.__! -DTHJ@.oF@d@L5F65 N-.@U5xWX F0DI foZnB
func PastDate ¶
PastDate will generate a random past time.Time struct
Example ¶
Seed(11) fmt.Println(PastDate())
Output:
func PetName ¶
func PetName() string
PetName will return a random fun pet name
Example ¶
Seed(11) fmt.Println(PetName())
Output: The Notorious D.O.G.
func Phone ¶
func Phone() string
Phone will generate a random phone number string
Example ¶
Seed(11) fmt.Println(Phone())
Output: 8812527598
func PhoneFormatted ¶
func PhoneFormatted() string
PhoneFormatted will generate a random phone number string
Example ¶
Seed(11) fmt.Println(PhoneFormatted())
Output: 812-527-5989
func Phrase ¶
func Phrase() string
Phrase will return a random phrase
Example ¶
Seed(11) fmt.Println(Phrase())
Output: how many siblings do you have
func PhraseAdverb ¶
func PhraseAdverb() string
PhraseAdverb will return a random adverb phrase
Example ¶
Seed(11) fmt.Println(PhraseAdverb())
Output: successfully
func PhraseNoun ¶
func PhraseNoun() string
PhraseNoun will return a random noun phrase
Example ¶
Seed(11) fmt.Println(PhraseNoun())
Output: a fear
func PhrasePreposition ¶
func PhrasePreposition() string
PhrasePreposition will return a random preposition phrase
Example ¶
Seed(11) fmt.Println(PhrasePreposition())
Output: with an archipelago
func PhraseVerb ¶
func PhraseVerb() string
PhraseVerb will return a random preposition phrase
Example ¶
Seed(11) fmt.Println(PhraseVerb())
Output: bathe the jittery trip totally brightly under a troubling part scarcely unexpectedly
func Preposition ¶
func Preposition() string
Preposition will generate a random preposition
Example ¶
Seed(11) fmt.Println(Preposition())
Output: instead of
func PrepositionCompound ¶
func PrepositionCompound() string
PrepositionCompound will generate a random compound preposition
Example ¶
Seed(11) fmt.Println(PrepositionCompound())
Output: other than
func PrepositionDouble ¶
func PrepositionDouble() string
PrepositionDouble will generate a random double preposition
Example ¶
Seed(11) fmt.Println(PrepositionDouble())
Output: next to
func PrepositionSimple ¶
func PrepositionSimple() string
PrepositionSimple will generate a random simple preposition
Example ¶
Seed(11) fmt.Println(PrepositionSimple())
Output: with
func Price ¶
Price will take in a min and max value and return a formatted price
Example ¶
Seed(11) fmt.Printf("%.2f", Price(0.8618, 1000))
Output: 770.49
func ProductAudience ¶ added in v7.1.0
func ProductAudience() []string
ProductAudience will generate a random target audience
Example ¶
Seed(11) fmt.Println(ProductAudience())
Output: [DIY enthusiasts students]
func ProductBenefit ¶ added in v7.1.0
func ProductBenefit() string
ProductBenefit will generate a random product benefit
Example ¶
Seed(11) fmt.Println(ProductBenefit())
Output: minimal maintenance
func ProductCategory ¶
func ProductCategory() string
ProductCategory will generate a random product category
Example ¶
Seed(11) fmt.Println(ProductCategory())
Output: pet food
func ProductDescription ¶
func ProductDescription() string
ProductDescription will generate a random product description
Example ¶
Seed(11) fmt.Println(ProductDescription())
Output: This product, ideal for seniors and families, features puzzled gold and incorporates gps-enabled to ensure robust construction during remote work.
func ProductDimension ¶ added in v7.1.0
func ProductDimension() string
ProductDimension will generate a random product dimension
Example ¶
Seed(11) fmt.Println(ProductDimension())
Output: standard
func ProductFeature ¶
func ProductFeature() string
ProductFeature will generate a random product feature
Example ¶
Seed(11) fmt.Println(ProductFeature())
Output: fast-charging
func ProductMaterial ¶
func ProductMaterial() string
ProductMaterial will generate a random product material
Example ¶
Seed(11) fmt.Println(ProductMaterial())
Output: quartz
func ProductName ¶
func ProductName() string
ProductName will generate a random product name
Example ¶
Seed(11) fmt.Println(ProductName())
Output: Green Glass Hair Dryer
func ProductSuffix ¶ added in v7.1.0
func ProductSuffix() string
ProductSuffix will generate a random product suffix
Example ¶
Seed(11) fmt.Println(ProductSuffix())
Output: turbo
func ProductUPC ¶
func ProductUPC() string
ProductUPC will generate a random product UPC
Example ¶
Seed(11) fmt.Println(ProductUPC())
Output: 088125275989
func ProductUseCase ¶ added in v7.1.0
func ProductUseCase() string
ProductUseCase will generate a random product use case
Example ¶
Seed(11) fmt.Println(ProductUseCase())
Output: remote work
func ProgrammingLanguage ¶
func ProgrammingLanguage() string
ProgrammingLanguage will return a random programming language
Example ¶
Seed(11) fmt.Println(ProgrammingLanguage())
Output: TELCOMP
func Pronoun ¶
func Pronoun() string
Pronoun will generate a random pronoun
Example ¶
Seed(11) fmt.Println(Pronoun())
Output: some
func PronounDemonstrative ¶
func PronounDemonstrative() string
PronounDemonstrative will generate a random demonstrative pronoun
Example ¶
Seed(11) fmt.Println(PronounDemonstrative())
Output: this
func PronounIndefinite ¶
func PronounIndefinite() string
PronounIndefinite will generate a random indefinite pronoun
Example ¶
Seed(11) fmt.Println(PronounIndefinite())
Output: somebody
func PronounInterrogative ¶
func PronounInterrogative() string
PronounInterrogative will generate a random interrogative pronoun
Example ¶
Seed(11) fmt.Println(PronounInterrogative())
Output: how
func PronounObject ¶
func PronounObject() string
PronounObject will generate a random object pronoun
Example ¶
Seed(11) fmt.Println(PronounObject())
Output: them
func PronounPersonal ¶
func PronounPersonal() string
PronounPersonal will generate a random personal pronoun
Example ¶
Seed(11) fmt.Println(PronounPersonal())
Output: they
func PronounPossessive ¶
func PronounPossessive() string
PronounPossessive will generate a random possessive pronoun
Example ¶
Seed(11) fmt.Println(PronounPossessive())
Output: theirs
func PronounReflective ¶
func PronounReflective() string
PronounReflective will generate a random reflective pronoun
Example ¶
Seed(11) fmt.Println(PronounReflective())
Output: itself
func PronounRelative ¶
func PronounRelative() string
PronounRelative will generate a random relative pronoun
Example ¶
Seed(11) fmt.Println(PronounRelative())
Output: whomever
func Question ¶
func Question() string
Question will return a random question
Example ¶
Seed(11) fmt.Println(Question())
Output: Everyday you probably haven't heard of them you probably haven't heard of them portland austin tattooed retro?
func Quote ¶
func Quote() string
Quote will return a random quote from a random person
Example ¶
Seed(11) fmt.Println(Quote())
Output: "Everyday you probably haven't heard of them you probably haven't heard of them portland austin tattooed retro." - Vance Schroeder
func RGBColor ¶
func RGBColor() []int
RGBColor will generate a random int slice color
Example ¶
Seed(11) fmt.Println(RGBColor())
Output: [180 18 181]
func RandomInt ¶
RandomInt will take in a slice of int and return a randomly selected value
Example ¶
Seed(11) ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657} fmt.Println(RandomInt(ints))
Output: 8413
func RandomMapKey ¶
RandomMapKey will return a random key from a map
func RandomString ¶
RandomString will take in a slice of string and return a randomly selected value
Example ¶
Seed(11) fmt.Println(RandomString([]string{"hello", "world"}))
Output: hello
func RandomUint ¶
RandomUint will take in a slice of uint and return a randomly selected value
Example ¶
Seed(11) ints := []uint{52, 854, 941, 74125, 8413, 777, 89416, 841657} fmt.Println(RandomUint(ints))
Output: 8413
func Regex ¶
Regex will generate a string based upon a RE2 syntax
Example ¶
Seed(11) fmt.Println(Regex("[abcdef]{5}")) fmt.Println(Regex("[[:upper:]]{5}")) fmt.Println(Regex("(hello|world|whats|up)")) fmt.Println(Regex(`^[a-z]{5,10}@[a-z]{5,10}\.(com|net|org)$`))
Output: ffbbd GSNYV up tyyxi@kshtyia.net
func RemoveFuncLookup ¶
func RemoveFuncLookup(functionName string)
RemoveFuncLookup will remove a function from lookup
func SQL ¶
func SQL(so *SQLOptions) (string, error)
Example ¶
Seed(11) res, _ := SQL(&SQLOptions{ Table: "people", Count: 2, Fields: []Field{ {Name: "id", Function: "autoincrement"}, {Name: "first_name", Function: "firstname"}, {Name: "price", Function: "price"}, {Name: "age", Function: "number", Params: MapParams{"min": {"1"}, "max": {"99"}}}, {Name: "created_at", Function: "date", Params: MapParams{"format": {"2006-01-02 15:04:05"}}}, }, }) fmt.Println(string(res))
Output: INSERT INTO people (id, first_name, price, age, created_at) VALUES (1, 'Sonny', 985.96, 20, '1925-07-08 17:32:57'),(2, 'Steve', 639.32, 74, '2016-12-29 07:25:24');
func SSN ¶
func SSN() string
SSN will generate a random Social Security Number
Example ¶
Seed(11) fmt.Println(SSN())
Output: 906295542
func SafariUserAgent ¶
func SafariUserAgent() string
SafariUserAgent will generate a random safari browser user agent string
Example ¶
Seed(11) fmt.Println(SafariUserAgent())
Output: Mozilla/5.0 (Windows; U; Windows NT 6.0) AppleWebKit/536.44.6 (KHTML, like Gecko) Version/4.1 Safari/536.44.6
func SafeColor ¶
func SafeColor() string
SafeColor will generate a random safe color string
Example ¶
Seed(11) fmt.Println(SafeColor())
Output: aqua
func School ¶
func School() string
School will generate a random School type
Example ¶
Seed(11) fmt.Println(School())
Output: Hillside Private Academy
func Second ¶
func Second() int
Second will generate a random second
Example ¶
Seed(11) fmt.Println(Second())
Output: 53
func Sentence ¶
Sentence will generate a random sentence
Example ¶
Seed(11) fmt.Println(Sentence(5))
Output: Bathe regularly quiver these sprint.
func SentenceSimple ¶
func SentenceSimple() string
SentenceSimple will generate a random simple sentence
Example ¶
Seed(11) fmt.Println(SentenceSimple())
Output: A fear selfishly cook a tough doctor hardly innocently to realistic project utterly ingeniously.
func ShuffleAnySlice ¶
func ShuffleAnySlice(v any)
ShuffleAnySlice takes in a slice and outputs it in a random order
Example ¶
Seed(11) strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"} ShuffleAnySlice(strings) fmt.Println(strings) ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657} ShuffleAnySlice(ints) fmt.Println(ints)
Output: [for day happy everyone good times a have] [854 52 74125 941 777 8413 841657 89416]
func ShuffleInts ¶
func ShuffleInts(a []int)
ShuffleInts will randomize a slice of ints
Example ¶
Seed(11) ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657} ShuffleInts(ints) fmt.Println(ints)
Output: [941 777 8413 74125 854 89416 841657 52]
func ShuffleStrings ¶
func ShuffleStrings(a []string)
ShuffleStrings will randomize a slice of strings
Example ¶
Seed(11) strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"} ShuffleStrings(strings) fmt.Println(strings)
Output: [for day happy everyone good times a have]
func Slice ¶
func Slice(v any)
Slice fills built-in types and exported fields of a struct with random data.
Example ¶
Seed(11) var S []string Slice(&S) I := make([]int8, 3) Slice(&I) fmt.Println(S) fmt.Println(I)
Output: [KKbMlbxqu mwwv WVlPmw AeAwVH Khrx DcxFeWk vChMCeKf BwRtnboOE mWluN] [102 -7 -125]
Example (Struct) ¶
Seed(11) type Basic struct { S string `fake:"{firstname}"` I int F float32 } var B []Basic Slice(&B) fmt.Println(B)
Output: [{Russ 3680786209731553973 0.27238095} {Julius 4268594234476337060 0.0051180124} {Kaitlyn 8337306475187377941 0.118576884} {Steve 1365845625386394310 0.27625358} {Tomasa 7952567920265354269 0.648698} {Ernest 7933890822314871011 0.37052673} {Missouri 5542429450337529393 0.36615264} {Tiana 6292602578870227868 0.9382272} {Koby 229639691709918065 0.5914113}]
func Slogan ¶
func Slogan() string
Slogan will generate a random company slogan
Example ¶
Seed(11) fmt.Println(Slogan())
Output: local area network maximize Drive, mission-critical.
func Snack ¶
func Snack() string
Snack will return a random snack name
Example ¶
Seed(11) fmt.Println(Snack())
Output: Fantastic banana bran muffins
func State ¶
func State() string
State will generate a random state string
Example ¶
Seed(11) fmt.Println(State())
Output: Vermont
func StateAbr ¶
func StateAbr() string
StateAbr will generate a random abbreviated state string
Example ¶
Seed(11) fmt.Println(StateAbr())
Output: WV
func Street ¶
func Street() string
Street will generate a random address street string
Example ¶
Seed(11) fmt.Println(Street())
Output: 125 East Routemouth
func StreetName ¶
func StreetName() string
StreetName will generate a random address street name string
Example ¶
Seed(11) fmt.Println(StreetName())
Output: Turnpike
func StreetNumber ¶
func StreetNumber() string
StreetNumber will generate a random address street number string
Example ¶
Seed(11) fmt.Println(StreetNumber())
Output: 812
func StreetPrefix ¶
func StreetPrefix() string
StreetPrefix will generate a random address street prefix string
Example ¶
Seed(11) fmt.Println(StreetPrefix())
Output: Port
func StreetSuffix ¶
func StreetSuffix() string
StreetSuffix will generate a random address street suffix string
Example ¶
Seed(11) fmt.Println(StreetSuffix())
Output: side
func Struct ¶
Struct fills in exported fields of a struct with random data based on the value of `fake` tag of exported fields or with the result of a call to the Fake() method if the field type implements `Fakeable`. Use `fake:"skip"` to explicitly skip an element. All built-in types are supported, with templating support for string types.
Example ¶
Seed(11) type Bar struct { Name string Number int Float float32 } type Foo struct { Str string Int int Pointer *int Name string `fake:"{firstname}"` Number string `fake:"{number:1,10}"` Skip *string `fake:"skip"` SkipAlt *string `fake:"-"` Array []string `fakesize:"2"` ArrayRange []string `fakesize:"2,6"` Map map[string]string `fakesize:"2"` MapRange map[string]string `fakesize:"2,4"` Bar Bar } var f Foo Struct(&f) fmt.Printf("%s\n", f.Str) fmt.Printf("%d\n", f.Int) fmt.Printf("%d\n", *f.Pointer) fmt.Printf("%v\n", f.Name) fmt.Printf("%v\n", f.Number) fmt.Printf("%v\n", f.Skip) fmt.Printf("%v\n", f.SkipAlt) fmt.Printf("%v\n", f.Array) fmt.Printf("%v\n", f.ArrayRange) fmt.Printf("%v\n", f.Map) fmt.Printf("%v\n", f.MapRange) fmt.Printf("%+v\n", f.Bar)
Output: sKKbMlbxqu 1365845625386394310 4415419407664574903 Tomasa 10 <nil> <nil> [RWVlPmwRAe wVHB] [rxXDcxFe kfvChMC KfmBwRtn] map[gyJrZ:tfZAk oOEImWl:NXYnuKiGab] map[WigEnVzBy:JJXMkG aHqIpyVs:UxvheGVE pYyDuWC:yzjqsX] {Name:LfLRuhFRHQ Number:5737279083624806933 Float:0.59020466}
Example (Array) ¶
Seed(11) type Foo struct { Bar string Int int Name string `fake:"{firstname}"` Number string `fake:"{number:1,10}"` Skip *string `fake:"skip"` } type FooMany struct { Foos []Foo `fakesize:"1"` Names []string `fake:"{firstname}" fakesize:"3"` NamesRange []string `fake:"{firstname}" fakesize:"3,6"` } var fm FooMany Struct(&fm) fmt.Printf("%v\n", fm.Foos) fmt.Printf("%v\n", fm.Names) fmt.Printf("%v\n", fm.NamesRange)
Output: [{sKKbMlbxqu 1365845625386394310 Myrtis 10 <nil>}] [Tomasa Sunny Ernest] [Hassan Missouri Elisabeth Nedra Tiana Evan]
func Svg ¶
func Svg(options *SVGOptions) string
Generate a random svg generator
Example ¶
Seed(11) fmt.Println(Svg(nil))
Output: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 459 443" width="459" height="443"><rect x="0" y="0" width="100%" height="100%" fill="#64908a" /><circle cx="334" cy="238" r="437" fill="#cc2a41" /><circle cx="34" cy="328" r="428" fill="#cc2a41" /><circle cx="151" cy="190" r="191" fill="#e8caa4" /><circle cx="343" cy="410" r="156" fill="#351330" /><circle cx="5" cy="410" r="192" fill="#351330" /><circle cx="94" cy="286" r="384" fill="#cc2a41" /><circle cx="34" cy="239" r="439" fill="#351330" /><circle cx="199" cy="310" r="278" fill="#cc2a41" /><circle cx="293" cy="106" r="20" fill="#64908a" /><circle cx="275" cy="327" r="11" fill="#cc2a41" /><circle cx="406" cy="338" r="239" fill="#e8caa4" /><circle cx="41" cy="71" r="344" fill="#64908a" /><circle cx="411" cy="116" r="208" fill="#64908a" /><circle cx="410" cy="88" r="303" fill="#351330" /><circle cx="241" cy="69" r="285" fill="#cc2a41" /></svg>
func Teams ¶
Teams takes in an array of people and team names and randomly places the people into teams as evenly as possible
Example ¶
Seed(11) fmt.Println(Teams( []string{"Billy", "Sharon", "Jeff", "Connor", "Steve", "Justin", "Fabian", "Robert"}, []string{"Team 1", "Team 2", "Team 3"}, ))
Output: map[Team 1:[Jeff Robert Billy] Team 2:[Connor Fabian Sharon] Team 3:[Justin Steve]]
func Template ¶
func Template(template string, co *TemplateOptions) (string, error)
Template generates an document based on the the supplied template
Example ¶
Seed(11) template := `{{range IntRange 1 4}}{{FirstName}} {{LastName}}\n{{end}}` value, err := Template(template, &TemplateOptions{Data: 4}) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: Sonny Stiedemann Cody Donnelly Julius Farrell Mollie Legros
func TimeZone ¶
func TimeZone() string
TimeZone will select a random timezone string
Example ¶
Seed(11) fmt.Println(TimeZone())
Output: West Pacific Standard Time
func TimeZoneAbv ¶
func TimeZoneAbv() string
TimeZoneAbv will select a random timezone abbreviation string
Example ¶
Seed(11) fmt.Println(TimeZoneAbv())
Output: WPST
func TimeZoneFull ¶
func TimeZoneFull() string
TimeZoneFull will select a random full timezone string
Example ¶
Seed(11) fmt.Println(TimeZoneFull())
Output: (UTC+10:00) Guam, Port Moresby
func TimeZoneOffset ¶
func TimeZoneOffset() float32
TimeZoneOffset will select a random timezone offset
Example ¶
Seed(11) fmt.Println(TimeZoneOffset())
Output: 10
func TimeZoneRegion ¶
func TimeZoneRegion() string
TimeZoneRegion will select a random region style timezone string, e.g. "America/Chicago"
Example ¶
Seed(11) fmt.Println(TimeZoneRegion())
Output: Indian/Chagos
func URL ¶
func URL() string
URL will generate a random url string
Example ¶
Seed(11) fmt.Println(URL())
Output: http://www.directinnovative.biz/infrastructures
func UUID ¶
func UUID() string
UUID (version 4) will generate a random unique identifier based upon random numbers Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Example ¶
Seed(11) fmt.Println(UUID())
Output: b412b5fb-33a4-498e-9503-21c6b7e01dcf
func Uint16 ¶
func Uint16() uint16
Uint16 will generate a random uint16 value
Example ¶
Seed(11) fmt.Println(Uint16())
Output: 56756
func Uint32 ¶
func Uint32() uint32
Uint32 will generate a random uint32 value
Example ¶
Seed(11) fmt.Println(Uint32())
Output: 3847792206
func Uint64 ¶
func Uint64() uint64
Uint64 will generate a random uint64 value
Example ¶
Seed(11) fmt.Println(Uint64())
Output: 16526141687177076148
func Uint8 ¶
func Uint8() uint8
Uint8 will generate a random uint8 value
Example ¶
Seed(11) fmt.Println(Uint8())
Output: 180
func UintRange ¶
UintRange will generate a random uint value between min and max
Example ¶
Seed(11) fmt.Println(UintRange(1, 10))
Output: 9
func UserAgent ¶
func UserAgent() string
UserAgent will generate a random broswer user agent
Example ¶
Seed(11) fmt.Println(UserAgent())
Output: Mozilla/5.0 (Windows 98) AppleWebKit/5360 (KHTML, like Gecko) Chrome/37.0.852.0 Mobile Safari/5360
func Username ¶
func Username() string
Username will generate a random username based upon picking a random lastname and random numbers at the end
Example ¶
Seed(11) fmt.Println(Username())
Output: Treutel8125
func Vegetable ¶
func Vegetable() string
Vegetable will return a random vegetable name
Example ¶
Seed(11) fmt.Println(Vegetable())
Output: Sweet Potato
func Verb ¶
func Verb() string
Verb will generate a random verb
Example ¶
Seed(11) fmt.Println(Verb())
Output: would
func VerbAction ¶
func VerbAction() string
VerbAction will generate a random action verb
Example ¶
Seed(11) fmt.Println(VerbAction())
Output: paint
func VerbHelping ¶
func VerbHelping() string
VerbHelping will generate a random helping verb
Example ¶
Seed(11) fmt.Println(VerbHelping())
Output: am
func VerbIntransitive ¶
func VerbIntransitive() string
VerbIntransitive will generate a random intransitive verb
Example ¶
Seed(11) fmt.Println(VerbIntransitive())
Output: vomit
func VerbLinking ¶
func VerbLinking() string
VerbLinking will generate a random linking verb
Example ¶
Seed(11) fmt.Println(VerbLinking())
Output: must
func VerbTransitive ¶
func VerbTransitive() string
VerbTransitive will generate a random transitive verb
Example ¶
Seed(11) fmt.Println(VerbTransitive())
Output: upgrade
func Vowel ¶
func Vowel() string
Vowel will generate a single random lower case vowel
Example ¶
Seed(11) fmt.Println(Vowel())
Output: a
func WeekDay ¶
func WeekDay() string
WeekDay will generate a random weekday string (Monday-Sunday)
Example ¶
Seed(11) fmt.Println(WeekDay())
Output: Saturday
func Weighted ¶
Weighted will take in an array of options and weights and return a random selection based upon its indexed weight
Example ¶
Seed(11) options := []any{"hello", 2, 6.9} weights := []float32{1, 2, 3} option, _ := Weighted(options, weights) fmt.Println(option)
Output: 2
func Word ¶
func Word() string
Word will generate a random word
Example ¶
Seed(11) fmt.Println(Word())
Output: bathe
func XML ¶
func XML(xo *XMLOptions) ([]byte, error)
XML generates an object or an array of objects in json format A nil XMLOptions returns a randomly structured XML.
Example (Array) ¶
Seed(11) value, err := XML(&XMLOptions{ Type: "array", RootElement: "xml", RecordElement: "record", RowCount: 2, Indent: true, Fields: []Field{ {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: <xml> <record> <first_name>Sonny</first_name> <last_name>Stiedemann</last_name> <password>8nwf0o3sBXcR</password> </record> <record> <first_name>Verda</first_name> <last_name>Brakus</last_name> <password>3beWLpq75Lua</password> </record> </xml>
Example (Single) ¶
Seed(11) value, err := XML(&XMLOptions{ Type: "single", RootElement: "xml", RecordElement: "record", RowCount: 2, Indent: true, Fields: []Field{ {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: <xml> <first_name>Sonny</first_name> <last_name>Stiedemann</last_name> <password>8nwf0o3sBXcR</password> </xml>
Types ¶
type AddressInfo ¶
type AddressInfo struct { Address string `json:"address" xml:"address"` Street string `json:"street" xml:"street"` City string `json:"city" xml:"city"` State string `json:"state" xml:"state"` Zip string `json:"zip" xml:"zip"` Country string `json:"country" xml:"country"` Latitude float64 `json:"latitude" xml:"latitude"` Longitude float64 `json:"longitude" xml:"longitude"` }
AddressInfo is a struct full of address information
func Address ¶
func Address() *AddressInfo
Address will generate a struct of address information
Example ¶
Seed(11) address := Address() fmt.Println(address.Address) fmt.Println(address.Street) fmt.Println(address.City) fmt.Println(address.State) fmt.Println(address.Zip) fmt.Println(address.Country) fmt.Println(address.Latitude) fmt.Println(address.Longitude)
Output: 125 East Routemouth, North Las Vegas, South Dakota 17999 125 East Routemouth North Las Vegas South Dakota 17999 Iran (Islamic Republic of) 83.558542 -159.896615
type BookInfo ¶
type CSVOptions ¶
type CSVOptions struct { Delimiter string `json:"delimiter" xml:"delimiter" fake:"{randomstring:[,,tab]}"` RowCount int `json:"row_count" xml:"row_count" fake:"{number:1,10}"` Fields []Field `json:"fields" xml:"fields" fake:"{fields}"` }
CSVOptions defines values needed for csv generation
type CarInfo ¶
type CarInfo struct { Type string `json:"type" xml:"type"` Fuel string `json:"fuel" xml:"fuel"` Transmission string `json:"transmission" xml:"transmission"` Brand string `json:"brand" xml:"brand"` Model string `json:"model" xml:"model"` Year int `json:"year" xml:"year"` }
CarInfo is a struct dataset of all car information
func Car ¶
func Car() *CarInfo
Car will generate a struct with car information
Example ¶
Seed(11) car := Car() fmt.Println(car.Brand) fmt.Println(car.Fuel) fmt.Println(car.Model) fmt.Println(car.Transmission) fmt.Println(car.Type) fmt.Println(car.Year)
Output: Dacia CNG Santafe 4wd Automatic Passenger car heavy 1928
type ContactInfo ¶
type ContactInfo struct { Phone string `json:"phone" xml:"phone"` Email string `json:"email" xml:"email"` }
ContactInfo struct full of contact info
func Contact ¶
func Contact() *ContactInfo
Contact will generate a struct with information randomly populated contact information
Example ¶
Seed(11) contact := Contact() fmt.Println(contact.Phone) fmt.Println(contact.Email)
Output: 8812527598 stevebins@robel.io
type CreditCardInfo ¶
type CreditCardInfo struct { Type string `json:"type" xml:"type"` Number string `json:"number" xml:"number"` Exp string `json:"exp" xml:"exp"` Cvv string `json:"cvv" xml:"cvv"` }
CreditCardInfo is a struct containing credit variables
func CreditCard ¶
func CreditCard() *CreditCardInfo
CreditCard will generate a struct full of credit card information
Example ¶
Seed(11) ccInfo := CreditCard() fmt.Println(ccInfo.Type) fmt.Println(ccInfo.Number) fmt.Println(ccInfo.Exp) fmt.Println(ccInfo.Cvv)
Output: American Express 6376095989079994 06/29 125
type CreditCardOptions ¶
type CreditCardOptions struct { Types []string `json:"types"` Bins []string `json:"bins"` // optional parameter of prepended numbers Gaps bool `json:"gaps"` }
CreditCardOptions is the options for credit card number
type CurrencyInfo ¶
type CurrencyInfo struct { Short string `json:"short" xml:"short"` Long string `json:"long" xml:"long"` }
CurrencyInfo is a struct of currency information
func Currency ¶
func Currency() *CurrencyInfo
Currency will generate a struct with random currency information
Example ¶
Seed(11) currency := Currency() fmt.Println(currency.Short) fmt.Println(currency.Long)
Output: UGX Uganda Shilling
type EmailOptions ¶
type EmailOptions struct { }
EmailOptions defines values needed for email document generation
type Fakeable ¶
type Fakeable interface { // Fake returns a fake value for the type. Fake(faker *Faker) (any, error) }
Fakeable is an interface that can be implemented by a type to provide a custom fake value.
Example ¶
var t1 testStruct1 var t2 testStruct1 var t3 testStruct2 var t4 testStruct2 New(314).Struct(&t1) New(314).Struct(&t2) New(314).Struct(&t3) New(314).Struct(&t4) fmt.Printf("%#v\n", t1) fmt.Printf("%#v\n", t2) fmt.Printf("%#v\n", t3) fmt.Printf("%#v\n", t4)
Output: gofakeit.testStruct1{B:"Colton"} gofakeit.testStruct1{B:"Colton"} gofakeit.testStruct2{B:"Colton"} gofakeit.testStruct2{B:"Colton"}
Example (Employee) ¶
f1 := New(100) // Fakes random values from the Gamma distribution var A1 employee var A2 employee var A3 employee f1.Struct(&A1) f1.Struct(&A2) f1.Struct(&A3) fmt.Printf("%#v\n", A1) fmt.Printf("%#v\n", A2) fmt.Printf("%#v\n", A3)
Output: gofakeit.employee{Name:"Madelynn Hickle", CallCountPerHour:17} gofakeit.employee{Name:"Brooke Berge", CallCountPerHour:8} gofakeit.employee{Name:"Rosalee Roberts", CallCountPerHour:10}
Example (GammaFloat64) ¶
f1 := New(100) // Fakes random values from the Gamma distribution var A1 gammaFloat64 var A2 gammaFloat64 var A3 gammaFloat64 f1.Struct(&A1) f1.Struct(&A2) f1.Struct(&A3) fmt.Println(A1) fmt.Println(A2) fmt.Println(A3)
Output: 1.9058272589164647 1.951453943304136 4.336093466276675
type Faker ¶
type Faker struct { Rand rand.Source // Lock to make thread safe Locked bool // contains filtered or unexported fields }
Faker struct is the primary struct for using localized
func New ¶
New creates and returns a new Faker struct seeded with a given seed using the PCG algorithm in lock mode for thread safety
Example ¶
// Get new faker with default settings fake := New(11) // All global functions are also available in the structs methods fmt.Println("Name:", fake.Name()) fmt.Println("Email:", fake.Email()) fmt.Println("Phone:", fake.Phone())
Output: Name: Sonny Stiedemann Email: codydonnelly@leannon.biz Phone: 7598907999
func NewFaker ¶
NewFaker takes in a rand.Source and thread lock state and returns a new Faker struct
Example ¶
// Create new faker with ChaCha8, cryptographically secure chacha := rand.NewChaCha8([32]byte{5, 4, 3, 2, 1, 0}) fake := NewFaker(chacha, true) // or // Create new faker with PCG, pseudo-random pcg := rand.NewPCG(0, 0) fake = NewFaker(pcg, false) fmt.Println("Name:", fake.Name())
Output: Name: Damian Pagac
func (*Faker) AchAccount ¶
AchAccount will generate a 12 digit account number
Example ¶
f := New(11) fmt.Println(f.AchAccount())
Output: 881252759890
func (*Faker) AchRouting ¶
AchRouting will generate a 9 digit routing number
Example ¶
f := New(11) fmt.Println(f.AchRouting())
Output: 881252759
func (*Faker) Address ¶
func (f *Faker) Address() *AddressInfo
Address will generate a struct of address information
Example ¶
f := New(11) address := f.Address() fmt.Println(address.Address) fmt.Println(address.Street) fmt.Println(address.City) fmt.Println(address.State) fmt.Println(address.Zip) fmt.Println(address.Country) fmt.Println(address.Latitude) fmt.Println(address.Longitude)
Output: 125 East Routemouth, North Las Vegas, South Dakota 17999 125 East Routemouth North Las Vegas South Dakota 17999 Iran (Islamic Republic of) 83.558542 -159.896615
func (*Faker) Adjective ¶
Adjective will generate a random adjective
Example ¶
f := New(11) fmt.Println(f.Adjective())
Output: none
func (*Faker) AdjectiveDemonstrative ¶
AdjectiveDemonstrative will generate a random demonstrative adjective
Example ¶
f := New(11) fmt.Println(f.AdjectiveDemonstrative())
Output: it
func (*Faker) AdjectiveDescriptive ¶
AdjectiveDescriptive will generate a random descriptive adjective
Example ¶
f := New(11) fmt.Println(f.AdjectiveDescriptive())
Output: tired
func (*Faker) AdjectiveIndefinite ¶
AdjectiveIndefinite will generate a random indefinite adjective
Example ¶
f := New(11) fmt.Println(f.AdjectiveIndefinite())
Output: several
func (*Faker) AdjectiveInterrogative ¶
AdjectiveInterrogative will generate a random interrogative adjective
Example ¶
f := New(11) fmt.Println(f.AdjectiveInterrogative())
Output: which
func (*Faker) AdjectivePossessive ¶
AdjectivePossessive will generate a random possessive adjective
Example ¶
f := New(11) fmt.Println(f.AdjectivePossessive())
Output: their
func (*Faker) AdjectiveProper ¶
AdjectiveProper will generate a random proper adjective
Example ¶
f := New(11) fmt.Println(f.AdjectiveProper())
Output: Swiss
func (*Faker) AdjectiveQuantitative ¶
AdjectiveQuantitative will generate a random quantitative adjective
Example ¶
f := New(11) fmt.Println(f.AdjectiveQuantitative())
Output: sparse
func (*Faker) Adverb ¶
Adverb will generate a random adverb
Example ¶
f := New(11) fmt.Println(f.Adverb())
Output: ever
func (*Faker) AdverbDegree ¶
AdverbDegree will generate a random degree adverb
Example ¶
f := New(11) fmt.Println(f.AdverbDegree())
Output: too
func (*Faker) AdverbFrequencyDefinite ¶
AdverbFrequencyDefinite will generate a random frequency definite adverb
Example ¶
f := New(11) fmt.Println(f.AdverbFrequencyDefinite())
Output: yearly
func (*Faker) AdverbFrequencyIndefinite ¶
AdverbFrequencyIndefinite will generate a random frequency indefinite adverb
Example ¶
f := New(11) fmt.Println(f.AdverbFrequencyIndefinite())
Output: generally
func (*Faker) AdverbManner ¶
AdverbManner will generate a random manner adverb
Example ¶
f := New(11) fmt.Println(f.AdverbManner())
Output: tensely
func (*Faker) AdverbPlace ¶
AdverbPlace will generate a random place adverb
Example ¶
f := New(11) fmt.Println(f.AdverbPlace())
Output: under
func (*Faker) AdverbTimeDefinite ¶
AdverbTimeDefinite will generate a random time definite adverb
Example ¶
f := New(11) fmt.Println(f.AdverbTimeDefinite())
Output: yesterday
func (*Faker) AdverbTimeIndefinite ¶
AdverbTimeIndefinite will generate a random time indefinite adverb
Example ¶
f := New(11) fmt.Println(f.AdverbTimeIndefinite())
Output: soon
func (*Faker) Animal ¶
Animal will return a random animal
Example ¶
f := New(11) fmt.Println(f.Animal())
Output: turtle
func (*Faker) AnimalType ¶
AnimalType will return a random animal type
Example ¶
f := New(11) fmt.Println(f.AnimalType())
Output: reptiles
func (*Faker) AppAuthor ¶
AppAuthor will generate a random company or person name
Example ¶
f := New(11) fmt.Println(f.AppAuthor())
Output: StreetEasy
func (*Faker) AppName ¶
AppName will generate a random app name
Example ¶
f := New(11) fmt.Println(f.AppName())
Output: Swanthink
func (*Faker) AppVersion ¶
AppVersion will generate a random app version
Example ¶
f := New(11) fmt.Println(f.AppVersion())
Output: 5.18.4
func (*Faker) BS ¶
BS will generate a random company bs string
Example ¶
f := New(11) fmt.Println(f.BS())
Output: models
func (*Faker) BeerAlcohol ¶
BeerAlcohol will return a random beer alcohol level between 2.0 and 10.0
Example ¶
f := New(11) fmt.Println(f.BeerAlcohol())
Output: 8.2%
func (*Faker) BeerBlg ¶
BeerBlg will return a random beer blg between 5.0 and 20.0
Example ¶
f := New(11) fmt.Println(f.BeerBlg())
Output: 16.6°Blg
func (*Faker) BeerHop ¶
BeerHop will return a random beer hop
Example ¶
f := New(11) fmt.Println(f.BeerHop())
Output: TriplePearl
func (*Faker) BeerIbu ¶
BeerIbu will return a random beer ibu value between 10 and 100
Example ¶
f := New(11) fmt.Println(f.BeerIbu())
Output: 91 IBU
func (*Faker) BeerMalt ¶
BeerMalt will return a random beer malt
Example ¶
f := New(11) fmt.Println(f.BeerMalt())
Output: Munich
func (*Faker) BeerName ¶
BeerName will return a random beer name
Example ¶
f := New(11) fmt.Println(f.BeerName())
Output: Sierra Nevada Bigfoot Barleywine Style Ale
func (*Faker) BeerStyle ¶
BeerStyle will return a random beer style
Example ¶
f := New(11) fmt.Println(f.BeerStyle())
Output: Vegetable Beer
func (*Faker) BeerYeast ¶
BeerYeast will return a random beer yeast
Example ¶
f := New(11) fmt.Println(f.BeerYeast())
Output: 2308 - Munich Lager
func (*Faker) Bird ¶
Bird will return a random bird species
Example ¶
f := New(11) fmt.Println(f.Bird())
Output: toucan
func (*Faker) BitcoinAddress ¶
BitcoinAddress will generate a random bitcoin address consisting of numbers, upper and lower characters
Example ¶
f := New(11) fmt.Println(f.BitcoinAddress())
Output: 13blsBo8bffq7a35c5nwLT4eXWu0pReLF1
func (*Faker) BitcoinPrivateKey ¶
BitcoinPrivateKey will generate a random bitcoin private key base58 consisting of numbers, upper and lower characters
Example ¶
f := New(11) fmt.Println(f.BitcoinPrivateKey())
Output: 5JMZxkQX2PgaasaHc8wnWLNdMu7rxeU7xS64ev7RWNinacicPfm
func (*Faker) Book ¶
Example ¶
f := New(11) book := f.Book() fmt.Println(book.Title) fmt.Println(book.Author) fmt.Println(book.Genre)
Output: Things Fall Apart Toni Morrison Erotic
func (*Faker) BookAuthor ¶
Example ¶
f := New(11) fmt.Println(f.BookAuthor())
Output: Vladimir Nabokov
func (*Faker) BookTitle ¶
Example ¶
f := New(11) fmt.Println(f.BookTitle())
Output: Things Fall Apart
func (*Faker) Bool ¶
Bool will generate a random boolean value
Example ¶
f := New(11) fmt.Println(f.Bool())
Output: false
func (*Faker) Breakfast ¶
Breakfast will return a random breakfast name
Example ¶
f := New(11) fmt.Println(f.Breakfast())
Output: Purple cow
func (*Faker) BuzzWord ¶
BuzzWord will generate a random company buzz word string
Example ¶
f := New(11) fmt.Println(f.BuzzWord())
Output: open system
func (*Faker) CSV ¶
func (f *Faker) CSV(co *CSVOptions) ([]byte, error)
CSV generates an object or an array of objects in json format A nil CSVOptions returns a randomly structured CSV.
Example (Array) ¶
f := New(11) value, err := f.CSV(&CSVOptions{ RowCount: 3, Fields: []Field{ {Name: "id", Function: "autoincrement"}, {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: id,first_name,last_name,password 1,Sonny,Stiedemann,8nwf0o3sBXcR 2,Verda,Brakus,3beWLpq75Lua 3,Jules,Cremin,Uu38J14Y8W82
func (*Faker) Car ¶
Car will generate a struct with car information
Example ¶
f := New(11) car := f.Car() fmt.Println(car.Brand) fmt.Println(car.Fuel) fmt.Println(car.Model) fmt.Println(car.Transmission) fmt.Println(car.Type) fmt.Println(car.Year)
Output: Dacia CNG Santafe 4wd Automatic Passenger car heavy 1928
func (*Faker) CarFuelType ¶
CarFuelType will return a random fuel type
Example ¶
f := New(11) fmt.Println(f.CarFuelType())
Output: Electric
func (*Faker) CarMaker ¶
CarMaker will return a random car maker
Example ¶
f := New(11) fmt.Println(f.CarMaker())
Output: Spyker
func (*Faker) CarModel ¶
CarModel will return a random car model
Example ¶
f := New(11) fmt.Println(f.CarModel())
Output: Prius
func (*Faker) CarTransmissionType ¶
CarTransmissionType will return a random transmission type
Example ¶
f := New(11) fmt.Println(f.CarTransmissionType())
Output: Manual
func (*Faker) CarType ¶
CarType will generate a random car type string
Example ¶
f := New(11) fmt.Println(f.CarType())
Output: Passenger car heavy
func (*Faker) Cat ¶
Cat will return a random cat breed
Example ¶
f := New(11) fmt.Println(f.Cat())
Output: Sokoke
func (*Faker) CelebrityActor ¶
CelebrityActor will generate a random celebrity actor
Example ¶
f := New(11) fmt.Println(f.CelebrityActor())
Output: Shah Rukh Khan
func (*Faker) CelebrityBusiness ¶
CelebrityBusiness will generate a random celebrity business person
Example ¶
f := New(11) fmt.Println(f.CelebrityBusiness())
Output: Prescott Bush
func (*Faker) CelebritySport ¶
CelebritySport will generate a random celebrity sport person
Example ¶
f := New(11) fmt.Println(f.CelebritySport())
Output: Grete Waitz
func (*Faker) ChromeUserAgent ¶
ChromeUserAgent will generate a random chrome browser user agent string
Example ¶
f := New(11) fmt.Println(f.ChromeUserAgent())
Output: Mozilla/5.0 (Windows CE) AppleWebKit/5362 (KHTML, like Gecko) Chrome/36.0.820.0 Mobile Safari/5362
func (*Faker) City ¶
City will generate a random city string
Example ¶
f := New(11) fmt.Println(f.City())
Output: Reno
func (*Faker) Color ¶
Color will generate a random color string
Example ¶
f := New(11) fmt.Println(f.Color())
Output: SlateGray
func (*Faker) Comment ¶
Comment will generate a random statement or remark expressing an opinion, observation, or reaction
Example ¶
f := New(11) fmt.Println(f.Comment())
Output: Fear Drink To Heart.
func (*Faker) Company ¶
Company will generate a random company name string
Example ¶
f := New(11) fmt.Println(f.Company())
Output: TransparaGov
func (*Faker) CompanySuffix ¶
CompanySuffix will generate a random company suffix string
Example ¶
f := New(11) fmt.Println(f.CompanySuffix())
Output: Inc
func (*Faker) Connective ¶
Connective will generate a random connective
Example ¶
f := New(11) fmt.Println(f.Connective())
Output: through
func (*Faker) ConnectiveCasual ¶
ConnectiveCasual will generate a random casual connective
Example ¶
f := New(11) fmt.Println(f.ConnectiveCasual())
Output: though
func (*Faker) ConnectiveComparative ¶
ConnectiveComparative will generate a random comparative connective
Example ¶
f := New(11) fmt.Println(f.ConnectiveComparative())
Output: after all
func (*Faker) ConnectiveComplaint ¶
ConnectiveComplaint will generate a random complaint connective
Example ¶
f := New(11) fmt.Println(f.ConnectiveComplaint())
Output: i.e.
func (*Faker) ConnectiveExamplify ¶
ConnectiveExamplify will generate a random examplify connective
Example ¶
f := New(11) fmt.Println(f.ConnectiveExamplify())
Output: unless
func (*Faker) ConnectiveListing ¶
ConnectiveListing will generate a random listing connective
Example ¶
f := New(11) fmt.Println(f.ConnectiveListing())
Output: in summation
func (*Faker) ConnectiveTime ¶
Example ¶
f := New(11) fmt.Println(f.ConnectiveTime())
Output: when
func (*Faker) Contact ¶
func (f *Faker) Contact() *ContactInfo
Contact will generate a struct with information randomly populated contact information
Example ¶
f := New(11) contact := f.Contact() fmt.Println(contact.Phone) fmt.Println(contact.Email)
Output: 8812527598 stevebins@robel.io
func (*Faker) Country ¶
Country will generate a random country string
Example ¶
f := New(11) fmt.Println(f.Country())
Output: Tonga
func (*Faker) CountryAbr ¶
CountryAbr will generate a random abbreviated country string
Example ¶
f := New(11) fmt.Println(f.CountryAbr())
Output: TO
func (*Faker) CreditCard ¶
func (f *Faker) CreditCard() *CreditCardInfo
CreditCard will generate a struct full of credit card information
Example ¶
f := New(11) ccInfo := f.CreditCard() fmt.Println(ccInfo.Type) fmt.Println(ccInfo.Number) fmt.Println(ccInfo.Exp) fmt.Println(ccInfo.Cvv)
Output: American Express 6376095989079994 06/29 125
func (*Faker) CreditCardCvv ¶
CreditCardCvv will generate a random CVV number Its a string because you could have 017 as an exp date
Example ¶
f := New(11) fmt.Println(f.CreditCardCvv())
Output: 881
func (*Faker) CreditCardExp ¶
CreditCardExp will generate a random credit card expiration date string Exp date will always be a future date
Example ¶
f := New(11) fmt.Println(f.CreditCardExp())
Output: 11/33
func (*Faker) CreditCardNumber ¶
func (f *Faker) CreditCardNumber(cco *CreditCardOptions) string
CreditCardNumber will generate a random luhn credit card number
Example ¶
f := New(11) fmt.Println(f.CreditCardNumber(nil)) fmt.Println(f.CreditCardNumber(&CreditCardOptions{Types: []string{"visa", "discover"}})) fmt.Println(f.CreditCardNumber(&CreditCardOptions{Bins: []string{"4111"}})) fmt.Println(f.CreditCardNumber(&CreditCardOptions{Gaps: true}))
Output: 6376121252759896 6449344737930519 4111026894059156 6706 2052 5709 6
func (*Faker) CreditCardType ¶
CreditCardType will generate a random credit card type string
Example ¶
f := New(11) fmt.Println(f.CreditCardType())
Output: Hiper
func (*Faker) Currency ¶
func (f *Faker) Currency() *CurrencyInfo
Currency will generate a struct with random currency information
Example ¶
f := New(11) currency := f.Currency() fmt.Println(currency.Short) fmt.Println(currency.Long)
Output: UGX Uganda Shilling
func (*Faker) CurrencyLong ¶
CurrencyLong will generate a random long currency name
Example ¶
f := New(11) fmt.Println(f.CurrencyLong())
Output: Uganda Shilling
func (*Faker) CurrencyShort ¶
CurrencyShort will generate a random short currency value
Example ¶
f := New(11) fmt.Println(f.CurrencyShort())
Output: UGX
func (*Faker) Date ¶
Date will generate a random time.Time struct
Example ¶
f := New(11) fmt.Println(f.Date())
Output: 2011-11-07 04:31:13.726582492 +0000 UTC
func (*Faker) DateRange ¶
DateRange will generate a random time.Time struct between a start and end date
Example ¶
f := New(11) fmt.Println(f.DateRange(time.Unix(0, 484633944473634951), time.Unix(0, 1431318744473668209))) // May 10, 1985 years to May 10, 2015
Output: 2012-03-26 09:20:49.250961474 +0000 UTC
func (*Faker) Day ¶
Day will generate a random day between 1 - 31
Example ¶
f := New(11) fmt.Println(f.Day())
Output: 28
func (*Faker) Dessert ¶
Dessert will return a random dessert name
Example ¶
f := New(11) fmt.Println(f.Dessert())
Output: Amish cream pie
func (*Faker) Dice ¶
Dice will generate a random set of dice
Example ¶
f := New(11) fmt.Println(f.Dice(1, []uint{6}))
Output: [6]
func (*Faker) Digit ¶
Digit will generate a single ASCII digit
Example ¶
f := New(11) fmt.Println(f.Digit())
Output: 8
func (*Faker) DigitN ¶
DigitN will generate a random string of length N consists of ASCII digits. Note that the string generated can start with 0 and this function returns a string with a length of 1 when 0 is passed.
Example ¶
f := New(11) fmt.Println(f.DigitN(10))
Output: 8812527598
func (*Faker) Dinner ¶
Dinner will return a random dinner name
Example ¶
f := New(11) fmt.Println(f.Dinner())
Output: German apple cake with cream cheese frosting
func (*Faker) Dog ¶
Dog will return a random dog breed
Example ¶
f := New(11) fmt.Println(f.Dog())
Output: Rat Terrier
func (*Faker) DomainName ¶
DomainName will generate a random url domain name
Example ¶
f := New(11) fmt.Println(f.DomainName())
Output: productinfrastructures.biz
func (*Faker) DomainSuffix ¶
DomainSuffix will generate a random domain suffix
Example ¶
f := New(11) fmt.Println(f.DomainSuffix())
Output: io
func (*Faker) Drink ¶
Drink will return a random drink name
Example ¶
f := New(11) fmt.Println(f.Drink())
Output: Wine
func (*Faker) Email ¶
Email will generate a random email string
Example ¶
f := New(11) fmt.Println(f.Email())
Output: sonnystiedemann@donnelly.biz
func (*Faker) EmailText ¶
func (f *Faker) EmailText(co *EmailOptions) (string, error)
EmailText will return a single random text email template document
Example ¶
f := New(11) value, err := f.EmailText(&EmailOptions{}) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: Subject: Hi from Russ! Dear Donnelly, Greetings! I hope your day is going well. I trust this email finds you well. Sending good vibes your way. Galaxy they how shall cut lastly that someone additionally ambulance. Could a tennis occur why depend heels out can fire. Anyone sometimes that leap whom troop now scarcely since dance. Huh somebody constantly Italian outfit certain weekly murder who cackle. Because her break write nobody could according whoa bevy we. Them summation to oxygen Greek how previously a what answer. Handle daily ouch upon encourage that after his every she. Wearily still he herself huge failure for yay sparse thoughtfully. Box anyway Jungian regularly world great daily recently whose Elizabethan. Outside to theirs block while French closely sit you to. Out fight bored yours those bale Parisian host which so. Today Ecuadorian hourly decidedly his everybody this play this little. Them on recently eager usually bunch daily whose somebody them. Few tonight dishonesty spell battery less patience whose inside hair. Your answer hand tonight these she team which today Einsteinian. I'm eager to hear your feedback on it. If you have a moment, please feel free to check out the project on GitLab Your insights would be invaluable. Your thoughts matter to me. I appreciate your attention to this matter. Your feedback is greatly appreciated. Sincerely Hyman Rogahn mervingottlieb@goldner.com 1-275-132-4165
func (*Faker) Emoji ¶
Emoji will return a random fun emoji
Example ¶
f := New(11) fmt.Println(f.Emoji())
Output: 🇫🇴
func (*Faker) EmojiAlias ¶
EmojiAlias will return a random fun emoji alias
Example ¶
f := New(11) fmt.Println(f.EmojiAlias())
Output: eritrea
func (*Faker) EmojiCategory ¶
EmojiCategory will return a random fun emoji category
Example ¶
f := New(11) fmt.Println(f.EmojiCategory())
Output: Flags
func (*Faker) EmojiDescription ¶
EmojiDescription will return a random fun emoji description
Example ¶
f := New(11) fmt.Println(f.EmojiDescription())
Output: flag: European Union
func (*Faker) EmojiTag ¶
EmojiTag will return a random fun emoji tag
Example ¶
f := New(11) fmt.Println(f.EmojiTag())
Output: toilet
func (*Faker) Error ¶
Error will return a random generic error
Example ¶
f := New(11) fmt.Println(f.Error())
Output: variable assigned before declaration
func (*Faker) ErrorDatabase ¶
ErrorDatabase will return a random database error
Example ¶
f := New(11) fmt.Println(f.ErrorDatabase())
Output: destination pointer is nil
func (*Faker) ErrorGRPC ¶
ErrorGRPC will return a random gRPC error
Example ¶
f := New(11) fmt.Println(f.ErrorGRPC())
Output: connection refused
func (*Faker) ErrorHTTP ¶
ErrorHTTP will return a random HTTP error
Example ¶
f := New(11) fmt.Println(f.ErrorHTTP())
Output: wrote more than the declared Content-Length
func (*Faker) ErrorHTTPClient ¶
ErrorHTTPClient will return a random HTTP client error response (400-418)
Example ¶
f := New(11) fmt.Println(f.ErrorHTTPClient())
Output: expectation failed
func (*Faker) ErrorHTTPServer ¶
ErrorHTTPServer will return a random HTTP server error response (500-511)
Example ¶
f := New(11) fmt.Println(f.ErrorHTTPServer())
Output: not extended
func (*Faker) ErrorObject ¶
ErrorObject will return a random error object word
Example ¶
f := New(11) fmt.Println(f.ErrorObject())
Output: url
func (*Faker) ErrorRuntime ¶
ErrorRuntime will return a random runtime error
Example ¶
f := New(11) fmt.Println(f.ErrorRuntime())
Output: expected 2 arguments, got 3
func (*Faker) ErrorValidation ¶
ErrorValidation will return a random validation error
Example ¶
f := New(11) fmt.Println(f.ErrorValidation())
Output: payment details cannot be verified
func (*Faker) FarmAnimal ¶
FarmAnimal will return a random animal that usually lives on a farm
Example ¶
f := New(11) fmt.Println(f.FarmAnimal())
Output: Sheep
func (*Faker) FileExtension ¶
FileExtension will generate a random file extension
Example ¶
f := New(11) fmt.Println(f.FileExtension())
Output: dtd
func (*Faker) FileMimeType ¶
FileMimeType will generate a random mime file type
Example ¶
f := New(11) fmt.Println(f.FileMimeType())
Output: application/x-wri
func (*Faker) FirefoxUserAgent ¶
FirefoxUserAgent will generate a random firefox broswer user agent string
Example ¶
f := New(11) fmt.Println(f.FirefoxUserAgent())
Output: Mozilla/5.0 (Windows CE; en-US; rv:1.9.3.20) Gecko/2011-11-07 Firefox/36.0
func (*Faker) FirstName ¶
FirstName will generate a random first name
Example ¶
f := New(11) fmt.Println(f.FirstName())
Output: Sonny
func (*Faker) FixedWidth ¶
func (f *Faker) FixedWidth(co *FixedWidthOptions) (string, error)
FixedWidth generates an table of random data in fixed width format A nil FixedWidthOptions returns a randomly structured FixedWidth.
Example ¶
f := New(11) value, err := f.FixedWidth(&FixedWidthOptions{ RowCount: 3, Fields: []Field{ {Name: "Name", Function: "{firstname} {lastname}"}, {Name: "Email", Function: "email"}, {Name: "Password", Function: "password", Params: MapParams{"special": {"false"}}}, {Name: "Age", Function: "{number:1,100}"}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: Name Email Password Age Sonny Stiedemann mollielegros@wilderman.org 3T8l34B5F0eb 62 Cody Donnelly stevebins@robel.io 3fnu2C12baqe 9 Julius Farrell tomasaullrich@hane.name e8W8SJGZi1Y4 77
func (*Faker) FlipACoin ¶
FlipACoin will return a random value of Heads or Tails
Example ¶
f := New(11) fmt.Println(f.FlipACoin())
Output: Tails
func (*Faker) Float32 ¶
Float32 will generate a random float32 value
Example ¶
f := New(11) fmt.Println(f.Float32())
Output: 0.3462876
func (*Faker) Float32Range ¶
Float32Range will generate a random float32 value between min and max
Example ¶
f := New(11) fmt.Println(f.Float32Range(0, 9999999))
Output: 3.4628758e+06
func (*Faker) Float64 ¶
Float64 will generate a random float64 value
Example ¶
f := New(11) fmt.Println(f.Float64())
Output: 0.7703009321621068
func (*Faker) Float64Range ¶
Float64Range will generate a random float64 value between min and max
Example ¶
f := New(11) fmt.Println(f.Float64Range(0, 9999999))
Output: 7.703008551320136e+06
func (*Faker) Fruit ¶
Fruit will return a random fruit name
Example ¶
f := New(11) fmt.Println(f.Fruit())
Output: Redcurrant
func (*Faker) FutureDate ¶
FutureDate will generate a random future time.Time struct
Example ¶
f := New(11) fmt.Println(f.FutureDate())
Output:
func (*Faker) Gamertag ¶
Gamertag will generate a random video game username
Example ¶
f := New(11) fmt.Println(f.Gamertag())
Output: TurkeyThinker
func (*Faker) Gender ¶
Gender will generate a random gender string
Example ¶
f := New(11) fmt.Println(f.Gender())
Output: female
func (*Faker) Generate ¶
Generate fake information from given string. Replaceable values should be within {}
Functions Ex: {firstname} - billy Ex: {sentence:3} - Record river mind. Ex: {number:1,10} - 4 Ex: {uuid} - 590c1440-9888-45b0-bd51-a817ee07c3f2
Letters/Numbers Ex: ### - 481 - random numbers Ex: ??? - fda - random letters
For a complete list of runnable functions use FuncsLookup
Example ¶
f := New(11) genStr, _ := f.Generate("{firstname} {lastname} {email} #?#?#?") fmt.Println(genStr) genStr, _ = f.Generate("{sentence:3}") fmt.Println(genStr) genStr, _ = f.Generate("{shuffleints:[1,2,3]}") fmt.Println(genStr) genStr, _ = f.Generate("{randomint:[1,2,3,-4]}") fmt.Println(genStr) genStr, _ = f.Generate("{randomuint:[1,2,3,4]}") fmt.Println(genStr) genStr, _ = f.Generate("{number:1,50}") fmt.Println(genStr) genStr, _ = f.Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}") fmt.Println(genStr)
Output: Mollie Legros vanceschroeder@turner.com 8K8b1M Something am elsewhere. [3 2 1] 3 3 18 [key:value a:b int:string 1:2]
func (*Faker) HTTPMethod ¶
HTTPMethod will generate a random http method
Example ¶
f := New(11) fmt.Println(f.HTTPMethod())
Output: DELETE
func (*Faker) HTTPStatusCode ¶
HTTPStatusCode will generate a random status code
Example ¶
f := New(11) fmt.Println(f.HTTPStatusCode())
Output: 502
func (*Faker) HTTPStatusCodeSimple ¶
HTTPStatusCodeSimple will generate a random simple status code
Example ¶
f := New(11) fmt.Println(f.HTTPStatusCodeSimple())
Output: 500
func (*Faker) HTTPVersion ¶
HTTPVersion will generate a random http version
Example ¶
f := New(11) fmt.Println(f.HTTPVersion())
Output: HTTP/2.0
func (*Faker) HackerAbbreviation ¶
HackerAbbreviation will return a random hacker abbreviation
Example ¶
f := New(11) fmt.Println(f.HackerAbbreviation())
Output: SCSI
func (*Faker) HackerAdjective ¶
HackerAdjective will return a random hacker adjective
Example ¶
f := New(11) fmt.Println(f.HackerAdjective())
Output: solid state
func (*Faker) HackerNoun ¶
HackerNoun will return a random hacker noun
Example ¶
f := New(11) fmt.Println(f.HackerNoun())
Output: circuit
func (*Faker) HackerPhrase ¶
HackerPhrase will return a random hacker sentence
Example ¶
f := New(11) fmt.Println(f.HackerPhrase())
Output: Use the optical CSS microchip, then you can write the open-source monitor!
func (*Faker) HackerVerb ¶
HackerVerb will return a random hacker verb
Example ¶
f := New(11) fmt.Println(f.HackerVerb())
Output: lock
func (*Faker) HackeringVerb ¶
HackeringVerb will return a random hacker ingverb
Example ¶
f := New(11) fmt.Println(f.HackeringVerb())
Output: compressing
func (*Faker) HexColor ¶
HexColor will generate a random hexadecimal color string
Example ¶
f := New(11) fmt.Println(f.HexColor())
Output: #ef759a
func (*Faker) HexUint ¶
HexUint will generate a random uint hex value with "0x" prefix
Example ¶
f := New(11) fmt.Println(f.HexUint(16))
Output: 0x425b
func (*Faker) HipsterParagraph ¶
func (f *Faker) HipsterParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
HipsterParagraph will generate a random paragraphGenerator Set Paragraph Count Set Sentence Count Set Word Count Set Paragraph Separator
Example ¶
f := New(11) fmt.Println(f.HipsterParagraph(3, 5, 12, "\n"))
Output: Semiotics everyday you probably haven't heard of them you probably haven't heard of them portland austin tattooed retro cardigan Yuccie cred hoodie. Vice pug pug cred intelligentsia roof helvetica squid chambray literally ennui ugh. Chicharrones messenger bag narwhal ennui flannel twee art party mustache sartorial gluten-free cardigan cronut. Hoodie kickstarter cardigan Thundercats heirloom hashtag bitters salvia cleanse forage chartreuse keffiyeh. Sustainable tofu mustache bespoke vice aesthetic iPhone ugh lo-fi health put a bird on it blue bottle. Pop-up pabst pitchfork literally roof tattooed tilde shoreditch green juice ethical celiac tilde. Kombucha kinfolk occupy tacos ramps 90's echo meditation kale chips gluten-free humblebrag keffiyeh. Lo-fi bespoke wayfarers chicharrones crucifix green juice humblebrag organic viral shabby chic locavore cred. Roof forage farm-to-table YOLO williamsburg crucifix blog everyday green juice listicle wayfarers post-ironic. Single-origin coffee cray organic YOLO disrupt venmo tofu meggings fanny pack master craft beer tofu. Hella helvetica microdosing literally meh etsy echo pabst goth readymade +1 marfa. Pork belly hammock kale chips yr green juice stumptown crucifix hella pork belly franzen wolf austin. Offal cred chartreuse freegan intelligentsia twee trust fund paleo pinterest austin typewriter kogi. Pug single-origin coffee ethical irony helvetica beard green juice viral post-ironic Godard slow-carb put a bird on it. Schlitz hammock beard chia kitsch cred salvia irony farm-to-table loko truffaut ramps.
func (*Faker) HipsterSentence ¶
HipsterSentence will generate a random sentence
Example ¶
f := New(11) fmt.Println(f.HipsterSentence(5))
Output: Semiotics everyday you probably haven't heard of them you probably haven't heard of them portland.
func (*Faker) HipsterWord ¶
HipsterWord will return a single hipster word
Example ¶
f := New(11) fmt.Println(f.HipsterWord())
Output: semiotics
func (*Faker) Hobby ¶
Hobby will generate a random hobby string
Example ¶
f := New(11) fmt.Println(f.Hobby())
Output: Marching band
func (*Faker) Hour ¶
Hour will generate a random hour - in military time
Example ¶
f := New(11) fmt.Println(f.Hour())
Output: 21
func (*Faker) IPv4Address ¶
IPv4Address will generate a random version 4 ip address
Example ¶
f := New(11) fmt.Println(f.IPv4Address())
Output: 180.18.181.251
func (*Faker) IPv6Address ¶
IPv6Address will generate a random version 6 ip address
Example ¶
f := New(11) fmt.Println(f.IPv6Address())
Output: ddb4:9212:aab5:87fb:4e33:17a4:f7b9:bf8e
func (*Faker) Image ¶
Image generates a random rgba image
Example ¶
f := New(11) fmt.Println(f.Image(1, 1))
Output: &{[180 18 181 255] 4 (0,0)-(1,1)}
func (*Faker) ImageJpeg ¶
ImageJpeg generates a random rgba jpeg image
Example ¶
f := New(11) fmt.Println(f.ImageJpeg(1, 1))
Output: [255 216 255 219 0 132 0 8 6 6 7 6 5 8 7 7 7 9 9 8 10 12 20 13 12 11 11 12 25 18 19 15 20 29 26 31 30 29 26 28 28 32 36 46 39 32 34 44 35 28 28 40 55 41 44 48 49 52 52 52 31 39 57 61 56 50 60 46 51 52 50 1 9 9 9 12 11 12 24 13 13 24 50 33 28 33 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 255 192 0 17 8 0 1 0 1 3 1 34 0 2 17 1 3 17 1 255 196 1 162 0 0 1 5 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 16 0 2 1 3 3 2 4 3 5 5 4 4 0 0 1 125 1 2 3 0 4 17 5 18 33 49 65 6 19 81 97 7 34 113 20 50 129 145 161 8 35 66 177 193 21 82 209 240 36 51 98 114 130 9 10 22 23 24 25 26 37 38 39 40 41 42 52 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 225 226 227 228 229 230 231 232 233 234 241 242 243 244 245 246 247 248 249 250 1 0 3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 17 0 2 1 2 4 4 3 4 7 5 4 4 0 1 2 119 0 1 2 3 17 4 5 33 49 6 18 65 81 7 97 113 19 34 50 129 8 20 66 145 161 177 193 9 35 51 82 240 21 98 114 209 10 22 36 52 225 37 241 23 24 25 26 38 39 40 41 42 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 130 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 226 227 228 229 230 231 232 233 234 242 243 244 245 246 247 248 249 250 255 218 0 12 3 1 0 2 17 3 17 0 63 0 229 40 162 138 251 3 239 15 255 217]
func (*Faker) ImagePng ¶
ImagePng generates a random rgba png image
Example ¶
f := New(11) fmt.Println(f.ImagePng(1, 1))
Output: [137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 0 1 0 0 0 1 8 2 0 0 0 144 119 83 222 0 0 0 16 73 68 65 84 120 156 98 218 34 180 21 16 0 0 255 255 3 1 1 126 242 54 123 184 0 0 0 0 73 69 78 68 174 66 96 130]
func (*Faker) InputName ¶
InputName will return a random input field name
Example ¶
f := New(11) fmt.Println(f.InputName())
Output: message
func (*Faker) Int16 ¶
Int16 will generate a random int16 value
Example ¶
f := New(11) fmt.Println(f.Int16())
Output: 23988
func (*Faker) Int32 ¶
Int32 will generate a random int32 value
Example ¶
f := New(11) fmt.Println(f.Int32())
Output: 1923896103
func (*Faker) Int64 ¶
Int64 will generate a random int64 value
Example ¶
f := New(11) fmt.Println(f.Int64())
Output: 7302769650322300340
func (*Faker) Int8 ¶
Int8 will generate a random Int8 value
Example ¶
f := New(11) fmt.Println(f.Int8())
Output: 52
func (*Faker) IntRange ¶
IntRange will generate a random int value between min and max
Example ¶
f := New(11) fmt.Println(f.IntRange(1, 10))
Output: 9
func (*Faker) Interjection ¶
Interjection will generate a random word expressing emotion
Example ¶
f := New(11) fmt.Println(f.Interjection())
Output: alas
func (*Faker) JSON ¶
func (f *Faker) JSON(jo *JSONOptions) ([]byte, error)
JSON generates an object or an array of objects in json format. A nil JSONOptions returns a randomly structured JSON.
Example (Array) ¶
f := New(11) value, err := f.JSON(&JSONOptions{ Type: "array", Fields: []Field{ {Name: "id", Function: "autoincrement"}, {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, RowCount: 3, Indent: true, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: [ { "id": 1, "first_name": "Sonny", "last_name": "Stiedemann", "password": "8nwf0o3sBXcR" }, { "id": 2, "first_name": "Verda", "last_name": "Brakus", "password": "3beWLpq75Lua" }, { "id": 3, "first_name": "Jules", "last_name": "Cremin", "password": "Uu38J14Y8W82" } ]
Example (Object) ¶
f := New(11) value, err := f.JSON(&JSONOptions{ Type: "object", Fields: []Field{ {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "address", Function: "address"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, Indent: true, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: { "first_name": "Sonny", "last_name": "Stiedemann", "address": { "address": "52759 Stationside, San Diego, Oregon 99344", "street": "52759 Stationside", "city": "San Diego", "state": "Oregon", "zip": "99344", "country": "Saint Pierre and Miquelon", "latitude": -30.009814, "longitude": 154.519771 }, "password": "l4338TebFL55" }
func (*Faker) Job ¶
Job will generate a struct with random job information
Example ¶
f := New(11) jobInfo := f.Job() fmt.Println(jobInfo.Company) fmt.Println(jobInfo.Title) fmt.Println(jobInfo.Descriptor) fmt.Println(jobInfo.Level)
Output: TransparaGov Specialist Direct Configuration
func (*Faker) JobDescriptor ¶
JobDescriptor will generate a random job descriptor string
Example ¶
f := New(11) fmt.Println(f.JobDescriptor())
Output: Product
func (*Faker) JobLevel ¶
JobLevel will generate a random job level string
Example ¶
f := New(11) fmt.Println(f.JobLevel())
Output: Solutions
func (*Faker) JobTitle ¶
JobTitle will generate a random job title string
Example ¶
f := New(11) fmt.Println(f.JobTitle())
Output: Strategist
func (*Faker) Language ¶
Language will return a random language
Example ¶
f := New(11) fmt.Println(f.Language())
Output: Turkish
func (*Faker) LanguageAbbreviation ¶
LanguageAbbreviation will return a random language abbreviation
Example ¶
f := New(11) fmt.Println(f.LanguageAbbreviation())
Output: tr
func (*Faker) LanguageBCP ¶
LanguageBCP will return a random language BCP (Best Current Practices)
Example ¶
f := New(11) fmt.Println(f.LanguageBCP())
Output: tr-TR
func (*Faker) LastName ¶
LastName will generate a random last name
Example ¶
f := New(11) fmt.Println(f.LastName())
Output: Treutel
func (*Faker) Latitude ¶
Latitude will generate a random latitude float64
Example ¶
f := New(11) fmt.Println(f.Latitude())
Output: 48.654167
func (*Faker) LatitudeInRange ¶
LatitudeInRange will generate a random latitude within the input range
Example ¶
f := New(11) lat, _ := f.LatitudeInRange(21, 42) fmt.Println(lat)
Output: 37.176319
func (*Faker) Letter ¶
Letter will generate a single random lower case ASCII letter
Example ¶
f := New(11) fmt.Println(f.Letter())
Output: u
func (*Faker) LetterN ¶
LetterN will generate a random ASCII string with length N. Note that this function returns a string with a length of 1 when 0 is passed.
Example ¶
f := New(11) fmt.Println(f.LetterN(10))
Output: usKKbMlbxq
func (*Faker) Lexify ¶
Lexify will replace ? with random generated letters
Example ¶
f := New(11) fmt.Println(f.Lexify("?????"))
Output: usKKb
func (*Faker) LogLevel ¶
LogLevel will generate a random log level See data/LogLevels for list of available levels
Example ¶
f := New(11) fmt.Println(f.LogLevel("")) // This will also use general fmt.Println(f.LogLevel("syslog")) fmt.Println(f.LogLevel("apache"))
Output: debug crit alert
func (*Faker) Longitude ¶
Longitude will generate a random longitude float64
Example ¶
f := New(11) fmt.Println(f.Longitude())
Output: 97.308335
func (*Faker) LongitudeInRange ¶
LongitudeInRange will generate a random longitude within the input range
Example ¶
f := New(11) long, _ := f.LongitudeInRange(-10, 10) fmt.Println(long)
Output: 5.406018
func (*Faker) LoremIpsumParagraph ¶
func (f *Faker) LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
LoremIpsumParagraph will generate a random paragraphGenerator
Example ¶
f := New(11) fmt.Println(f.LoremIpsumParagraph(3, 5, 12, "\n"))
Output: Eveniet vero velit velit non incidunt est sed tenetur consequatur ut architecto. Quod non non et voluptas et esse quisquam ullam placeat molestiae laboriosam. Consequatur in perferendis molestiae quam voluptatem eaque quia facilis quo hic dignissimos. Architecto ut tenetur aut qui et optio id sint quae rerum labore. Quae deserunt quia mollitia id accusantium itaque nisi aut omnis occaecati repellendus. Ad sunt neque placeat et qui saepe voluptatem blanditiis voluptatum possimus saepe. Velit distinctio quia quas cupiditate sequi dolorum delectus quia quo corrupti labore. Aut mollitia et aut eligendi blanditiis corrupti aut rem voluptatibus veritatis ut. Et ab voluptas delectus repellat eligendi qui eos blanditiis et et eos. Qui ipsum aut ut voluptate nulla officia qui earum repudiandae quidem officia. Fugit esse beatae placeat nihil libero et sunt voluptas velit maiores voluptatem. Reiciendis quia dolor amet blanditiis labore eligendi fugit reiciendis modi est incidunt. Ut ut rerum odit sit voluptatem ipsam consequatur est incidunt aut quis. Non dolorem voluptatum pariatur esse eos blanditiis rem eos commodi accusamus occaecati. Qui voluptatem eos et tempora et id at voluptas suscipit magni cupiditate.
func (*Faker) LoremIpsumSentence ¶
LoremIpsumSentence will generate a random sentence
Example ¶
f := New(11) fmt.Println(f.LoremIpsumSentence(5))
Output: Eveniet vero velit velit non.
func (*Faker) LoremIpsumWord ¶
LoremIpsumWord will generate a random word
Example ¶
f := New(11) fmt.Println(f.LoremIpsumWord())
Output: eveniet
func (*Faker) Lunch ¶
Lunch will return a random lunch name
Example ¶
f := New(11) fmt.Println(f.Lunch())
Output: Quick chile relleno casserole
func (*Faker) MacAddress ¶
MacAddress will generate a random mac address
Example ¶
f := New(11) fmt.Println(f.MacAddress())
Output: e4:da:32:33:86:3b
func (*Faker) Map ¶
Map will generate a random set of map data
Example ¶
f := New(11) fmt.Println(f.Map())
Output: map[a:map[that:could] above:[sometimes vast whom us scarcely these huh] am:map[how:9310653] depend:map[hey:5402877] out:381794.78 since:916659.94 these:map[frequently:2314010]]
func (*Faker) Markdown ¶
func (f *Faker) Markdown(co *MarkdownOptions) (string, error)
Markdown will return a single random Markdown template document
Example ¶
f := New(11) value, err := f.Markdown(&MarkdownOptions{}) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: # TurkeyThinker *Author: Tomasa Waters* Cut lastly that someone additionally ambulance could. A tennis occur why depend heels out. Can fire anyone sometimes that leap whom. Troop now scarcely since dance huh somebody. Constantly Italian outfit certain weekly murder who. Cackle because her break write nobody could. According whoa bevy we them summation to. Oxygen Greek how previously a what answer. Handle daily ouch upon encourage that after. His every she wearily still he herself. ## Table of Contents - [Installation](#installation) - [Usage](#usage) - [License](#license) ## Installation '''bash pip install TurkeyThinker ''' ## Usage '''python result = turkeythinker.handle("whimsical story") print("turkeythinker result:", "terminated") ''' ## License MIT
func (*Faker) MiddleName ¶
MiddleName will generate a random middle name
Example ¶
f := New(11) fmt.Println(f.MiddleName())
Output: Star
func (*Faker) MinecraftAnimal ¶
MinecraftAnimal will generate a random Minecraft animal
Example ¶
f := New(11) fmt.Println(f.MinecraftAnimal())
Output: wolf
func (*Faker) MinecraftArmorPart ¶
MinecraftArmorPart will generate a random Minecraft armor part
Example ¶
f := New(11) fmt.Println(f.MinecraftArmorPart())
Output: helmet
func (*Faker) MinecraftArmorTier ¶
MinecraftArmorTier will generate a random Minecraft armor tier
Example ¶
f := New(11) fmt.Println(f.MinecraftArmorTier())
Output: netherite
func (*Faker) MinecraftBiome ¶
MinecraftBiome will generate a random Minecraft biome
Example ¶
f := New(11) fmt.Println(f.MinecraftBiome())
Output: the nether
func (*Faker) MinecraftDye ¶
MinecraftDye will generate a random Minecraft dye
Example ¶
f := New(11) fmt.Println(f.MinecraftDye())
Output: yellow
func (*Faker) MinecraftFood ¶
MinecraftFood will generate a random Minecraft food
Example ¶
f := New(11) fmt.Println(f.MinecraftFood())
Output: steak
func (*Faker) MinecraftMobBoss ¶
MinecraftMobBoss will generate a random Minecraft mob boss
Example ¶
f := New(11) fmt.Println(f.MinecraftMobBoss())
Output: ender dragon
func (*Faker) MinecraftMobHostile ¶
MinecraftMobHostile will generate a random Minecraft mob hostile
Example ¶
f := New(11) fmt.Println(f.MinecraftMobHostile())
Output: wither skeleton
func (*Faker) MinecraftMobNeutral ¶
MinecraftMobNeutral will generate a random Minecraft mob neutral
Example ¶
f := New(11) fmt.Println(f.MinecraftMobNeutral())
Output: wolf
func (*Faker) MinecraftMobPassive ¶
MinecraftMobPassive will generate a random Minecraft mob passive
Example ¶
f := New(11) fmt.Println(f.MinecraftMobPassive())
Output: turtle
func (*Faker) MinecraftOre ¶
MinecraftOre will generate a random Minecraft ore
Example ¶
f := New(11) fmt.Println(f.MinecraftOre())
Output: redstone
func (*Faker) MinecraftTool ¶
MinecraftTool will generate a random Minecraft tool
Example ¶
f := New(11) fmt.Println(f.MinecraftTool())
Output: fishing rod
func (*Faker) MinecraftVillagerJob ¶
MinecraftVillagerJob will generate a random Minecraft villager job
Example ¶
f := New(11) fmt.Println(f.MinecraftVillagerJob())
Output: toolsmith
func (*Faker) MinecraftVillagerLevel ¶
MinecraftVillagerLevel will generate a random Minecraft villager level
Example ¶
f := New(11) fmt.Println(f.MinecraftVillagerLevel())
Output: master
func (*Faker) MinecraftVillagerStation ¶
MinecraftVillagerStation will generate a random Minecraft villager station
Example ¶
f := New(11) fmt.Println(f.MinecraftVillagerStation())
Output: stonecutter
func (*Faker) MinecraftWeapon ¶
MinecraftWeapon will generate a random Minecraft weapon
Example ¶
f := New(11) fmt.Println(f.MinecraftWeapon())
Output: shield
func (*Faker) MinecraftWeather ¶
MinecraftWeather will generate a random Minecraft weather
Example ¶
f := New(11) fmt.Println(f.MinecraftWeather())
Output: thunder
func (*Faker) MinecraftWood ¶
MinecraftWood will generate a random Minecraft wood
Example ¶
f := New(11) fmt.Println(f.MinecraftWood())
Output: dark oak
func (*Faker) Minute ¶
Minute will generate a random minute
Example ¶
f := New(11) fmt.Println(f.Minute())
Output: 53
func (*Faker) Month ¶
Month will generate a random month int
Example ¶
f := New(11) fmt.Println(f.Month())
Output: 11
func (*Faker) MonthString ¶
MonthString will generate a random month string
Example ¶
f := New(11) fmt.Println(f.MonthString())
Output: November
func (*Faker) Movie ¶
Example ¶
f := New(11) movie := f.Movie() fmt.Println(movie.Name) fmt.Println(movie.Genre)
Output: The Terminator Sport
func (*Faker) MovieGenre ¶
Example ¶
f := New(11) fmt.Println(f.MovieGenre())
Output: Thriller
func (*Faker) Name ¶
Name will generate a random First and Last Name
Example ¶
f := New(11) fmt.Println(f.Name())
Output: Sonny Stiedemann
func (*Faker) NamePrefix ¶
NamePrefix will generate a random name prefix
Example ¶
f := New(11) fmt.Println(f.NamePrefix())
Output: Dr.
func (*Faker) NameSuffix ¶
NameSuffix will generate a random name suffix
Example ¶
f := New(11) fmt.Println(f.NameSuffix())
Output: PhD
func (*Faker) NanoSecond ¶
NanoSecond will generate a random nano second
Example ¶
f := New(11) fmt.Println(f.NanoSecond())
Output: 895883936
func (*Faker) NiceColors ¶
NiceColor will generate a random safe color string
Example ¶
f := New(11) fmt.Println(f.NiceColors())
Output: [#fffbb7 #a6f6af #66b6ab #5b7c8d #4f2958]
func (*Faker) Noun ¶
Noun will generate a random noun
Example ¶
f := New(11) fmt.Println(f.Noun())
Output: nest
func (*Faker) NounAbstract ¶
NounAbstract will generate a random abstract noun
Example ¶
f := New(11) fmt.Println(f.NounAbstract())
Output: speed
func (*Faker) NounCollectiveAnimal ¶
NounCollectiveAnimal will generate a random collective noun animal
Example ¶
f := New(11) fmt.Println(f.NounCollectiveAnimal())
Output: leap
func (*Faker) NounCollectivePeople ¶
NounCollectivePeople will generate a random collective noun person
Example ¶
f := New(11) fmt.Println(f.NounCollectivePeople())
Output: posse
func (*Faker) NounCollectiveThing ¶
NounCollectiveThing will generate a random collective noun thing
Example ¶
f := New(11) fmt.Println(f.NounCollectiveThing())
Output: hail
func (*Faker) NounCommon ¶
NounCommon will generate a random common noun
Example ¶
f := New(11) fmt.Println(f.NounCommon())
Output: group
func (*Faker) NounConcrete ¶
NounConcrete will generate a random concrete noun
Example ¶
f := New(11) fmt.Println(f.NounConcrete())
Output: theater
func (*Faker) NounCountable ¶
NounCountable will generate a random countable noun
Example ¶
f := New(11) fmt.Println(f.NounCountable())
Output: smile
func (*Faker) NounDeterminer ¶
NounDeterminer will generate a random noun determiner
Example ¶
f := New(11) fmt.Println(f.NounDeterminer())
Output: every
func (*Faker) NounProper ¶
NounProper will generate a random proper noun
Example ¶
f := New(11) fmt.Println(f.NounProper())
Output: Russ
func (*Faker) NounUncountable ¶
NounUncountable will generate a random uncountable noun
Example ¶
f := New(11) fmt.Println(f.NounUncountable())
Output: usage
func (*Faker) Number ¶
Number will generate a random number between given min and max
Example ¶
f := New(11) fmt.Println(f.Number(50, 23456))
Output: 21019
func (*Faker) Numerify ¶
Numerify will replace # with random numerical values
Example ¶
f := New(11) fmt.Println(f.Numerify("###-###-####"))
Output: 881-252-7598
func (*Faker) OperaUserAgent ¶
OperaUserAgent will generate a random opera browser user agent string
Example ¶
f := New(11) fmt.Println(f.OperaUserAgent())
Output: Opera/10.91 (X11; Linux i686; en-US) Presto/2.12.265 Version/11.00
func (*Faker) Paragraph ¶
func (f *Faker) Paragraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
Paragraph will generate a random paragraphGenerator
Example ¶
f := New(11) fmt.Println(f.Paragraph(3, 5, 12, "\n"))
Output: Bathe regularly quiver these sprint fight something am elsewhere since previously was. That there a tennis occur why depend heels out can fire anyone. Sometimes that leap whom troop now scarcely since dance huh somebody constantly. Italian outfit certain weekly murder who cackle because her break write nobody. Could according whoa bevy we them summation to oxygen Greek how previously. A what answer handle daily ouch upon encourage that after his every. She wearily still he herself huge failure for yay sparse thoughtfully box. Anyway Jungian regularly world great daily recently whose Elizabethan outside to theirs. Block while French closely sit you to out fight bored yours those. Bale Parisian host which so today Ecuadorian hourly decidedly his everybody this. Play this little them on recently eager usually bunch daily whose somebody. Them few tonight dishonesty spell battery less patience whose inside hair your. Answer hand tonight these she team which today Einsteinian country yesterday for. Phew for now your him hourly infrequently lots drink absolutely when east. Conclude little annually hers nobody since troop it it whoever the park.
func (*Faker) Password ¶
func (f *Faker) Password(lower bool, upper bool, numeric bool, special bool, space bool, num int) string
Password will generate a random password. Minimum number length of 5 if less than.
Example ¶
f := New(11) fmt.Println(f.Password(true, false, false, false, false, 32)) fmt.Println(f.Password(false, true, false, false, false, 32)) fmt.Println(f.Password(false, false, true, false, false, 32)) fmt.Println(f.Password(false, false, false, true, false, 32)) fmt.Println(f.Password(true, true, true, true, true, 32)) fmt.Println(f.Password(true, true, true, true, true, 4))
Output: cfelntbponnbbzrhswobuwlxajeeclrx KYEKNGUUNKUYSFBUFFTGDKUVCVYKPONP 43622637275953627791234759581343 @.__-._-!-!_..!-_*_*__-@*.__.__! -DTHJ@.oF@d@L5F65 N-.@U5xWX F0DI foZnB
func (*Faker) PastDate ¶
PastDate will generate a random past time.Time struct
Example ¶
f := New(11) fmt.Println(f.PastDate())
Output:
func (*Faker) Person ¶
func (f *Faker) Person() *PersonInfo
Person will generate a struct with person information
Example ¶
f := New(11) person := f.Person() job := person.Job address := person.Address contact := person.Contact creditCard := person.CreditCard fmt.Println(person.FirstName) fmt.Println(person.LastName) fmt.Println(person.Gender) fmt.Println(person.SSN) fmt.Println(person.Hobby) fmt.Println(job.Company) fmt.Println(job.Title) fmt.Println(job.Descriptor) fmt.Println(job.Level) fmt.Println(address.Address) fmt.Println(address.Street) fmt.Println(address.City) fmt.Println(address.State) fmt.Println(address.Zip) fmt.Println(address.Country) fmt.Println(address.Latitude) fmt.Println(address.Longitude) fmt.Println(contact.Phone) fmt.Println(contact.Email) fmt.Println(creditCard.Type) fmt.Println(creditCard.Number) fmt.Println(creditCard.Exp) fmt.Println(creditCard.Cvv)
Output: Sonny Stiedemann male 280254464 Sailing DataLogix Planner Human Usability 679 Underpassborough, Omaha, Massachusetts 37930 679 Underpassborough Omaha Massachusetts 37930 North Macedonia -0.877085 83.264578 4102689405 verdabrakus@mayert.name American Express 562570938760 04/25 906
func (*Faker) PetName ¶
PetName will return a random fun pet name
Example ¶
f := New(11) fmt.Println(f.PetName())
Output: The Notorious D.O.G.
func (*Faker) Phone ¶
Phone will generate a random phone number string
Example ¶
f := New(11) fmt.Println(f.Phone())
Output: 8812527598
func (*Faker) PhoneFormatted ¶
PhoneFormatted will generate a random phone number string
Example ¶
f := New(11) fmt.Println(f.PhoneFormatted())
Output: 812-527-5989
func (*Faker) Phrase ¶
Phrase will return a random phrase
Example ¶
f := New(11) fmt.Println(f.Phrase())
Output: how many siblings do you have
func (*Faker) PhraseAdverb ¶
PhraseAdverb will return a random adverb phrase
Example ¶
f := New(11) fmt.Println(f.PhraseAdverb())
Output: successfully
func (*Faker) PhraseNoun ¶
PhraseNoun will return a random noun phrase
Example ¶
f := New(11) fmt.Println(f.PhraseNoun())
Output: a fear
func (*Faker) PhrasePreposition ¶
PhrasePreposition will return a random preposition phrase
Example ¶
f := New(11) fmt.Println(f.PhrasePreposition())
Output: with an archipelago
func (*Faker) PhraseVerb ¶
PhraseVerb will return a random preposition phrase
Example ¶
f := New(11) fmt.Println(f.PhraseVerb())
Output: bathe the jittery trip totally brightly under a troubling part scarcely unexpectedly
func (*Faker) Preposition ¶
Preposition will generate a random preposition
Example ¶
f := New(11) fmt.Println(f.Preposition())
Output: instead of
func (*Faker) PrepositionCompound ¶
PrepositionCompound will generate a random compound preposition
Example ¶
f := New(11) fmt.Println(f.PrepositionCompound())
Output: other than
func (*Faker) PrepositionDouble ¶
PrepositionDouble will generate a random double preposition
Example ¶
f := New(11) fmt.Println(f.PrepositionDouble())
Output: next to
func (*Faker) PrepositionSimple ¶
PrepositionSimple will generate a random simple preposition
Example ¶
f := New(11) fmt.Println(f.PrepositionSimple())
Output: with
func (*Faker) Price ¶
Price will take in a min and max value and return a formatted price
Example ¶
f := New(11) fmt.Printf("%.2f", f.Price(0.8618, 1000))
Output: 770.49
func (*Faker) Product ¶
func (f *Faker) Product() *ProductInfo
Product will generate a random set of product information
Example ¶
f := New(11) product := f.Product() fmt.Println(product.Name) fmt.Println(product.Description) fmt.Println(product.Categories) fmt.Println(product.Price) fmt.Println(product.Features) fmt.Println(product.Color) fmt.Println(product.Material) fmt.Println(product.UPC) fmt.Println(product.Audience) fmt.Println(product.Dimension) fmt.Println(product.UseCase) fmt.Println(product.Benefit) fmt.Println(product.Suffix)
Output: Wave Precision Lamp This upset product is crafted from wood and includes wireless, making it perfect for personal grooming and delivering comfort for travelers and professionals. [cosmetics outdoor gear] 73.93 [touchscreen ultra-lightweight gps-enabled biometric] maroon silver 041026894059 [gamers musicians] heavy learning efficiency dash
func (*Faker) ProductAudience ¶ added in v7.1.0
ProductAudience will generate a random target audience
Example ¶
f := New(11) fmt.Println(f.ProductAudience())
Output: [DIY enthusiasts students]
func (*Faker) ProductBenefit ¶ added in v7.1.0
ProductBenefit will generate a random product benefit
Example ¶
f := New(11) fmt.Println(f.ProductBenefit())
Output: minimal maintenance
func (*Faker) ProductCategory ¶
ProductCategory will generate a random product category
Example ¶
f := New(11) fmt.Println(f.ProductCategory())
Output: pet food
func (*Faker) ProductDescription ¶
ProductDescription will generate a random product description
Example ¶
f := New(11) fmt.Println(f.ProductDescription())
Output: This product, ideal for seniors and families, features puzzled gold and incorporates gps-enabled to ensure robust construction during remote work.
func (*Faker) ProductDimension ¶ added in v7.1.0
ProductDimension will generate a random product dimension
Example ¶
f := New(11) fmt.Println(f.ProductDimension())
Output: standard
func (*Faker) ProductFeature ¶
ProductFeature will generate a random product feature
Example ¶
f := New(11) fmt.Println(f.ProductFeature())
Output: fast-charging
func (*Faker) ProductMaterial ¶
ProductMaterial will generate a random product material
Example ¶
f := New(11) fmt.Println(f.ProductMaterial())
Output: quartz
func (*Faker) ProductName ¶
ProductName will generate a random product name
Example ¶
f := New(11) fmt.Println(f.ProductName())
Output: Green Glass Hair Dryer
func (*Faker) ProductSuffix ¶ added in v7.1.0
ProductSuffix will generate a random product suffix
Example ¶
f := New(11) fmt.Println(f.ProductSuffix())
Output: turbo
func (*Faker) ProductUPC ¶
ProductUPC will generate a random product UPC
Example ¶
f := New(11) fmt.Println(f.ProductUPC())
Output: 088125275989
func (*Faker) ProductUseCase ¶ added in v7.1.0
ProductUseCase will generate a random product use case
Example ¶
f := New(11) fmt.Println(f.ProductUseCase())
Output: remote work
func (*Faker) ProgrammingLanguage ¶
ProgrammingLanguage will return a random programming language
Example ¶
f := New(11) fmt.Println(f.ProgrammingLanguage())
Output: TELCOMP
func (*Faker) Pronoun ¶
Pronoun will generate a random pronoun
Example ¶
f := New(11) fmt.Println(f.Pronoun())
Output: some
func (*Faker) PronounDemonstrative ¶
PronounDemonstrative will generate a random demonstrative pronoun
Example ¶
f := New(11) fmt.Println(f.PronounDemonstrative())
Output: this
func (*Faker) PronounIndefinite ¶
PronounIndefinite will generate a random indefinite pronoun
Example ¶
f := New(11) fmt.Println(f.PronounIndefinite())
Output: somebody
func (*Faker) PronounInterrogative ¶
PronounInterrogative will generate a random interrogative pronoun
Example ¶
f := New(11) fmt.Println(f.PronounInterrogative())
Output: how
func (*Faker) PronounObject ¶
PronounObject will generate a random object pronoun
Example ¶
f := New(11) fmt.Println(f.PronounObject())
Output: them
func (*Faker) PronounPersonal ¶
PronounPersonal will generate a random personal pronoun
Example ¶
f := New(11) fmt.Println(f.PronounPersonal())
Output: they
func (*Faker) PronounPossessive ¶
PronounPossessive will generate a random possessive pronoun
Example ¶
f := New(11) fmt.Println(f.PronounPossessive())
Output: theirs
func (*Faker) PronounReflective ¶
PronounReflective will generate a random reflective pronoun
Example ¶
f := New(11) fmt.Println(f.PronounReflective())
Output: itself
func (*Faker) PronounRelative ¶
PronounRelative will generate a random relative pronoun
Example ¶
f := New(11) fmt.Println(f.PronounRelative())
Output: whomever
func (*Faker) Question ¶
Question will return a random question
Example ¶
f := New(11) fmt.Println(f.Question())
Output: Everyday you probably haven't heard of them you probably haven't heard of them portland austin tattooed retro?
func (*Faker) Quote ¶
Quote will return a random quote from a random person
Example ¶
f := New(11) fmt.Println(f.Quote())
Output: "Everyday you probably haven't heard of them you probably haven't heard of them portland austin tattooed retro." - Vance Schroeder
func (*Faker) RGBColor ¶
RGBColor will generate a random int slice color
Example ¶
f := New(11) fmt.Println(f.RGBColor())
Output: [180 18 181]
func (*Faker) RandomInt ¶
RandomInt will take in a slice of int and return a randomly selected value
Example ¶
f := New(11) ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657} fmt.Println(f.RandomInt(ints))
Output: 8413
func (*Faker) RandomMapKey ¶
RandomMapKey will return a random key from a map
func (*Faker) RandomString ¶
RandomString will take in a slice of string and return a randomly selected value
Example ¶
f := New(11) fmt.Println(f.RandomString([]string{"hello", "world"}))
Output: hello
func (*Faker) RandomUint ¶
RandomUint will take in a slice of uint and return a randomly selected value
Example ¶
f := New(11) ints := []uint{52, 854, 941, 74125, 8413, 777, 89416, 841657} fmt.Println(f.RandomUint(ints))
Output: 8413
func (*Faker) Regex ¶
Regex will generate a string based upon a RE2 syntax
Example ¶
f := New(11) fmt.Println(f.Regex("[abcdef]{5}")) fmt.Println(f.Regex("[[:upper:]]{5}")) fmt.Println(f.Regex("(hello|world|whats|up)")) fmt.Println(f.Regex(`^[a-z]{5,10}@[a-z]{5,10}\.(com|net|org)$`))
Output: ffbbd GSNYV up tyyxi@kshtyia.net
func (*Faker) SQL ¶
func (f *Faker) SQL(so *SQLOptions) (string, error)
Example ¶
f := New(11) res, _ := f.SQL(&SQLOptions{ Table: "people", Count: 2, Fields: []Field{ {Name: "id", Function: "autoincrement"}, {Name: "first_name", Function: "firstname"}, {Name: "price", Function: "price"}, {Name: "age", Function: "number", Params: MapParams{"min": {"1"}, "max": {"99"}}}, {Name: "created_at", Function: "date", Params: MapParams{"format": {"2006-01-02 15:04:05"}}}, }, }) fmt.Println(string(res))
Output: INSERT INTO people (id, first_name, price, age, created_at) VALUES (1, 'Sonny', 985.96, 20, '1925-07-08 17:32:57'),(2, 'Steve', 639.32, 74, '2016-12-29 07:25:24');
func (*Faker) SSN ¶
SSN will generate a random Social Security Number
Example ¶
f := New(11) fmt.Println(f.SSN())
Output: 906295542
func (*Faker) SafariUserAgent ¶
SafariUserAgent will generate a random safari browser user agent string
Example ¶
f := New(11) fmt.Println(f.SafariUserAgent())
Output: Mozilla/5.0 (Windows; U; Windows NT 6.0) AppleWebKit/536.44.6 (KHTML, like Gecko) Version/4.1 Safari/536.44.6
func (*Faker) SafeColor ¶
SafeColor will generate a random safe color string
Example ¶
f := New(11) fmt.Println(f.SafeColor())
Output: aqua
func (*Faker) School ¶
Example ¶
f := New(11) fmt.Println(f.School())
Output: Hillside Private Academy
func (*Faker) Second ¶
Second will generate a random second
Example ¶
f := New(11) fmt.Println(f.Second())
Output: 53
func (*Faker) Sentence ¶
Sentence will generate a random sentence
Example ¶
f := New(11) fmt.Println(f.Sentence(5))
Output: Bathe regularly quiver these sprint.
func (*Faker) SentenceSimple ¶
SentenceSimple will generate a random simple sentence
Example ¶
f := New(11) fmt.Println(f.SentenceSimple())
Output: A fear selfishly cook a tough doctor hardly innocently to realistic project utterly ingeniously.
func (*Faker) ShuffleAnySlice ¶
ShuffleAnySlice takes in a slice and outputs it in a random order
Example ¶
f := New(11) strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"} f.ShuffleAnySlice(strings) fmt.Println(strings) ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657} f.ShuffleAnySlice(ints) fmt.Println(ints)
Output: [for day happy everyone good times a have] [854 52 74125 941 777 8413 841657 89416]
func (*Faker) ShuffleInts ¶
ShuffleInts will randomize a slice of ints
Example ¶
f := New(11) ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657} f.ShuffleInts(ints) fmt.Println(ints)
Output: [941 777 8413 74125 854 89416 841657 52]
func (*Faker) ShuffleStrings ¶
ShuffleStrings will randomize a slice of strings
Example ¶
f := New(11) strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"} f.ShuffleStrings(strings) fmt.Println(strings)
Output: [for day happy everyone good times a have]
func (*Faker) Slice ¶
Slice fills built-in types and exported fields of a struct with random data.
Example ¶
f := New(11) var S []string f.Slice(&S) I := make([]int8, 3) f.Slice(&I) fmt.Println(S) fmt.Println(I)
Output: [KKbMlbxqu mwwv WVlPmw AeAwVH Khrx DcxFeWk vChMCeKf BwRtnboOE mWluN] [102 -7 -125]
Example (Struct) ¶
f := New(11) type Basic struct { S string `fake:"{firstname}"` I int F float32 } var B []Basic f.Slice(&B) fmt.Println(B)
Output: [{Russ 3680786209731553973 0.27238095} {Julius 4268594234476337060 0.0051180124} {Kaitlyn 8337306475187377941 0.118576884} {Steve 1365845625386394310 0.27625358} {Tomasa 7952567920265354269 0.648698} {Ernest 7933890822314871011 0.37052673} {Missouri 5542429450337529393 0.36615264} {Tiana 6292602578870227868 0.9382272} {Koby 229639691709918065 0.5914113}]
func (*Faker) Slogan ¶
Slogan will generate a random company slogan
Example ¶
f := New(11) fmt.Println(f.Slogan())
Output: local area network maximize Drive, mission-critical.
func (*Faker) Snack ¶
Snack will return a random snack name
Example ¶
f := New(11) fmt.Println(f.Snack())
Output: Fantastic banana bran muffins
func (*Faker) State ¶
State will generate a random state string
Example ¶
f := New(11) fmt.Println(f.State())
Output: Vermont
func (*Faker) StateAbr ¶
StateAbr will generate a random abbreviated state string
Example ¶
f := New(11) fmt.Println(f.StateAbr())
Output: WV
func (*Faker) Street ¶
Street will generate a random address street string
Example ¶
f := New(11) fmt.Println(f.Street())
Output: 125 East Routemouth
func (*Faker) StreetName ¶
StreetName will generate a random address street name string
Example ¶
f := New(11) fmt.Println(f.StreetName())
Output: Turnpike
func (*Faker) StreetNumber ¶
StreetNumber will generate a random address street number string
Example ¶
f := New(11) fmt.Println(f.StreetNumber())
Output: 812
func (*Faker) StreetPrefix ¶
StreetPrefix will generate a random address street prefix string
Example ¶
f := New(11) fmt.Println(f.StreetPrefix())
Output: Port
func (*Faker) StreetSuffix ¶
StreetSuffix will generate a random address street suffix string
Example ¶
f := New(11) fmt.Println(f.StreetSuffix())
Output: side
func (*Faker) Struct ¶
Struct fills in exported fields of a struct with random data based on the value of `fake` tag of exported fields. Use `fake:"skip"` to explicitly skip an element. All built-in types are supported, with templating support for string types.
Example ¶
fake := New(11) type Bar struct { Name string Number int Float float32 } type Foo struct { Str string Int int Pointer *int Name string `fake:"{firstname}"` Number string `fake:"{number:1,10}"` Skip *string `fake:"skip"` Array []string `fakesize:"2"` ArrayRange []string `fakesize:"2,6"` Map map[string]string `fakesize:"2"` MapRange map[string]string `fakesize:"2,4"` Bar Bar } var f Foo fake.Struct(&f) fmt.Printf("%s\n", f.Str) fmt.Printf("%d\n", f.Int) fmt.Printf("%d\n", *f.Pointer) fmt.Printf("%v\n", f.Name) fmt.Printf("%v\n", f.Number) fmt.Printf("%v\n", f.Skip) fmt.Printf("%v\n", f.Array) fmt.Printf("%v\n", f.Map) fmt.Printf("%v\n", f.MapRange) fmt.Printf("%+v\n", f.Bar)
Output: sKKbMlbxqu 1365845625386394310 4415419407664574903 Tomasa 10 <nil> [RWVlPmwRAe wVHB] map[gyJrZ:tfZAk oOEImWl:NXYnuKiGab] map[WigEnVzBy:JJXMkG aHqIpyVs:UxvheGVE pYyDuWC:yzjqsX] {Name:LfLRuhFRHQ Number:5737279083624806933 Float:0.59020466}
Example (Array) ¶
f := New(11) type Foo struct { Bar string Int int Name string `fake:"{firstname}"` Number string `fake:"{number:1,10}"` Skip *string `fake:"skip"` } type FooMany struct { Foos []Foo `fakesize:"1"` Names []string `fake:"{firstname}" fakesize:"3"` NamesRange []string `fake:"{firstname}" fakesize:"3,6"` } var fm FooMany f.Struct(&fm) fmt.Printf("%v\n", fm.Foos) fmt.Printf("%v\n", fm.Names) fmt.Printf("%v\n", fm.NamesRange)
Output: [{sKKbMlbxqu 1365845625386394310 Myrtis 10 <nil>}] [Tomasa Sunny Ernest] [Hassan Missouri Elisabeth Nedra Tiana Evan]
func (*Faker) Svg ¶
func (f *Faker) Svg(options *SVGOptions) string
Generate a random svg generator
Example ¶
f := New(11) fmt.Println(f.Svg(nil))
Output: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 459 443" width="459" height="443"><rect x="0" y="0" width="100%" height="100%" fill="#64908a" /><circle cx="334" cy="238" r="437" fill="#cc2a41" /><circle cx="34" cy="328" r="428" fill="#cc2a41" /><circle cx="151" cy="190" r="191" fill="#e8caa4" /><circle cx="343" cy="410" r="156" fill="#351330" /><circle cx="5" cy="410" r="192" fill="#351330" /><circle cx="94" cy="286" r="384" fill="#cc2a41" /><circle cx="34" cy="239" r="439" fill="#351330" /><circle cx="199" cy="310" r="278" fill="#cc2a41" /><circle cx="293" cy="106" r="20" fill="#64908a" /><circle cx="275" cy="327" r="11" fill="#cc2a41" /><circle cx="406" cy="338" r="239" fill="#e8caa4" /><circle cx="41" cy="71" r="344" fill="#64908a" /><circle cx="411" cy="116" r="208" fill="#64908a" /><circle cx="410" cy="88" r="303" fill="#351330" /><circle cx="241" cy="69" r="285" fill="#cc2a41" /></svg>
func (*Faker) Teams ¶
Teams takes in an array of people and team names and randomly places the people into teams as evenly as possible
Example ¶
f := New(11) fmt.Println(f.Teams( []string{"Billy", "Sharon", "Jeff", "Connor", "Steve", "Justin", "Fabian", "Robert"}, []string{"Team 1", "Team 2", "Team 3"}, ))
Output: map[Team 1:[Jeff Robert Billy] Team 2:[Connor Fabian Sharon] Team 3:[Justin Steve]]
func (*Faker) Template ¶
func (f *Faker) Template(template string, co *TemplateOptions) (string, error)
Template generates an document based on the the supplied template
Example ¶
f := New(11) template := `{{range IntRange 1 4}}{{FirstName}} {{LastName}}\n{{end}}` value, err := f.Template(template, &TemplateOptions{Data: 4}) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: Sonny Stiedemann Cody Donnelly Julius Farrell Mollie Legros
func (*Faker) TimeZone ¶
TimeZone will select a random timezone string
Example ¶
f := New(11) fmt.Println(f.TimeZone())
Output: West Pacific Standard Time
func (*Faker) TimeZoneAbv ¶
TimeZoneAbv will select a random timezone abbreviation string
Example ¶
f := New(11) fmt.Println(f.TimeZoneAbv())
Output: WPST
func (*Faker) TimeZoneFull ¶
TimeZoneFull will select a random full timezone string
Example ¶
f := New(11) fmt.Println(f.TimeZoneFull())
Output: (UTC+10:00) Guam, Port Moresby
func (*Faker) TimeZoneOffset ¶
TimeZoneOffset will select a random timezone offset
Example ¶
f := New(11) fmt.Println(f.TimeZoneOffset())
Output: 10
func (*Faker) TimeZoneRegion ¶
TimeZoneRegion will select a random region style timezone string, e.g. "America/Chicago"
Example ¶
f := New(11) fmt.Println(f.TimeZoneRegion())
Output: Indian/Chagos
func (*Faker) URL ¶
URL will generate a random url string
Example ¶
f := New(11) fmt.Println(f.URL())
Output: http://www.directinnovative.biz/infrastructures
func (*Faker) UUID ¶
UUID (version 4) will generate a random unique identifier based upon random numbers Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 8-4-4-4-12
Example ¶
f := New(11) fmt.Println(f.UUID())
Output: b412b5fb-33a4-498e-9503-21c6b7e01dcf
func (*Faker) Uint16 ¶
Uint16 will generate a random uint16 value
Example ¶
f := New(11) fmt.Println(f.Uint16())
Output: 56756
func (*Faker) Uint32 ¶
Uint32 will generate a random uint32 value
Example ¶
f := New(11) fmt.Println(f.Uint32())
Output: 3847792206
func (*Faker) Uint64 ¶
Uint64 will generate a random uint64 value This is the primary location in which the random number is generated. This will be the only location in which reading from Rand.Uint64() is lockable
Example ¶
f := New(11) fmt.Println(f.Uint64())
Output: 16526141687177076148
func (*Faker) Uint8 ¶
Uint8 will generate a random uint8 value
Example ¶
f := New(11) fmt.Println(f.Uint8())
Output: 180
func (*Faker) UintRange ¶
UintRange will generate a random uint value between min and max
Example ¶
f := New(11) fmt.Println(f.UintRange(1, 10))
Output: 9
func (*Faker) UserAgent ¶
UserAgent will generate a random broswer user agent
Example ¶
f := New(11) fmt.Println(f.UserAgent())
Output: Mozilla/5.0 (Windows 98) AppleWebKit/5360 (KHTML, like Gecko) Chrome/37.0.852.0 Mobile Safari/5360
func (*Faker) Username ¶
Username will generate a random username based upon picking a random lastname and random numbers at the end
Example ¶
f := New(11) fmt.Println(f.Username())
Output: Treutel8125
func (*Faker) Vegetable ¶
Vegetable will return a random vegetable name
Example ¶
f := New(11) fmt.Println(f.Vegetable())
Output: Sweet Potato
func (*Faker) Verb ¶
Verb will generate a random verb
Example ¶
f := New(11) fmt.Println(f.Verb())
Output: would
func (*Faker) VerbAction ¶
VerbAction will generate a random action verb
Example ¶
f := New(11) fmt.Println(f.VerbAction())
Output: paint
func (*Faker) VerbHelping ¶
VerbHelping will generate a random helping verb
Example ¶
f := New(11) fmt.Println(f.VerbHelping())
Output: am
func (*Faker) VerbIntransitive ¶
VerbIntransitive will generate a random intransitive verb
Example ¶
f := New(11) fmt.Println(f.VerbIntransitive())
Output: vomit
func (*Faker) VerbLinking ¶
VerbLinking will generate a random linking verb
Example ¶
f := New(11) fmt.Println(f.VerbLinking())
Output: must
func (*Faker) VerbTransitive ¶
VerbTransitive will generate a random transitive verb
Example ¶
f := New(11) fmt.Println(f.VerbTransitive())
Output: upgrade
func (*Faker) Vowel ¶
Vowel will generate a single random lower case vowel
Example ¶
f := New(11) fmt.Println(f.Vowel())
Output: a
func (*Faker) WeekDay ¶
WeekDay will generate a random weekday string (Monday-Sunday)
Example ¶
f := New(11) fmt.Println(f.WeekDay())
Output: Saturday
func (*Faker) Weighted ¶
Weighted will take in an array of options and weights and return a random selection based upon its indexed weight
func (*Faker) Word ¶
Word will generate a random word
Example ¶
f := New(11) fmt.Println(f.Word())
Output: bathe
func (*Faker) XML ¶
func (f *Faker) XML(xo *XMLOptions) ([]byte, error)
XML generates an object or an array of objects in json format A nil XMLOptions returns a randomly structured XML.
Example (Array) ¶
f := New(11) value, err := f.XML(&XMLOptions{ Type: "array", RootElement: "xml", RecordElement: "record", RowCount: 2, Indent: true, Fields: []Field{ {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: <xml> <record> <first_name>Sonny</first_name> <last_name>Stiedemann</last_name> <password>8nwf0o3sBXcR</password> </record> <record> <first_name>Verda</first_name> <last_name>Brakus</last_name> <password>3beWLpq75Lua</password> </record> </xml>
Example (Single) ¶
f := New(11) value, err := f.XML(&XMLOptions{ Type: "single", RootElement: "xml", RecordElement: "record", RowCount: 2, Indent: true, Fields: []Field{ {Name: "first_name", Function: "firstname"}, {Name: "last_name", Function: "lastname"}, {Name: "password", Function: "password", Params: MapParams{"special": {"false"}}}, }, }) if err != nil { fmt.Println(err) } fmt.Println(string(value))
Output: <xml> <first_name>Sonny</first_name> <last_name>Stiedemann</last_name> <password>8nwf0o3sBXcR</password> </xml>
type Field ¶
type Field struct { Name string `json:"name"` Function string `json:"function"` Params MapParams `json:"params"` }
Field is used for defining what name and function you to generate for file outuputs
type FixedWidthOptions ¶
type FixedWidthOptions struct { RowCount int `json:"row_count" xml:"row_count" fake:"{number:1,10}"` Fields []Field `json:"fields" xml:"fields" fake:"{fields}"` }
FixedWidthOptions defines values needed for csv generation
type Info ¶
type Info struct { Display string `json:"display"` Category string `json:"category"` Description string `json:"description"` Example string `json:"example"` Output string `json:"output"` ContentType string `json:"content_type"` Params []Param `json:"params"` Any any `json:"any"` Generate func(f *Faker, m *MapParams, info *Info) (any, error) `json:"-"` }
Info structures fields to better break down what each one generates
func GetRandomSimpleFunc ¶
func (*Info) GetFloat32 ¶
GetFloat32 will retrieve int field from data
func (*Info) GetFloat32Array ¶
GetFloat32Array will retrieve []float field from data
func (*Info) GetFloat64 ¶
GetFloat64 will retrieve int field from data
func (*Info) GetIntArray ¶
GetIntArray will retrieve []int field from data
func (*Info) GetStringArray ¶
GetStringArray will retrieve []string field from data
type JSONOptions ¶
type JSONOptions struct { Type string `json:"type" xml:"type" fake:"{randomstring:[array,object]}"` // array or object RowCount int `json:"row_count" xml:"row_count" fake:"{number:1,10}"` Indent bool `json:"indent" xml:"indent"` Fields []Field `json:"fields" xml:"fields" fake:"{fields}"` }
JSONOptions defines values needed for json generation
type JobInfo ¶
type JobInfo struct { Company string `json:"company" xml:"company"` Title string `json:"title" xml:"title"` Descriptor string `json:"descriptor" xml:"descriptor"` Level string `json:"level" xml:"level"` }
JobInfo is a struct of job information
type MapParams ¶
type MapParams map[string]MapParamsValue
MapParams is the values to pass into a lookup generate
type MapParamsValue ¶
type MapParamsValue []string
func (*MapParamsValue) UnmarshalJSON ¶
func (m *MapParamsValue) UnmarshalJSON(data []byte) error
UnmarshalJSON will unmarshal the json into the []string
type MarkdownOptions ¶
type MarkdownOptions struct { }
MarkdownOptions defines values needed for markdown document generation
type MovieInfo ¶
type Param ¶
type Param struct { Field string `json:"field"` Display string `json:"display"` Type string `json:"type"` Optional bool `json:"optional"` Default string `json:"default"` Options []string `json:"options"` Description string `json:"description"` }
Param is a breakdown of param requirements and type definition
type PersonInfo ¶
type PersonInfo struct { FirstName string `json:"first_name" xml:"first_name"` LastName string `json:"last_name" xml:"last_name"` Gender string `json:"gender" xml:"gender"` SSN string `json:"ssn" xml:"ssn"` Hobby string `json:"hobby" xml:"hobby"` Job *JobInfo `json:"job" xml:"job"` Address *AddressInfo `json:"address" xml:"address"` Contact *ContactInfo `json:"contact" xml:"contact"` CreditCard *CreditCardInfo `json:"credit_card" xml:"credit_card"` }
PersonInfo is a struct of person information
func Person ¶
func Person() *PersonInfo
Person will generate a struct with person information
Example ¶
Seed(11) person := Person() job := person.Job address := person.Address contact := person.Contact creditCard := person.CreditCard fmt.Println(person.FirstName) fmt.Println(person.LastName) fmt.Println(person.Gender) fmt.Println(person.SSN) fmt.Println(person.Hobby) fmt.Println(job.Company) fmt.Println(job.Title) fmt.Println(job.Descriptor) fmt.Println(job.Level) fmt.Println(address.Address) fmt.Println(address.Street) fmt.Println(address.City) fmt.Println(address.State) fmt.Println(address.Zip) fmt.Println(address.Country) fmt.Println(address.Latitude) fmt.Println(address.Longitude) fmt.Println(contact.Phone) fmt.Println(contact.Email) fmt.Println(creditCard.Type) fmt.Println(creditCard.Number) fmt.Println(creditCard.Exp) fmt.Println(creditCard.Cvv)
Output: Sonny Stiedemann male 280254464 Sailing DataLogix Planner Human Usability 679 Underpassborough, Omaha, Massachusetts 37930 679 Underpassborough Omaha Massachusetts 37930 North Macedonia -0.877085 83.264578 4102689405 verdabrakus@mayert.name American Express 562570938760 04/25 906
type ProductInfo ¶
type ProductInfo struct { Name string `json:"name" xml:"name"` Description string `json:"description" xml:"description"` Categories []string `json:"categories" xml:"categories"` Price float64 `json:"price" xml:"price"` Features []string `json:"features" xml:"features"` Color string `json:"color" xml:"color"` Material string `json:"material" xml:"material"` UPC string `json:"upc" xml:"upc"` Audience []string `json:"audience" xml:"audience"` Dimension string `json:"dimension" xml:"dimension"` UseCase string `json:"use_case" xml:"use_case"` Benefit string `json:"benefit" xml:"benefit"` Suffix string `json:"suffix" xml:"suffix"` }
func Product ¶
func Product() *ProductInfo
Product will generate a random set of product information
Example ¶
Seed(11) product := Product() fmt.Println(product.Name) fmt.Println(product.Description) fmt.Println(product.Categories) fmt.Println(product.Price) fmt.Println(product.Features) fmt.Println(product.Color) fmt.Println(product.Material) fmt.Println(product.UPC) fmt.Println(product.Audience) fmt.Println(product.Dimension) fmt.Println(product.UseCase) fmt.Println(product.Benefit) fmt.Println(product.Suffix)
Output: Wave Precision Lamp This upset product is crafted from wood and includes wireless, making it perfect for personal grooming and delivering comfort for travelers and professionals. [cosmetics outdoor gear] 73.93 [touchscreen ultra-lightweight gps-enabled biometric] maroon silver 041026894059 [gamers musicians] heavy learning efficiency dash
type SQLOptions ¶
type TemplateOptions ¶
type TemplateOptions struct { Funcs template.FuncMap `fake:"-"` Data any `json:"data" xml:"data" fake:"-"` }
TemplateOptions defines values needed for template document generation
type XMLOptions ¶
type XMLOptions struct { Type string `json:"type" xml:"type" fake:"{randomstring:[array,single]}"` // single or array RootElement string `json:"root_element" xml:"root_element"` RecordElement string `json:"record_element" xml:"record_element"` RowCount int `json:"row_count" xml:"row_count" fake:"{number:1,10}"` Indent bool `json:"indent" xml:"indent"` Fields []Field `json:"fields" xml:"fields" fake:"{fields}"` }
XMLOptions defines values needed for json generation
Source Files ¶
- address.go
- animal.go
- app.go
- auth.go
- beer.go
- book.go
- car.go
- celebrity.go
- color.go
- company.go
- csv.go
- doc.go
- emoji.go
- error.go
- fakeable.go
- faker.go
- file.go
- finance.go
- food.go
- game.go
- generate.go
- hacker.go
- helpers.go
- hipster.go
- html.go
- image.go
- internet.go
- json.go
- languages.go
- lookup.go
- lorem.go
- minecraft.go
- misc.go
- movie.go
- number.go
- payment.go
- person.go
- product.go
- school.go
- slice.go
- sql.go
- string.go
- struct.go
- template.go
- time.go
- weighted.go
- word_adjective.go
- word_adverb.go
- word_comment.go
- word_connective.go
- word_general.go
- word_grammar.go
- word_helper.go
- word_misc.go
- word_noun.go
- word_phrase.go
- word_preposition.go
- word_pronoun.go
- word_sentence.go
- word_verb.go
- xml.go