package gofakeit
import "github.com/brianvoe/gofakeit/v6"
Package gofakeit provides a set of functions that generate random data
Code:
Output: Code:
Output: Code:
Output: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: Markus Moen
// Email: alaynawuckert@kozey.biz
// Phone: 9948995369
// Address: 35300 South Roads haven, Miami, Tennessee 58302
// BS: streamline
// Beer Name: Pliny The Elder
// Color: Gray
// Company: Center for Responsive Politics
// Credit Card: 3821714800889989
// Hacker Phrase: Overriding the capacitor won't do anything, we need to compress the online SMTP protocol!
// Job Title: Supervisor
// Password: a8TyS<2l(pRLB4QU7V,O9nKUYcMD0(*g
}
Name: Markus Moen
Email: alaynawuckert@kozey.biz
Phone: 9948995369
Address: 35300 South Roads haven, Miami, Tennessee 58302
BS: streamline
Beer Name: Pliny The Elder
Color: Gray
Company: Center for Responsive Politics
Credit Card: 3821714800889989
Hacker Phrase: Overriding the capacitor won't do anything, we need to compress the online SMTP protocol!
Job Title: Supervisor
Password: a8TyS<2l(pRLB4QU7V,O9nKUYcMD0(*g
Example (Custom)¶
{
Seed(11)
AddFuncLookup("friendname", Info{
Category: "custom",
Description: "Random friend name",
Example: "bill",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, 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: bill
}
bill
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(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
word, err := info.GetString(m, "word")
if err != nil {
return nil, err
}
split := strings.Split(word, "")
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: loredlowlh
}
loredlowlh
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 BitcoinAddress() string
- func BitcoinPrivateKey() 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 Company() string
- func CompanySuffix() string
- func Connective() string
- func ConnectiveCasual() string
- func ConnectiveComparitive() 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 Date() time.Time
- func DateRange(start, end time.Time) time.Time
- func Day() int
- func Dessert() string
- func Digit() string
- func DigitN(n uint) string
- func Dinner() string
- func Dog() string
- func DomainName() string
- func DomainSuffix() string
- func Email() string
- func Emoji() string
- func EmojiAlias() string
- func EmojiCategory() string
- func EmojiDescription() string
- func EmojiTag() string
- func FarmAnimal() string
- func FileExtension() string
- func FileMimeType() string
- func FirefoxUserAgent() string
- func FirstName() string
- 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 Gamertag() string
- func Gender() string
- func Generate(dataVal string) string
- 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 HexUint128() string
- func HexUint16() string
- func HexUint256() string
- func HexUint32() string
- func HexUint64() string
- func HexUint8() 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 ImageURL(width int, height int) string
- func Int16() int16
- func Int32() int32
- func Int64() int64
- func Int8() int8
- func IntRange(min, max int) int
- 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]interface{}
- 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 Name() string
- func NamePrefix() string
- func NameSuffix() string
- func NanoSecond() int
- 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 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 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 ProgrammingLanguage() string
- func ProgrammingLanguageBest() 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 interface{}) interface{}
- func RandomString(a []string) string
- func RandomUint(u []uint) uint
- func Regex(regexStr string) string
- func RemoveFuncLookup(functionName string)
- func SSN() string
- func SafariUserAgent() string
- func SafeColor() string
- func Second() int
- func Seed(seed int64)
- func Sentence(wordCount int) string
- func SentenceSimple() string
- func SetGlobalFaker(faker *Faker)
- func ShuffleAnySlice(v interface{})
- func ShuffleInts(a []int)
- func ShuffleStrings(a []string)
- func Slice(v interface{})
- 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 interface{}) error
- func Teams(peopleArray []string, teamsArray []string) map[string][]string
- func TimeZone() string
- func TimeZoneAbv() string
- func TimeZoneFull() string
- func TimeZoneOffset() float32
- func TimeZoneRegion() string
- func URL() string
- func UUID() string
- func Uint16() uint16
- func Uint32() uint32
- func Uint64() uint64
- func Uint8() uint8
- 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 WeekDay() string
- func Weighted(options []interface{}, weights []float32) (interface{}, error)
- func Word() string
- func XML(xo *XMLOptions) ([]byte, error)
- func Year() int
- func Zip() string
- type AddressInfo
- type CSVOptions
- type CarInfo
- type ContactInfo
- type CreditCardInfo
- type CreditCardOptions
- type CurrencyInfo
- type Faker
- func New(seed int64) *Faker
- func NewCrypto() *Faker
- func NewCustom(source rand.Source64) *Faker
- func NewUnlocked(seed int64) *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) BitcoinAddress() string
- func (f *Faker) BitcoinPrivateKey() 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) Company() string
- func (f *Faker) CompanySuffix() string
- func (f *Faker) Connective() string
- func (f *Faker) ConnectiveCasual() string
- func (f *Faker) ConnectiveComparitive() 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) 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) 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) Email() string
- 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) 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) 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) Gamertag() string
- func (f *Faker) Gender() string
- func (f *Faker) Generate(dataVal string) string
- 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) HexUint128() string
- func (f *Faker) HexUint16() string
- func (f *Faker) HexUint256() string
- func (f *Faker) HexUint32() string
- func (f *Faker) HexUint64() string
- func (f *Faker) HexUint8() 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) ImageURL(width int, height int) string
- func (f *Faker) Int16() int16
- func (f *Faker) Int32() int32
- func (f *Faker) Int64() int64
- func (f *Faker) Int8() int8
- func (f *Faker) IntRange(min, max int) int
- 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]interface{}
- 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) Name() string
- func (f *Faker) NamePrefix() string
- func (f *Faker) NameSuffix() string
- func (f *Faker) NanoSecond() int
- 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) 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) 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) ProgrammingLanguage() string
- func (f *Faker) ProgrammingLanguageBest() 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 interface{}) interface{}
- func (f *Faker) RandomString(a []string) string
- func (f *Faker) RandomUint(u []uint) uint
- func (f *Faker) Regex(regexStr string) string
- func (f *Faker) SSN() string
- func (f *Faker) SafariUserAgent() string
- func (f *Faker) SafeColor() string
- func (f *Faker) Second() int
- func (f *Faker) Sentence(wordCount int) string
- func (f *Faker) SentenceSimple() string
- func (f *Faker) ShuffleAnySlice(v interface{})
- func (f *Faker) ShuffleInts(a []int)
- func (f *Faker) ShuffleStrings(a []string)
- func (f *Faker) Slice(v interface{})
- 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 interface{}) error
- func (f *Faker) Teams(peopleArray []string, teamsArray []string) map[string][]string
- 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) Uint16() uint16
- func (f *Faker) Uint32() uint32
- func (f *Faker) Uint64() uint64
- func (f *Faker) Uint8() uint8
- 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) WeekDay() string
- func (f *Faker) Weighted(options []interface{}, weights []float32) (interface{}, 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 Info
- func GetFuncLookup(functionName string) *Info
- 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) 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)
- type JSONOptions
- type JobInfo
- type MapParams
- func NewMapParams() *MapParams
- func (m *MapParams) Add(field string, value string)
- func (m *MapParams) Get(field string) []string
- func (m *MapParams) Size() int
- type MapParamsValue
- type Param
- type PersonInfo
- 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
- BitcoinAddress
- BitcoinPrivateKey
- Bool
- Breakfast
- BuzzWord
- CSV (Array)
- Car
- CarFuelType
- CarMaker
- CarModel
- CarTransmissionType
- CarType
- Cat
- CelebrityActor
- CelebrityBusiness
- CelebritySport
- ChromeUserAgent
- City
- Color
- Company
- CompanySuffix
- Connective
- ConnectiveCasual
- ConnectiveComparitive
- ConnectiveComplaint
- ConnectiveExamplify
- ConnectiveListing
- ConnectiveTime
- Contact
- Country
- CountryAbr
- CreditCard
- CreditCardCvv
- CreditCardExp
- CreditCardNumber
- CreditCardType
- Currency
- CurrencyLong
- CurrencyShort
- Date
- DateRange
- Day
- Dessert
- Digit
- DigitN
- Dinner
- Dog
- DomainName
- DomainSuffix
- Emoji
- EmojiAlias
- EmojiCategory
- EmojiDescription
- EmojiTag
- 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.BitcoinAddress
- Faker.BitcoinPrivateKey
- 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.Company
- Faker.CompanySuffix
- Faker.Connective
- Faker.ConnectiveCasual
- Faker.ConnectiveComparitive
- 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.Date
- Faker.DateRange
- Faker.Day
- Faker.Dessert
- Faker.Digit
- Faker.DigitN
- Faker.Dinner
- Faker.Dog
- Faker.DomainName
- Faker.DomainSuffix
- Faker.Email
- Faker.Emoji
- Faker.EmojiAlias
- Faker.EmojiCategory
- Faker.EmojiDescription
- Faker.EmojiTag
- Faker.FarmAnimal
- Faker.FileExtension
- Faker.FileMimeType
- Faker.FirefoxUserAgent
- Faker.FirstName
- Faker.FlipACoin
- Faker.Float32
- Faker.Float32Range
- Faker.Float64
- Faker.Float64Range
- Faker.Fruit
- 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.HexUint128
- Faker.HexUint16
- Faker.HexUint256
- Faker.HexUint32
- Faker.HexUint64
- Faker.HexUint8
- Faker.HipsterParagraph
- Faker.HipsterSentence
- Faker.HipsterWord
- Faker.Hobby
- Faker.Hour
- Faker.IPv4Address
- Faker.IPv6Address
- Faker.Image
- Faker.ImageJpeg
- Faker.ImagePng
- Faker.ImageURL
- Faker.Int16
- Faker.Int32
- Faker.Int64
- Faker.Int8
- Faker.IntRange
- 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.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.Name
- Faker.NamePrefix
- Faker.NameSuffix
- Faker.NanoSecond
- Faker.Noun
- Faker.NounAbstract
- Faker.NounCollectiveAnimal
- Faker.NounCollectivePeople
- Faker.NounCollectiveThing
- Faker.NounCommon
- Faker.NounConcrete
- Faker.NounCountable
- Faker.NounProper
- Faker.NounUncountable
- Faker.Number
- Faker.Numerify
- Faker.OperaUserAgent
- Faker.Paragraph
- Faker.Password
- 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.ProgrammingLanguage
- Faker.ProgrammingLanguageBest
- 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.SSN
- Faker.SafariUserAgent
- Faker.SafeColor
- Faker.Second
- Faker.Sentence
- Faker.SentenceSimple
- Faker.ShuffleAnySlice
- Faker.ShuffleInts
- Faker.ShuffleStrings
- Faker.Slice
- Faker.Slice (Struct)
- Faker.Snack
- Faker.State
- Faker.StateAbr
- Faker.Street
- Faker.StreetName
- Faker.StreetNumber
- Faker.StreetPrefix
- Faker.StreetSuffix
- Faker.Struct
- Faker.Struct (Array)
- Faker.Teams
- 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.WeekDay
- Faker.Word
- Faker.XML (Array)
- Faker.XML (Single)
- Faker.Year
- Faker.Zip
- FarmAnimal
- FileExtension
- FileMimeType
- FirefoxUserAgent
- FirstName
- FlipACoin
- Float32
- Float32Range
- Float64
- Float64Range
- Fruit
- Gamertag
- Gender
- Generate
- HTTPMethod
- HTTPStatusCode
- HTTPStatusCodeSimple
- HTTPVersion
- HackerAbbreviation
- HackerAdjective
- HackerNoun
- HackerPhrase
- HackerVerb
- HackeringVerb
- HexColor
- HexUint128
- HexUint16
- HexUint256
- HexUint32
- HexUint64
- HexUint8
- HipsterParagraph
- HipsterSentence
- HipsterWord
- Hobby
- Hour
- IPv4Address
- IPv6Address
- Image
- ImageJpeg
- ImagePng
- ImageURL
- Int16
- Int32
- Int64
- Int8
- IntRange
- JSON (Array)
- JSON (Object)
- Job
- JobDescriptor
- JobLevel
- JobTitle
- Language
- LanguageAbbreviation
- LanguageBCP
- LastName
- Latitude
- LatitudeInRange
- Letter
- LetterN
- Lexify
- LogLevel
- Longitude
- LongitudeInRange
- LoremIpsumParagraph
- LoremIpsumSentence
- LoremIpsumWord
- Lunch
- MacAddress
- Map
- MinecraftAnimal
- MinecraftArmorPart
- MinecraftArmorTier
- MinecraftBiome
- MinecraftDye
- MinecraftFood
- MinecraftMobBoss
- MinecraftMobHostile
- MinecraftMobNeutral
- MinecraftMobPassive
- MinecraftOre
- MinecraftTool
- MinecraftVillagerJob
- MinecraftVillagerLevel
- MinecraftVillagerStation
- MinecraftWeapon
- MinecraftWeather
- MinecraftWood
- Minute
- Month
- MonthString
- Name
- NamePrefix
- NameSuffix
- NanoSecond
- New
- NewCrypto
- NewCustom
- NewUnlocked
- Noun
- NounAbstract
- NounCollectiveAnimal
- NounCollectivePeople
- NounCollectiveThing
- NounCommon
- NounConcrete
- NounCountable
- NounProper
- NounUncountable
- Number
- Numerify
- OperaUserAgent
- Paragraph
- Password
- Person
- PetName
- Phone
- PhoneFormatted
- Phrase
- PhraseAdverb
- PhraseNoun
- PhrasePreposition
- PhraseVerb
- Preposition
- PrepositionCompound
- PrepositionDouble
- PrepositionSimple
- Price
- ProgrammingLanguage
- ProgrammingLanguageBest
- Pronoun
- PronounDemonstrative
- PronounIndefinite
- PronounInterrogative
- PronounObject
- PronounPersonal
- PronounPossessive
- PronounReflective
- PronounRelative
- Question
- Quote
- RGBColor
- RandomInt
- RandomString
- RandomUint
- Regex
- SSN
- SafariUserAgent
- SafeColor
- Second
- Sentence
- SentenceSimple
- SetGlobalFaker
- ShuffleAnySlice
- ShuffleInts
- ShuffleStrings
- Slice
- Slice (Struct)
- Snack
- State
- StateAbr
- Street
- StreetName
- StreetNumber
- StreetPrefix
- StreetSuffix
- Struct
- Struct (Array)
- Teams
- TimeZone
- TimeZoneAbv
- TimeZoneFull
- TimeZoneOffset
- TimeZoneRegion
- URL
- UUID
- Uint16
- Uint32
- Uint64
- Uint8
- UintRange
- UserAgent
- Username
- Vegetable
- Verb
- VerbAction
- VerbHelping
- VerbIntransitive
- VerbLinking
- VerbTransitive
- WeekDay
- Weighted
- Word
- XML (Array)
- XML (Single)
- Year
- Zip
Variables ¶
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
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AchAccount())
// Output: 413645994899
}
413645994899
func AchRouting ¶
func AchRouting() string
AchRouting will generate a 9 digit routing number
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AchRouting())
// Output: 713645994
}
713645994
func AddFuncLookup ¶
AddFuncLookup takes a field and adds it to map
func Adjective ¶
func Adjective() string
Adjective will generate a random adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Adjective())
// Output: Dutch
}
Dutch
func AdjectiveDemonstrative ¶
func AdjectiveDemonstrative() string
AdjectiveDemonstrative will generate a random demonstrative adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdjectiveDemonstrative())
// Output: this
}
this
func AdjectiveDescriptive ¶
func AdjectiveDescriptive() string
AdjectiveDescriptive will generate a random descriptive adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdjectiveDescriptive())
// Output: brave
}
brave
func AdjectiveIndefinite ¶
func AdjectiveIndefinite() string
AdjectiveIndefinite will generate a random indefinite adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdjectiveIndefinite())
// Output: few
}
few
func AdjectiveInterrogative ¶
func AdjectiveInterrogative() string
AdjectiveInterrogative will generate a random interrogative adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdjectiveInterrogative())
// Output: what
}
what
func AdjectivePossessive ¶
func AdjectivePossessive() string
AdjectivePossessive will generate a random possessive adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdjectivePossessive())
// Output: our
}
our
func AdjectiveProper ¶
func AdjectiveProper() string
AdjectiveProper will generate a random proper adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdjectiveProper())
// Output: Afghan
}
Afghan
func AdjectiveQuantitative ¶
func AdjectiveQuantitative() string
AdjectiveQuantitative will generate a random quantitative adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdjectiveQuantitative())
// Output: a little
}
a little
func Adverb ¶
func Adverb() string
Adverb will generate a random adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Adverb())
// Output: over
}
over
func AdverbDegree ¶
func AdverbDegree() string
AdverbDegree will generate a random degree adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdverbDegree())
// Output: intensely
}
intensely
func AdverbFrequencyDefinite ¶
func AdverbFrequencyDefinite() string
AdverbFrequencyDefinite will generate a random frequency definite adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdverbFrequencyDefinite())
// Output: hourly
}
hourly
func AdverbFrequencyIndefinite ¶
func AdverbFrequencyIndefinite() string
AdverbFrequencyIndefinite will generate a random frequency indefinite adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdverbFrequencyIndefinite())
// Output: occasionally
}
occasionally
func AdverbManner ¶
func AdverbManner() string
AdverbManner will generate a random manner adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdverbManner())
// Output: stupidly
}
stupidly
func AdverbPlace ¶
func AdverbPlace() string
AdverbPlace will generate a random place adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdverbPlace())
// Output: east
}
east
func AdverbTimeDefinite ¶
func AdverbTimeDefinite() string
AdverbTimeDefinite will generate a random time definite adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdverbTimeDefinite())
// Output: now
}
now
func AdverbTimeIndefinite ¶
func AdverbTimeIndefinite() string
AdverbTimeIndefinite will generate a random time indefinite adverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AdverbTimeIndefinite())
// Output: already
}
already
func Animal ¶
func Animal() string
Animal will return a random animal
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Animal())
// Output: elk
}
elk
func AnimalType ¶
func AnimalType() string
AnimalType will return a random animal type
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AnimalType())
// Output: amphibians
}
amphibians
func AppAuthor ¶
func AppAuthor() string
AppAuthor will generate a random company or person name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AppAuthor())
// Output: Marcel Pagac
}
Marcel Pagac
func AppName ¶
func AppName() string
AppName will generate a random app name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AppName())
// Output: Oxbeing
}
Oxbeing
func AppVersion ¶
func AppVersion() string
AppVersion will generate a random app version
Code:
Output:Example¶
{
Seed(11)
fmt.Println(AppVersion())
// Output: 1.17.20
}
1.17.20
func BS ¶
func BS() string
BS will generate a random company bs string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BS())
// Output: front-end
}
front-end
func BeerAlcohol ¶
func BeerAlcohol() string
BeerAlcohol will return a random beer alcohol level between 2.0 and 10.0
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerAlcohol())
// Output: 2.7%
}
2.7%
func BeerBlg ¶
func BeerBlg() string
BeerBlg will return a random beer blg between 5.0 and 20.0
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerBlg())
// Output: 6.4°Blg
}
6.4°Blg
func BeerHop ¶
func BeerHop() string
BeerHop will return a random beer hop
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerHop())
// Output: Glacier
}
Glacier
func BeerIbu ¶
func BeerIbu() string
BeerIbu will return a random beer ibu value between 10 and 100
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerIbu())
// Output: 47 IBU
}
47 IBU
func BeerMalt ¶
func BeerMalt() string
BeerMalt will return a random beer malt
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerMalt())
// Output: Munich
}
Munich
func BeerName ¶
func BeerName() string
BeerName will return a random beer name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerName())
// Output: Duvel
}
Duvel
func BeerStyle ¶
func BeerStyle() string
BeerStyle will return a random beer style
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerStyle())
// Output: European Amber Lager
}
European Amber Lager
func BeerYeast ¶
func BeerYeast() string
BeerYeast will return a random beer yeast
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BeerYeast())
// Output: 1388 - Belgian Strong Ale
}
1388 - Belgian Strong Ale
func BitcoinAddress ¶
func BitcoinAddress() string
BitcoinAddress will generate a random bitcoin address consisting of numbers, upper and lower characters
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BitcoinAddress())
// Output: 1lYcxjqWkJWv7cLADX0q6BIXbVXHo6jV
}
1lYcxjqWkJWv7cLADX0q6BIXbVXHo6jV
func BitcoinPrivateKey ¶
func BitcoinPrivateKey() string
BitcoinPrivateKey will generate a random bitcoin private key base58 consisting of numbers, upper and lower characters
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BitcoinPrivateKey())
// Output: 5KWjEJ7SnBNJyDjdPUjLuYByYzM9rG1trax8c2NTSBtv7YtR57v
}
5KWjEJ7SnBNJyDjdPUjLuYByYzM9rG1trax8c2NTSBtv7YtR57v
func Bool ¶
func Bool() bool
Bool will generate a random boolean value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Bool())
// Output: true
}
true
func Breakfast ¶
func Breakfast() string
Breakfast will return a random breakfast name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Breakfast())
// Output: Blueberry banana happy face pancakes
}
Blueberry banana happy face pancakes
func BuzzWord ¶
func BuzzWord() string
BuzzWord will generate a random company buzz word string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(BuzzWord())
// Output: disintermediate
}
disintermediate
func CSV ¶
func CSV(co *CSVOptions) ([]byte, error)
CSV generates an object or an array of objects in json format
Code:
Output: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,Markus,Moen,Dc0VYXjkWABx
// 2,Osborne,Hilll,XPJ9OVNbs5lm
// 3,Mertie,Halvorson,eyl3bhwfV8wA
}
id,first_name,last_name,password
1,Markus,Moen,Dc0VYXjkWABx
2,Osborne,Hilll,XPJ9OVNbs5lm
3,Mertie,Halvorson,eyl3bhwfV8wA
func CarFuelType ¶
func CarFuelType() string
CarFuelType will return a random fuel type
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CarFuelType())
// Output: CNG
}
CNG
func CarMaker ¶
func CarMaker() string
CarMaker will return a random car maker
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CarMaker())
// Output: Nissan
}
Nissan
func CarModel ¶
func CarModel() string
CarModel will return a random car model
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CarModel())
// Output: Aveo
}
Aveo
func CarTransmissionType ¶
func CarTransmissionType() string
CarTransmissionType will return a random transmission type
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CarTransmissionType())
// Output: Manual
}
Manual
func CarType ¶
func CarType() string
CarType will generate a random car type string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CarType())
// Output: Passenger car mini
}
Passenger car mini
func Cat ¶
func Cat() string
Cat will return a random cat breed
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Cat())
// Output: Sokoke
}
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
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CelebrityActor())
// Output: Owen Wilson
}
Owen Wilson
func CelebrityBusiness ¶
func CelebrityBusiness() string
CelebrityBusiness will generate a random celebrity business person
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CelebrityBusiness())
// Output: Cameron Diaz
}
Cameron Diaz
func CelebritySport ¶
func CelebritySport() string
CelebritySport will generate a random celebrity sport person
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CelebritySport())
// Output: Hicham El Guerrouj
}
Hicham El Guerrouj
func ChromeUserAgent ¶
func ChromeUserAgent() string
ChromeUserAgent will generate a random chrome browser user agent string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ChromeUserAgent())
// Output: Mozilla/5.0 (X11; Linux i686) AppleWebKit/5360 (KHTML, like Gecko) Chrome/40.0.889.0 Mobile Safari/5360
}
Mozilla/5.0 (X11; Linux i686) AppleWebKit/5360 (KHTML, like Gecko) Chrome/40.0.889.0 Mobile Safari/5360
func City ¶
func City() string
City will generate a random city string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(City())
// Output: Plano
}
Plano
func Color ¶
func Color() string
Color will generate a random color string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Color())
// Output: MediumOrchid
}
MediumOrchid
func Company ¶
func Company() string
Company will generate a random company name string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Company())
// Output: ClearHealthCosts
}
ClearHealthCosts
func CompanySuffix ¶
func CompanySuffix() string
CompanySuffix will generate a random company suffix string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CompanySuffix())
// Output: Inc
}
Inc
func Connective ¶
func Connective() string
Connective will generate a random connective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Connective())
// Output: such as
}
such as
func ConnectiveCasual ¶
func ConnectiveCasual() string
ConnectiveCasual will generate a random casual connective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ConnectiveCasual())
// Output: an outcome of
}
an outcome of
func ConnectiveComparitive ¶
func ConnectiveComparitive() string
ConnectiveComparitive will generate a random comparative connective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ConnectiveComparitive())
// Output: in addition
}
in addition
func ConnectiveComplaint ¶
func ConnectiveComplaint() string
ConnectiveComplaint will generate a random complaint connective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ConnectiveComplaint())
// Output: besides
}
besides
func ConnectiveExamplify ¶
func ConnectiveExamplify() string
ConnectiveExamplify will generate a random examplify connective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ConnectiveExamplify())
// Output: then
}
then
func ConnectiveListing ¶
func ConnectiveListing() string
ConnectiveListing will generate a random listing connective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ConnectiveListing())
// Output: firstly
}
firstly
func ConnectiveTime ¶
func ConnectiveTime() string
ConnectiveTime will generate a random connective time
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ConnectiveTime())
// Output: finally
}
finally
func Country ¶
func Country() string
Country will generate a random country string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Country())
// Output: Cabo Verde
}
Cabo Verde
func CountryAbr ¶
func CountryAbr() string
CountryAbr will generate a random abbreviated country string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CountryAbr())
// Output: CV
}
CV
func CreditCardCvv ¶
func CreditCardCvv() string
CreditCardCvv will generate a random CVV number
Its a string because you could have 017 as an exp date
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CreditCardCvv())
// Output: 513
}
513
func CreditCardExp ¶
func CreditCardExp() string
CreditCardExp will generate a random credit card expiration date string
Exp date will always be a future date
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CreditCardExp())
// Output: 06/29
}
06/29
func CreditCardNumber ¶
func CreditCardNumber(cco *CreditCardOptions) string
CreditCardNumber will generate a random luhn credit card number
Code:
Output: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:
// 4136459948995375
// 4635300425914586
// 4111232020276132
// 3054 800889 9827
}
4136459948995375
4635300425914586
4111232020276132
3054 800889 9827
func CreditCardType ¶
func CreditCardType() string
CreditCardType will generate a random credit card type string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CreditCardType())
// Output: Visa
}
Visa
func CurrencyLong ¶
func CurrencyLong() string
CurrencyLong will generate a random long currency name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CurrencyLong())
// Output: Iraq Dinar
}
Iraq Dinar
func CurrencyShort ¶
func CurrencyShort() string
CurrencyShort will generate a random short currency value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(CurrencyShort())
// Output: IQD
}
IQD
func Date ¶
Date will generate a random time.Time struct
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Date())
// Output: 1995-01-24 13:00:35.820738079 +0000 UTC
}
1995-01-24 13:00:35.820738079 +0000 UTC
func DateRange ¶
DateRange will generate a random time.Time struct between a start and end date
Code:
Output:Example¶
{
Seed(11)
fmt.Println(DateRange(time.Unix(0, 484633944473634951), time.Unix(0, 1431318744473668209))) // May 10, 1985 years to May 10, 2015
// Output: 2012-02-04 14:10:37.166933216 +0000 UTC
}
2012-02-04 14:10:37.166933216 +0000 UTC
func Day ¶
func Day() int
Day will generate a random day between 1 - 31
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Day())
// Output: 23
}
23
func Dessert ¶
func Dessert() string
Dessert will return a random dessert name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Dessert())
// Output: French napoleons
}
French napoleons
func Digit ¶
func Digit() string
Digit will generate a single ASCII digit
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Digit())
// Output: 0
}
0
func DigitN ¶
DigitN will generate a random string of length N consists of ASCII digits (note it can start with 0).
Code:
Output:Example¶
{
Seed(11)
fmt.Println(DigitN(10))
// Output: 0136459948
}
0136459948
func Dinner ¶
func Dinner() string
Dinner will return a random dinner name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Dinner())
// Output: Wild addicting dip
}
Wild addicting dip
func Dog ¶
func Dog() string
Dog will return a random dog breed
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Dog())
// Output: Norwich Terrier
}
Norwich Terrier
func DomainName ¶
func DomainName() string
DomainName will generate a random url domain name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(DomainName())
// Output: centraltarget.biz
}
centraltarget.biz
func DomainSuffix ¶
func DomainSuffix() string
DomainSuffix will generate a random domain suffix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(DomainSuffix())
// Output: org
}
org
func Email ¶
func Email() string
Email will generate a random email string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Email())
// Output: markusmoen@pagac.net
}
markusmoen@pagac.net
func Emoji ¶
func Emoji() string
Emoji will return a random fun emoji
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Emoji())
// Output: 🧛
}
🧛
func EmojiAlias ¶
func EmojiAlias() string
EmojiAlias will return a random fun emoji alias
Code:
Output:Example¶
{
Seed(11)
fmt.Println(EmojiAlias())
// Output: deaf_person
}
deaf_person
func EmojiCategory ¶
func EmojiCategory() string
EmojiCategory will return a random fun emoji category
Code:
Output:Example¶
{
Seed(11)
fmt.Println(EmojiCategory())
// Output: Food & Drink
}
Food & Drink
func EmojiDescription ¶
func EmojiDescription() string
EmojiDescription will return a random fun emoji description
Code:
Output:Example¶
{
Seed(11)
fmt.Println(EmojiDescription())
// Output: confetti ball
}
confetti ball
func EmojiTag ¶
func EmojiTag() string
EmojiTag will return a random fun emoji tag
Code:
Output:Example¶
{
Seed(11)
fmt.Println(EmojiTag())
// Output: strong
}
strong
func FarmAnimal ¶
func FarmAnimal() string
FarmAnimal will return a random animal that usually lives on a farm
Code:
Output:Example¶
{
Seed(11)
fmt.Println(FarmAnimal())
// Output: Chicken
}
Chicken
func FileExtension ¶
func FileExtension() string
FileExtension will generate a random file extension
Code:
Output:Example¶
{
Seed(11)
fmt.Println(FileExtension())
// Output: nes
}
nes
func FileMimeType ¶
func FileMimeType() string
FileMimeType will generate a random mime file type
Code:
Output:Example¶
{
Seed(11)
fmt.Println(FileMimeType())
// Output: application/dsptype
}
application/dsptype
func FirefoxUserAgent ¶
func FirefoxUserAgent() string
FirefoxUserAgent will generate a random firefox broswer user agent string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(FirefoxUserAgent())
// Output: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_9_10 rv:7.0) Gecko/1995-24-01 Firefox/36.0
}
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_9_10 rv:7.0) Gecko/1995-24-01 Firefox/36.0
func FirstName ¶
func FirstName() string
FirstName will generate a random first name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(FirstName())
// Output: Markus
}
Markus
func FlipACoin ¶
func FlipACoin() string
FlipACoin will return a random value of Heads or Tails
Code:
Output:Example¶
{
Seed(11)
fmt.Println(FlipACoin())
// Output: Heads
}
Heads
func Float32 ¶
func Float32() float32
Float32 will generate a random float32 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Float32())
// Output: 3.1128167e+37
}
3.1128167e+37
func Float32Range ¶
Float32Range will generate a random float32 value between min and max
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Float32Range(0, 9999999))
// Output: 914774.6
}
914774.6
func Float64 ¶
func Float64() float64
Float64 will generate a random float64 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Float64())
// Output: 1.644484108270445e+307
}
1.644484108270445e+307
func Float64Range ¶
Float64Range will generate a random float64 value between min and max
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Float64Range(0, 9999999))
// Output: 914774.5585333086
}
914774.5585333086
func Fruit ¶
func Fruit() string
Fruit will return a random fruit name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Fruit())
// Output: Peach
}
Peach
func Gamertag ¶
func Gamertag() string
Gamertag will generate a random video game username
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Gamertag())
// Output: PurpleSheep5
}
PurpleSheep5
func Gender ¶
func Gender() string
Gender will generate a random gender string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Gender())
// Output: male
}
male
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
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Generate("{firstname} {lastname} ssn is {ssn} and lives at {street}"))
fmt.Println(Generate("{sentence:3}"))
fmt.Println(Generate("{shuffleints:[1,2,3]}"))
fmt.Println(Generate("{number:1,50}"))
fmt.Println(Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}"))
// Output: Markus Moen ssn is 526643139 and lives at 599 Dale ton
// Niche backwards caused.
// [1 3 2]
// 27
// [a:b key:value int:string 1:2]
}
Markus Moen ssn is 526643139 and lives at 599 Dale ton
Niche backwards caused.
[1 3 2]
27
[a:b key:value int:string 1:2]
func HTTPMethod ¶
func HTTPMethod() string
HTTPMethod will generate a random http method
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HTTPMethod())
// Output: HEAD
}
HEAD
func HTTPStatusCode ¶
func HTTPStatusCode() int
HTTPStatusCode will generate a random status code
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HTTPStatusCode())
// Output: 404
}
404
func HTTPStatusCodeSimple ¶
func HTTPStatusCodeSimple() int
HTTPStatusCodeSimple will generate a random simple status code
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HTTPStatusCodeSimple())
// Output: 200
}
200
func HTTPVersion ¶
func HTTPVersion() string
HTTPVersion will generate a random http version
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HTTPVersion())
// Output: HTTP/1.0
}
HTTP/1.0
func HackerAbbreviation ¶
func HackerAbbreviation() string
HackerAbbreviation will return a random hacker abbreviation
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HackerAbbreviation())
// Output: ADP
}
ADP
func HackerAdjective ¶
func HackerAdjective() string
HackerAdjective will return a random hacker adjective
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HackerAdjective())
// Output: wireless
}
wireless
func HackerNoun ¶
func HackerNoun() string
HackerNoun will return a random hacker noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HackerNoun())
// Output: driver
}
driver
func HackerPhrase ¶
func HackerPhrase() string
HackerPhrase will return a random hacker sentence
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HackerPhrase())
// Output: If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!
}
If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!
func HackerVerb ¶
func HackerVerb() string
HackerVerb will return a random hacker verb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HackerVerb())
// Output: synthesize
}
synthesize
func HackeringVerb ¶
func HackeringVerb() string
HackeringVerb will return a random hacker ingverb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HackeringVerb())
// Output: connecting
}
connecting
func HexColor ¶
func HexColor() string
HexColor will generate a random hexadecimal color string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HexColor())
// Output: #a99fb4
}
#a99fb4
func HexUint128 ¶
func HexUint128() string
HexUint128 will generate a random uint128 hex value with "0x" prefix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HexUint128())
// Output: 0x875469578e51b5e56c95b64681d147a1
}
0x875469578e51b5e56c95b64681d147a1
func HexUint16 ¶
func HexUint16() string
HexUint16 will generate a random uint16 hex value with "0x" prefix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HexUint16())
// Output: 0x8754
}
0x8754
func HexUint256 ¶
func HexUint256() string
HexUint256 will generate a random uint256 hex value with "0x" prefix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HexUint256())
// Output: 0x875469578e51b5e56c95b64681d147a12cde48a4f417231b0c486abbc263e48d
}
0x875469578e51b5e56c95b64681d147a12cde48a4f417231b0c486abbc263e48d
func HexUint32 ¶
func HexUint32() string
HexUint32 will generate a random uint32 hex value with "0x" prefix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HexUint32())
// Output: 0x87546957
}
0x87546957
func HexUint64 ¶
func HexUint64() string
HexUint64 will generate a random uint64 hex value with "0x" prefix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HexUint64())
// Output: 0x875469578e51b5e5
}
0x875469578e51b5e5
func HexUint8 ¶
func HexUint8() string
HexUint8 will generate a random uint8 hex value with "0x" prefix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HexUint8())
// Output: 0x87
}
0x87
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
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HipsterParagraph(3, 5, 12, "\n"))
// Output: Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.
// Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.
// Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.
}
Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.
Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.
Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.
func HipsterSentence ¶
HipsterSentence will generate a random sentence
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HipsterSentence(5))
// Output: Microdosing roof chia echo pickled.
}
Microdosing roof chia echo pickled.
func HipsterWord ¶
func HipsterWord() string
HipsterWord will return a single hipster word
Code:
Output:Example¶
{
Seed(11)
fmt.Println(HipsterWord())
// Output: microdosing
}
microdosing
func Hobby ¶
func Hobby() string
Hobby will generate a random hobby string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Hobby())
// Output: Transit map collecting
}
Transit map collecting
func Hour ¶
func Hour() int
Hour will generate a random hour - in military time
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Hour())
// Output: 17
}
17
func IPv4Address ¶
func IPv4Address() string
IPv4Address will generate a random version 4 ip address
Code:
Output:Example¶
{
Seed(11)
fmt.Println(IPv4Address())
// Output: 152.23.53.100
}
152.23.53.100
func IPv6Address ¶
func IPv6Address() string
IPv6Address will generate a random version 6 ip address
Code:
Output:Example¶
{
Seed(11)
fmt.Println(IPv6Address())
// Output: 8898:ee17:bc35:9064:5866:d019:3b95:7857
}
8898:ee17:bc35:9064:5866:d019:3b95:7857
func Image ¶
Image generates a random rgba image
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Image(1, 1))
// Output: &{[89 176 195 255] 4 (0,0)-(1,1)}
}
&{[89 176 195 255] 4 (0,0)-(1,1)}
func ImageJpeg ¶
ImageJpeg generates a random rgba jpeg image
Code:
Output: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 216 162 138 43 213 62 92 255 217]
}
[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 216 162 138 43 213 62 92 255 217]
func ImagePng ¶
ImagePng generates a random rgba png image
Code:
Output: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 138 220 112 24 16 0 0 255 255 3 58 1 207 38 214 44 234 0 0 0 0 73 69 78 68 174 66 96 130]
}
[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 138 220 112 24 16 0 0 255 255 3 58 1 207 38 214 44 234 0 0 0 0 73 69 78 68 174 66 96 130]
func ImageURL ¶
ImageURL will generate a random Image Based Upon Height And Width. https://picsum.photos/
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ImageURL(640, 480))
// Output: https://picsum.photos/640/480
}
https://picsum.photos/640/480
func Int16 ¶
func Int16() int16
Int16 will generate a random int16 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Int16())
// Output: -29607
}
-29607
func Int32 ¶
func Int32() int32
Int32 will generate a random int32 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Int32())
// Output: -1072427943
}
-1072427943
func Int64 ¶
func Int64() int64
Int64 will generate a random int64 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Int64())
// Output: -1072427943
}
-1072427943
func Int8 ¶
func Int8() int8
Int8 will generate a random Int8 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Int8())
// Output: -39
}
-39
func IntRange ¶
IntRange will generate a random int value between min and max
Code:
Output:Example¶
{
Seed(11)
fmt.Println(IntRange(1, 10))
// Output: 6
}
6
func JSON ¶
func JSON(jo *JSONOptions) ([]byte, error)
JSON generates an object or an array of objects in json format
Code:
Output: Code:
Output: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": "Markus",
// "last_name": "Moen",
// "password": "Dc0VYXjkWABx"
// },
// {
// "id": 2,
// "first_name": "Osborne",
// "last_name": "Hilll",
// "password": "XPJ9OVNbs5lm"
// },
// {
// "id": 3,
// "first_name": "Mertie",
// "last_name": "Halvorson",
// "password": "eyl3bhwfV8wA"
// }
// ]
}
[
{
"id": 1,
"first_name": "Markus",
"last_name": "Moen",
"password": "Dc0VYXjkWABx"
},
{
"id": 2,
"first_name": "Osborne",
"last_name": "Hilll",
"password": "XPJ9OVNbs5lm"
},
{
"id": 3,
"first_name": "Mertie",
"last_name": "Halvorson",
"password": "eyl3bhwfV8wA"
}
]
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": "Markus",
// "last_name": "Moen",
// "address": {
// "address": "4599 Dale ton, Norfolk, New Jersey 36906",
// "street": "4599 Dale ton",
// "city": "Norfolk",
// "state": "New Jersey",
// "zip": "36906",
// "country": "Tokelau",
// "latitude": 23.058758,
// "longitude": 89.022594
// },
// "password": "qjXy56JHcVlZ"
// }
}
{
"first_name": "Markus",
"last_name": "Moen",
"address": {
"address": "4599 Dale ton, Norfolk, New Jersey 36906",
"street": "4599 Dale ton",
"city": "Norfolk",
"state": "New Jersey",
"zip": "36906",
"country": "Tokelau",
"latitude": 23.058758,
"longitude": 89.022594
},
"password": "qjXy56JHcVlZ"
}
func JobDescriptor ¶
func JobDescriptor() string
JobDescriptor will generate a random job descriptor string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(JobDescriptor())
// Output: Central
}
Central
func JobLevel ¶
func JobLevel() string
JobLevel will generate a random job level string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(JobLevel())
// Output: Assurance
}
Assurance
func JobTitle ¶
func JobTitle() string
JobTitle will generate a random job title string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(JobTitle())
// Output: Director
}
Director
func Language ¶
func Language() string
Language will return a random language
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Language())
// Output: Kazakh
}
Kazakh
func LanguageAbbreviation ¶
func LanguageAbbreviation() string
LanguageAbbreviation will return a random language abbreviation
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LanguageAbbreviation())
// Output: kk
}
kk
func LanguageBCP ¶
func LanguageBCP() string
LanguageBCP will return a random language BCP (Best Current Practices)
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LanguageBCP())
// Output: de-DE
}
de-DE
func LastName ¶
func LastName() string
LastName will generate a random last name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LastName())
// Output: Daniel
}
Daniel
func Latitude ¶
func Latitude() float64
Latitude will generate a random latitude float64
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Latitude())
// Output: -73.534057
}
-73.534057
func LatitudeInRange ¶
LatitudeInRange will generate a random latitude within the input range
Code:
Output:Example¶
{
Seed(11)
lat, _ := LatitudeInRange(21, 42)
fmt.Println(lat)
// Output: 22.921026
}
22.921026
func Letter ¶
func Letter() string
Letter will generate a single random lower case ASCII letter
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Letter())
// Output: g
}
g
func LetterN ¶
LetterN will generate a random ASCII string with length N
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LetterN(10))
// Output: gbRMaRxHki
}
gbRMaRxHki
func Lexify ¶
Lexify will replace ? with random generated letters
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Lexify("?????"))
// Output: gbRMa
}
gbRMa
func LogLevel ¶
LogLevel will generate a random log level
See data/LogLevels for list of available levels
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LogLevel("")) // This will also use general
fmt.Println(LogLevel("syslog"))
fmt.Println(LogLevel("apache"))
// Output: error
// debug
// trace1-8
}
error
debug
trace1-8
func Longitude ¶
func Longitude() float64
Longitude will generate a random longitude float64
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Longitude())
// Output: -147.068113
}
-147.068113
func LongitudeInRange ¶
LongitudeInRange will generate a random longitude within the input range
Code:
Output:Example¶
{
Seed(11)
long, _ := LongitudeInRange(-10, 10)
fmt.Println(long)
// Output: -8.170451
}
-8.170451
func LoremIpsumParagraph ¶
func LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
LoremIpsumParagraph will generate a random paragraphGenerator
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LoremIpsumParagraph(3, 5, 12, "\n"))
// Output: Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.
// Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.
// Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.
}
Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.
Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.
Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.
func LoremIpsumSentence ¶
LoremIpsumSentence will generate a random sentence
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LoremIpsumSentence(5))
// Output: Quia quae repellat consequatur quidem.
}
Quia quae repellat consequatur quidem.
func LoremIpsumWord ¶
func LoremIpsumWord() string
LoremIpsumWord will generate a random word
Code:
Output:Example¶
{
Seed(11)
fmt.Println(LoremIpsumWord())
// Output: quia
}
quia
func Lunch ¶
func Lunch() string
Lunch will return a random lunch name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Lunch())
// Output: No bake hersheys bar pie
}
No bake hersheys bar pie
func MacAddress ¶
func MacAddress() string
MacAddress will generate a random mac address
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MacAddress())
// Output: e1:74:cb:01:77:91
}
e1:74:cb:01:77:91
func Map ¶
func Map() map[string]interface{}
Map will generate a random set of map data
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Map())
// Output: map[contrast:Associate gauva:map[jump:scale] generally:8504801 him:[them whomever ours hence here his] its:8335564 table:map[did:[these delay these]] therefore:map[nearly:784141.8] thing:map[everything:[where caused why week hourly]]]
}
map[contrast:Associate gauva:map[jump:scale] generally:8504801 him:[them whomever ours hence here his] its:8335564 table:map[did:[these delay these]] therefore:map[nearly:784141.8] thing:map[everything:[where caused why week hourly]]]
func MinecraftAnimal ¶
func MinecraftAnimal() string
MinecraftAnimal will generate a random Minecraft animal
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftAnimal())
// Output:
// chicken
}
chicken
func MinecraftArmorPart ¶
func MinecraftArmorPart() string
MinecraftArmorPart will generate a random Minecraft armor part
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftArmorPart())
// Output:
// helmet
}
helmet
func MinecraftArmorTier ¶
func MinecraftArmorTier() string
MinecraftArmorTier will generate a random Minecraft armor tier
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftArmorTier())
// Output:
// leather
}
leather
func MinecraftBiome ¶
func MinecraftBiome() string
MinecraftBiome will generate a random Minecraft biome
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftBiome())
// Output:
// stone shore
}
stone shore
func MinecraftDye ¶
func MinecraftDye() string
MinecraftDye will generate a random Minecraft dye
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftDye())
// Output:
// light gray
}
light gray
func MinecraftFood ¶
func MinecraftFood() string
MinecraftFood will generate a random Minecraft food
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftFood())
// Output:
// beetroot
}
beetroot
func MinecraftMobBoss ¶
func MinecraftMobBoss() string
MinecraftMobBoss will generate a random Minecraft mob boss
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftMobBoss())
// Output:
// ender dragon
}
ender dragon
func MinecraftMobHostile ¶
func MinecraftMobHostile() string
MinecraftMobHostile will generate a random Minecraft mob hostile
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftMobHostile())
// Output:
// blaze
}
blaze
func MinecraftMobNeutral ¶
func MinecraftMobNeutral() string
MinecraftMobNeutral will generate a random Minecraft mob neutral
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftMobNeutral())
// Output:
// wolf
}
wolf
func MinecraftMobPassive ¶
func MinecraftMobPassive() string
MinecraftMobPassive will generate a random Minecraft mob passive
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftMobPassive())
// Output:
// chicken
}
chicken
func MinecraftOre ¶
func MinecraftOre() string
MinecraftOre will generate a random Minecraft ore
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftOre())
// Output:
// coal
}
coal
func MinecraftTool ¶
func MinecraftTool() string
MinecraftTool will generate a random Minecraft tool
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftTool())
// Output:
// pickaxe
}
pickaxe
func MinecraftVillagerJob ¶
func MinecraftVillagerJob() string
MinecraftVillagerJob will generate a random Minecraft villager job
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftVillagerJob())
// Output:
// toolsmith
}
toolsmith
func MinecraftVillagerLevel ¶
func MinecraftVillagerLevel() string
MinecraftVillagerLevel will generate a random Minecraft villager level
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftVillagerLevel())
// Output:
// novice
}
novice
func MinecraftVillagerStation ¶
func MinecraftVillagerStation() string
MinecraftVillagerStation will generate a random Minecraft villager station
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftVillagerStation())
// Output:
// cauldron
}
cauldron
func MinecraftWeapon ¶
func MinecraftWeapon() string
MinecraftWeapon will generate a random Minecraft weapon
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftWeapon())
// Output:
// sword
}
sword
func MinecraftWeather ¶
func MinecraftWeather() string
MinecraftWeather will generate a random Minecraft weather
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftWeather())
// Output:
// clear
}
clear
func MinecraftWood ¶
func MinecraftWood() string
MinecraftWood will generate a random Minecraft wood
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MinecraftWood())
// Output:
// oak
}
oak
func Minute ¶
func Minute() int
Minute will generate a random minute
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Minute())
// Output: 5
}
5
func Month ¶
func Month() int
Month will generate a random month int
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Month())
// Output: 6
}
6
func MonthString ¶
func MonthString() string
MonthString will generate a random month string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(MonthString())
// Output: June
}
June
func Name ¶
func Name() string
Name will generate a random First and Last Name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Name())
// Output: Markus Moen
}
Markus Moen
func NamePrefix ¶
func NamePrefix() string
NamePrefix will generate a random name prefix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NamePrefix())
// Output: Mr.
}
Mr.
func NameSuffix ¶
func NameSuffix() string
NameSuffix will generate a random name suffix
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NameSuffix())
// Output: Jr.
}
Jr.
func NanoSecond ¶
func NanoSecond() int
NanoSecond will generate a random nano second
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NanoSecond())
// Output: 693298265
}
693298265
func Noun ¶
func Noun() string
Noun will generate a random noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Noun())
// Output: aunt
}
aunt
func NounAbstract ¶
func NounAbstract() string
NounAbstract will generate a random abstract noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounAbstract())
// Output: confusion
}
confusion
func NounCollectiveAnimal ¶
func NounCollectiveAnimal() string
NounCollectiveAnimal will generate a random collective noun animal
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounCollectiveAnimal())
// Output: party
}
party
func NounCollectivePeople ¶
func NounCollectivePeople() string
NounCollectivePeople will generate a random collective noun person
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounCollectivePeople())
// Output: body
}
body
func NounCollectiveThing ¶
func NounCollectiveThing() string
NounCollectiveThing will generate a random collective noun thing
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounCollectiveThing())
// Output: hand
}
hand
func NounCommon ¶
func NounCommon() string
NounCommon will generate a random common noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounCommon())
// Output: part
}
part
func NounConcrete ¶
func NounConcrete() string
NounConcrete will generate a random concrete noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounConcrete())
// Output: snowman
}
snowman
func NounCountable ¶
func NounCountable() string
NounCountable will generate a random countable noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounCountable())
// Output: neck
}
neck
func NounProper ¶
func NounProper() string
NounProper will generate a random proper noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounProper())
// Output: Marcel
}
Marcel
func NounUncountable ¶
func NounUncountable() string
NounUncountable will generate a random uncountable noun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(NounUncountable())
// Output: seafood
}
seafood
func Number ¶
Number will generate a random number between given min And max
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Number(50, 23456))
// Output: 12583
}
12583
func Numerify ¶
Numerify will replace # with random numerical values
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Numerify("###-###-####"))
// Output: 613-645-9948
}
613-645-9948
func OperaUserAgent ¶
func OperaUserAgent() string
OperaUserAgent will generate a random opera browser user agent string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(OperaUserAgent())
// Output: Opera/8.20 (Macintosh; U; PPC Mac OS X 10_9_10; en-US) Presto/2.9.198 Version/11.00
}
Opera/8.20 (Macintosh; U; PPC Mac OS X 10_9_10; en-US) Presto/2.9.198 Version/11.00
func Paragraph ¶
Paragraph will generate a random paragraphGenerator
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Paragraph(3, 5, 12, "\n"))
// Output: There had result everything niche backwards caused quarterly without week it hungry. Thing someone him regularly today whomever this revolt hence from his timing. As quantity us these yours live these frantic not may another how. This ours his them those whose them batch its Iraqi most that. Few abroad cheese this whereas next how there gorgeous genetics time choir.
// Fiction therefore yourselves am those infrequently heap software quarterly rather punctuation yellow. Where several his orchard to frequently hence victorious boxers each does auspicious. Yourselves first soup tomorrow this that must conclude anyway some yearly who. Cough laugh himself both yet rarely me dolphin intensely block would leap. Plane us first then down them eager would hundred super throughout animal.
// Yet themselves been group flock shake part purchase up usually it her. None it hers boat what their there Turkmen moreover one Lebanese to. Brace these shower in it everybody should whatever those uninterested several nobody. Yours thankful innocent power to any from its few luxury none boy. Religion themselves it there might must near theirs mine thing tonight outside.
}
There had result everything niche backwards caused quarterly without week it hungry. Thing someone him regularly today whomever this revolt hence from his timing. As quantity us these yours live these frantic not may another how. This ours his them those whose them batch its Iraqi most that. Few abroad cheese this whereas next how there gorgeous genetics time choir.
Fiction therefore yourselves am those infrequently heap software quarterly rather punctuation yellow. Where several his orchard to frequently hence victorious boxers each does auspicious. Yourselves first soup tomorrow this that must conclude anyway some yearly who. Cough laugh himself both yet rarely me dolphin intensely block would leap. Plane us first then down them eager would hundred super throughout animal.
Yet themselves been group flock shake part purchase up usually it her. None it hers boat what their there Turkmen moreover one Lebanese to. Brace these shower in it everybody should whatever those uninterested several nobody. Yours thankful innocent power to any from its few luxury none boy. Religion themselves it there might must near theirs mine thing tonight outside.
func Password ¶
Password will generate a random password.
Minimum number length of 5 if less than.
Code:
Output: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: vodnqxzsuptgehrzylximvylxzoywexw
// ZSRQWJFJWCSTVGXKYKWMLIAFGFELFJRG
// 61718615932495608398906260648432
// @$,@#:,(,).{?:%?)>*..<=};#$(:{==
// CkF{wwb:?Kb},w?vdz{Zox C&>Prt99:
// j ;9X
}
vodnqxzsuptgehrzylximvylxzoywexw
ZSRQWJFJWCSTVGXKYKWMLIAFGFELFJRG
61718615932495608398906260648432
@$,@#:,(,).{?:%?)>*..<=};#$(:{==
CkF{wwb:?Kb},w?vdz{Zox C&>Prt99:
j ;9X
func PetName ¶
func PetName() string
PetName will return a random fun pet name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PetName())
// Output: Ozzy Pawsborne
}
Ozzy Pawsborne
func Phone ¶
func Phone() string
Phone will generate a random phone number string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Phone())
// Output: 6136459948
}
6136459948
func PhoneFormatted ¶
func PhoneFormatted() string
PhoneFormatted will generate a random phone number string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PhoneFormatted())
// Output: 136-459-9489
}
136-459-9489
func Phrase ¶
func Phrase() string
Phrase will return a random phrase
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Phrase())
// Output: horses for courses
}
horses for courses
func PhraseAdverb ¶
func PhraseAdverb() string
PhraseAdverb will return a random adverb phrase
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PhraseAdverb())
// Output: fully gladly
}
fully gladly
func PhraseNoun ¶
func PhraseNoun() string
PhraseNoun will return a random noun phrase
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PhraseNoun())
// Output: the purple tribe
}
the purple tribe
func PhrasePreposition ¶
func PhrasePreposition() string
PhrasePreposition will return a random preposition phrase
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PhrasePreposition())
// Output: out the tribe
}
out the tribe
func PhraseVerb ¶
func PhraseVerb() string
PhraseVerb will return a random preposition phrase
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PhraseVerb())
// Output: gladly dream indeed swiftly till a problem poorly
}
gladly dream indeed swiftly till a problem poorly
func Preposition ¶
func Preposition() string
Preposition will generate a random preposition
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Preposition())
// Output: other than
}
other than
func PrepositionCompound ¶
func PrepositionCompound() string
PrepositionCompound will generate a random compound preposition
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PrepositionCompound())
// Output: according to
}
according to
func PrepositionDouble ¶
func PrepositionDouble() string
PrepositionDouble will generate a random double preposition
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PrepositionDouble())
// Output: before
}
before
func PrepositionSimple ¶
func PrepositionSimple() string
PrepositionSimple will generate a random simple preposition
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PrepositionSimple())
// Output: out
}
out
func Price ¶
Price will take in a min and max value and return a formatted price
Code:
Output:Example¶
{
Seed(11)
fmt.Printf("%.2f", Price(0.8618, 1000))
// Output: 92.26
}
92.26
func ProgrammingLanguage ¶
func ProgrammingLanguage() string
ProgrammingLanguage will return a random programming language
Code:
Output:Example¶
{
Seed(464)
fmt.Println(ProgrammingLanguage())
// Output: Go
}
Go
func ProgrammingLanguageBest ¶
func ProgrammingLanguageBest() string
ProgrammingLanguageBest will return a random programming language
Code:
Output:Example¶
{
Seed(11)
fmt.Println(ProgrammingLanguageBest())
// Output: Go
}
Go
func Pronoun ¶
func Pronoun() string
Pronoun will generate a random pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Pronoun())
// Output: me
}
me
func PronounDemonstrative ¶
func PronounDemonstrative() string
PronounDemonstrative will generate a random demonstrative pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounDemonstrative())
// Output: this
}
this
func PronounIndefinite ¶
func PronounIndefinite() string
PronounIndefinite will generate a random indefinite pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounIndefinite())
// Output: few
}
few
func PronounInterrogative ¶
func PronounInterrogative() string
PronounInterrogative will generate a random interrogative pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounInterrogative())
// Output: what
}
what
func PronounObject ¶
func PronounObject() string
PronounObject will generate a random object pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounObject())
// Output: it
}
it
func PronounPersonal ¶
func PronounPersonal() string
PronounPersonal will generate a random personal pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounPersonal())
// Output: it
}
it
func PronounPossessive ¶
func PronounPossessive() string
PronounPossessive will generate a random possessive pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounPossessive())
// Output: mine
}
mine
func PronounReflective ¶
func PronounReflective() string
PronounReflective will generate a random reflective pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounReflective())
// Output: myself
}
myself
func PronounRelative ¶
func PronounRelative() string
PronounRelative will generate a random relative pronoun
Code:
Output:Example¶
{
Seed(11)
fmt.Println(PronounRelative())
// Output: as
}
as
func Question ¶
func Question() string
Question will return a random question
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Question())
// Output: Roof chia echo pickled?
}
Roof chia echo pickled?
func Quote ¶
func Quote() string
Quote will return a random quote from a random person
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Quote())
// Output: "Roof chia echo pickled." - Marques Jakubowski
}
"Roof chia echo pickled." - Marques Jakubowski
func RGBColor ¶
func RGBColor() []int
RGBColor will generate a random int slice color
Code:
Output:Example¶
{
Seed(11)
fmt.Println(RGBColor())
// Output: [89 176 195]
}
[89 176 195]
func RandomInt ¶
RandomInt will take in a slice of int and return a randomly selected value
Code:
Output:Example¶
{
Seed(11)
ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(RandomInt(ints))
// Output: 52
}
52
func RandomMapKey ¶
func RandomMapKey(mapI interface{}) interface{}
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
Code:
Output:Example¶
{
Seed(11)
fmt.Println(RandomString([]string{"hello", "world"}))
// Output: hello
}
hello
func RandomUint ¶
RandomUint will take in a slice of uint and return a randomly selected value
Code:
Output:Example¶
{
Seed(11)
ints := []uint{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(RandomUint(ints))
// Output: 52
}
52
func Regex ¶
Regex will generate a string based upon a RE2 syntax
Code:
Output: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: affec
// RXHKI
// world
// tapwyjdnsm@gtlxw.net
}
affec
RXHKI
world
tapwyjdnsm@gtlxw.net
func RemoveFuncLookup ¶
func RemoveFuncLookup(functionName string)
RemoveFuncLookup will remove a function from lookup
func SSN ¶
func SSN() string
SSN will generate a random Social Security Number
Code:
Output:Example¶
{
Seed(11)
fmt.Println(SSN())
// Output: 493298265
}
493298265
func SafariUserAgent ¶
func SafariUserAgent() string
SafariUserAgent will generate a random safari browser user agent string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(SafariUserAgent())
// Output: Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X; en-US) AppleWebKit/536.4.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B120 Safari/6536.4.4
}
Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X; en-US) AppleWebKit/536.4.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B120 Safari/6536.4.4
func SafeColor ¶
func SafeColor() string
SafeColor will generate a random safe color string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(SafeColor())
// Output: black
}
black
func Second ¶
func Second() int
Second will generate a random second
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Second())
// Output: 5
}
5
func Seed ¶
func Seed(seed int64)
Seed will set the global random value. Setting seed to 0 will use crypto/rand
func Sentence ¶
Sentence will generate a random sentence
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Sentence(5))
// Output: There had result everything niche.
}
There had result everything niche.
func SentenceSimple ¶
func SentenceSimple() string
SentenceSimple will generate a random simple sentence
Code:
Output:Example¶
{
Seed(11)
fmt.Println(SentenceSimple())
// Output: The purple tribe indeed swiftly laugh.
}
The purple tribe indeed swiftly laugh.
func SetGlobalFaker ¶
func SetGlobalFaker(faker *Faker)
SetGlobalFaker will allow you to set what type of faker is globally used. Defailt is math/rand
Code:
Example¶
{
cryptoFaker := NewCrypto()
SetGlobalFaker(cryptoFaker)
}
func ShuffleAnySlice ¶
func ShuffleAnySlice(v interface{})
ShuffleAnySlice takes in a slice and outputs it in a random order
Code:
Output: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:
// [good everyone have for times a day happy]
// [777 74125 941 854 89416 52 8413 841657]
}
[good everyone have for times a day happy]
[777 74125 941 854 89416 52 8413 841657]
func ShuffleInts ¶
func ShuffleInts(a []int)
ShuffleInts will randomize a slice of ints
Code:
Output:Example¶
{
Seed(11)
ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
ShuffleInts(ints)
fmt.Println(ints)
// Output: [74125 777 941 89416 8413 854 52 841657]
}
[74125 777 941 89416 8413 854 52 841657]
func ShuffleStrings ¶
func ShuffleStrings(a []string)
ShuffleStrings will randomize a slice of strings
Code:
Output:Example¶
{
Seed(11)
strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"}
ShuffleStrings(strings)
fmt.Println(strings)
// Output: [good everyone have for times a day happy]
}
[good everyone have for times a day happy]
func Slice ¶
func Slice(v interface{})
Slice fills built-in types and exported fields of a struct with random data.
Code:
Output: Code:
Output:Example¶
{
Seed(11)
var S []string
Slice(&S)
I := make([]int8, 3)
Slice(&I)
fmt.Println(S)
fmt.Println(I)
// Output: [RMaRxHkiJ PtapWYJdn MKgtlxwnq qclaYkWw oRLOPxLIok qanPAKaXS]
// [-88 -101 60]
}
[RMaRxHkiJ PtapWYJdn MKgtlxwnq qclaYkWw oRLOPxLIok qanPAKaXS]
[-88 -101 60]
Example (Struct)¶
{
Seed(11)
type Basic struct {
S string `fake:"{firstname}"`
I int
F float32
}
var B []Basic
Slice(&B)
fmt.Println(B)
// Output: [{Marcel -652938557 1.9343967e+38} {Lura -101175613 2.670526e+38} {Lucinda 1412367049 1.0427679e+38} {Santino 1631045574 2.2573786e+38} {Dawn -924758850 4.249854e+37} {Alice -937677379 1.0573345e+38}]
}
[{Marcel -652938557 1.9343967e+38} {Lura -101175613 2.670526e+38} {Lucinda 1412367049 1.0427679e+38} {Santino 1631045574 2.2573786e+38} {Dawn -924758850 4.249854e+37} {Alice -937677379 1.0573345e+38}]
func Snack ¶
func Snack() string
Snack will return a random snack name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Snack())
// Output: Hoisin marinated wing pieces
}
Hoisin marinated wing pieces
func State ¶
func State() string
State will generate a random state string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(State())
// Output: Hawaii
}
Hawaii
func StateAbr ¶
func StateAbr() string
StateAbr will generate a random abbreviated state string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(StateAbr())
// Output: CO
}
CO
func Street ¶
func Street() string
Street will generate a random address street string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Street())
// Output: 364 Unions ville
}
364 Unions ville
func StreetName ¶
func StreetName() string
StreetName will generate a random address street name string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(StreetName())
// Output: View
}
View
func StreetNumber ¶
func StreetNumber() string
StreetNumber will generate a random address street number string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(StreetNumber())
// Output: 13645
}
13645
func StreetPrefix ¶
func StreetPrefix() string
StreetPrefix will generate a random address street prefix string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(StreetPrefix())
// Output: Lake
}
Lake
func StreetSuffix ¶
func StreetSuffix() string
StreetSuffix will generate a random address street suffix string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(StreetSuffix())
// Output: land
}
land
func Struct ¶
func Struct(v interface{}) error
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.
Code:
Output: Code:
Output: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"`
Array []string `fakesize:"2"`
Map map[string]string `fakesize:"2"`
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.Array)
fmt.Printf("%v\n", f.Map)
fmt.Printf("%+v\n", f.Bar)
// Output: bRMaRx
// -605057214
// 1412367049
// Andre
// 1
// <nil>
// [PtapWYJdn MKgtlxwnq]
// map[qanPAKaXS:QFpZysVaHG qclaYkWw:oRLOPxLIok]
// {Name:yvqqdH Number:-356428491 Float:2.8838284e+38}
}
bRMaRx
-605057214
1412367049
Andre
1
<nil>
[PtapWYJdn MKgtlxwnq]
map[qanPAKaXS:QFpZysVaHG qclaYkWw:oRLOPxLIok]
{Name:yvqqdH Number:-356428491 Float:2.8838284e+38}
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"`
}
var fm FooMany
Struct(&fm)
fmt.Printf("%v\n", fm.Foos)
fmt.Printf("%v\n", fm.Names)
// Output:
// [{bRMaRx -605057214 Paolo 4 <nil>}]
// [Santino Carole Enrique]
}
[{bRMaRx -605057214 Paolo 4 <nil>}]
[Santino Carole Enrique]
func Teams ¶
Teams takes in an array of people and team names and randomly places the people into teams as evenly as possible
Code:
Output: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:[Fabian Connor Steve] Team 2:[Jeff Sharon Justin] Team 3:[Robert Billy]]
}
map[Team 1:[Fabian Connor Steve] Team 2:[Jeff Sharon Justin] Team 3:[Robert Billy]]
func TimeZone ¶
func TimeZone() string
TimeZone will select a random timezone string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(TimeZone())
// Output: Kaliningrad Standard Time
}
Kaliningrad Standard Time
func TimeZoneAbv ¶
func TimeZoneAbv() string
TimeZoneAbv will select a random timezone abbreviation string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(TimeZoneAbv())
// Output: KST
}
KST
func TimeZoneFull ¶
func TimeZoneFull() string
TimeZoneFull will select a random full timezone string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(TimeZoneFull())
// Output: (UTC+03:00) Kaliningrad, Minsk
}
(UTC+03:00) Kaliningrad, Minsk
func TimeZoneOffset ¶
func TimeZoneOffset() float32
TimeZoneOffset will select a random timezone offset
Code:
Output:Example¶
{
Seed(11)
fmt.Println(TimeZoneOffset())
// Output: 3
}
3
func TimeZoneRegion ¶
func TimeZoneRegion() string
TimeZoneRegion will select a random region style timezone string, e.g. "America/Chicago"
Code:
Output:Example¶
{
Seed(11)
fmt.Println(TimeZoneRegion())
// Output: America/Vancouver
}
America/Vancouver
func URL ¶
func URL() string
URL will generate a random url string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(URL())
// Output: https://www.dynamiciterate.name/target/seamless
}
https://www.dynamiciterate.name/target/seamless
func UUID ¶
func UUID() string
UUID (version 4) will generate a random unique identifier based upon random numbers
Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Code:
Output:Example¶
{
Seed(11)
fmt.Println(UUID())
// Output: 590c1440-9888-45b0-bd51-a817ee07c3f2
}
590c1440-9888-45b0-bd51-a817ee07c3f2
func Uint16 ¶
func Uint16() uint16
Uint16 will generate a random uint16 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Uint16())
// Output: 34968
}
34968
func Uint32 ¶
func Uint32() uint32
Uint32 will generate a random uint32 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Uint32())
// Output: 1075055705
}
1075055705
func Uint64 ¶
func Uint64() uint64
Uint64 will generate a random uint64 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Uint64())
// Output: 10067102729548074073
}
10067102729548074073
func Uint8 ¶
func Uint8() uint8
Uint8 will generate a random uint8 value
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Uint8())
// Output: 152
}
152
func UintRange ¶
UintRange will generate a random uint value between min and max
Code:
Output:Example¶
{
Seed(11)
fmt.Println(UintRange(1, 10))
// Output: 1
}
1
func UserAgent ¶
func UserAgent() string
UserAgent will generate a random broswer user agent
Code:
Output:Example¶
{
Seed(11)
fmt.Println(UserAgent())
// Output: Mozilla/5.0 (Windows NT 5.0) AppleWebKit/5312 (KHTML, like Gecko) Chrome/40.0.800.0 Mobile Safari/5312
}
Mozilla/5.0 (Windows NT 5.0) AppleWebKit/5312 (KHTML, like Gecko) Chrome/40.0.800.0 Mobile Safari/5312
func Username ¶
func Username() string
Username will generate a random username based upon picking a random lastname and random numbers at the end
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Username())
// Output: Daniel1364
}
Daniel1364
func Vegetable ¶
func Vegetable() string
Vegetable will return a random vegetable name
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Vegetable())
// Output: Amaranth Leaves
}
Amaranth Leaves
func Verb ¶
func Verb() string
Verb will generate a random verb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Verb())
// Output: does
}
does
func VerbAction ¶
func VerbAction() string
VerbAction will generate a random action verb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(VerbAction())
// Output: close
}
close
func VerbHelping ¶
func VerbHelping() string
VerbHelping will generate a random helping verb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(VerbHelping())
// Output: be
}
be
func VerbIntransitive ¶
func VerbIntransitive() string
VerbIntransitive will generate a random intransitive verb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(VerbIntransitive())
// Output: laugh
}
laugh
func VerbLinking ¶
func VerbLinking() string
VerbLinking will generate a random linking verb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(VerbLinking())
// Output: was
}
was
func VerbTransitive ¶
func VerbTransitive() string
VerbTransitive will generate a random transitive verb
Code:
Output:Example¶
{
Seed(11)
fmt.Println(VerbTransitive())
// Output: follow
}
follow
func WeekDay ¶
func WeekDay() string
WeekDay will generate a random weekday string (Monday-Sunday)
Code:
Output:Example¶
{
Seed(11)
fmt.Println(WeekDay())
// Output: Tuesday
}
Tuesday
func Weighted ¶
Weighted will take in an array of options and weights and return a random selection based upon its indexed weight
Code:
Output:Example¶
{
Seed(11)
options := []interface{}{"hello", 2, 6.9}
weights := []float32{1, 2, 3}
option, _ := Weighted(options, weights)
fmt.Println(option)
// Output: hello
}
hello
func Word ¶
func Word() string
Word will generate a random word
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Word())
// Output: there
}
there
func XML ¶
func XML(xo *XMLOptions) ([]byte, error)
XML generates an object or an array of objects in json format
Code:
Output: Code:
Output: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>Markus</first_name>
// <last_name>Moen</last_name>
// <password>Dc0VYXjkWABx</password>
// </record>
// <record>
// <first_name>Osborne</first_name>
// <last_name>Hilll</last_name>
// <password>XPJ9OVNbs5lm</password>
// </record>
// </xml>
}
<xml>
<record>
<first_name>Markus</first_name>
<last_name>Moen</last_name>
<password>Dc0VYXjkWABx</password>
</record>
<record>
<first_name>Osborne</first_name>
<last_name>Hilll</last_name>
<password>XPJ9OVNbs5lm</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>Markus</first_name>
// <last_name>Moen</last_name>
// <password>Dc0VYXjkWABx</password>
// </xml>
}
<xml>
<first_name>Markus</first_name>
<last_name>Moen</last_name>
<password>Dc0VYXjkWABx</password>
</xml>
func Year ¶
func Year() int
Year will generate a random year between 1900 - current year
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Year())
// Output: 1995
}
1995
func Zip ¶
func Zip() string
Zip will generate a random Zip code string
Code:
Output:Example¶
{
Seed(11)
fmt.Println(Zip())
// Output: 13645
}
13645
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
Code:
Output: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: 364 Unions ville, Norfolk, Ohio 99536
// 364 Unions ville
// Norfolk
// Ohio
// 99536
// Lesotho
// 88.792592
// 174.504681
}
364 Unions ville, Norfolk, Ohio 99536
364 Unions ville
Norfolk
Ohio
99536
Lesotho
88.792592
174.504681
type CSVOptions ¶
type CSVOptions struct { Delimiter string `json:"delimiter" xml:"delimiter"` RowCount int `json:"row_count" xml:"row_count"` Fields []Field `json:"fields" xml:"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
Code:
Output: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: Fiat
// Gasoline
// Freestyle Fwd
// Automatic
// Passenger car mini
// 1989
}
Fiat
Gasoline
Freestyle Fwd
Automatic
Passenger car mini
1989
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
Code:
Output:Example¶
{
Seed(11)
contact := Contact()
fmt.Println(contact.Phone)
fmt.Println(contact.Email)
// Output: 6136459948
// carolecarroll@bosco.com
}
6136459948
carolecarroll@bosco.com
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
Code:
Output:Example¶
{
Seed(11)
ccInfo := CreditCard()
fmt.Println(ccInfo.Type)
fmt.Println(ccInfo.Number)
fmt.Println(ccInfo.Exp)
fmt.Println(ccInfo.Cvv)
// Output:
// UnionPay
// 4364599489953698
// 02/23
// 300
}
UnionPay
4364599489953698
02/23
300
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
Code:
Output:Example¶
{
Seed(11)
currency := Currency()
fmt.Printf("%s - %s", currency.Short, currency.Long)
// Output: IQD - Iraq Dinar
}
IQD - Iraq Dinar
type Faker ¶
Faker struct is the primary struct for using localized.
func New ¶
New will utilize math/rand for concurrent random usage.
Setting seed to 0 will use crypto/rand for the initial seed number.
Code:
Output:Example¶
{
// Create new pseudo random faker struct and set initial seed
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: Markus Moen
// Email: alaynawuckert@kozey.biz
// Phone: 9948995369
}
Name: Markus Moen
Email: alaynawuckert@kozey.biz
Phone: 9948995369
func NewCrypto ¶
func NewCrypto() *Faker
NewCrypto will utilize crypto/rand for concurrent random usage.
Code:
Example¶
{
// Create new crypto faker struct
fake := NewCrypto()
// 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())
// Cannot output example as crypto/rand cant be predicted
}
func NewCustom ¶
NewCustom will utilize a custom rand.Source64 for concurrent random usage
See https://golang.org/src/math/rand/rand.go for required interface methods
Code:
Output:Example¶
{
// Setup stuct and methods required to meet interface needs
// type customRand struct {}
// func (c *customRand) Seed(seed int64) {}
// func (c *customRand) Uint64() uint64 { return 8675309 }
// func (c *customRand) Int63() int64 { return int64(c.Uint64() & ^uint64(1<<63)) }
// Create new custom faker struct
fake := NewCustom(&customRand{})
// 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: Aaliyah Abbott
// Email: aaliyahabbott@abbott.com
// Phone: 1000000000
}
Name: Aaliyah Abbott
Email: aaliyahabbott@abbott.com
Phone: 1000000000
func NewUnlocked ¶
NewUnlocked will utilize math/rand for non concurrent safe random usage.
Setting seed to 0 will use crypto/rand for the initial seed number.
NewUnlocked is more performant but not safe to run concurrently.
Code:
Output:Example¶
{
fake := NewUnlocked(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: Markus Moen
// Email: alaynawuckert@kozey.biz
// Phone: 9948995369
}
Name: Markus Moen
Email: alaynawuckert@kozey.biz
Phone: 9948995369
func (*Faker) AchAccount ¶
AchAccount will generate a 12 digit account number
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AchAccount())
// Output: 413645994899
}
413645994899
func (*Faker) AchRouting ¶
AchRouting will generate a 9 digit routing number
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AchRouting())
// Output: 713645994
}
713645994
func (*Faker) Address ¶
func (f *Faker) Address() *AddressInfo
Address will generate a struct of address information
Code:
Output: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: 364 Unions ville, Norfolk, Ohio 99536
// 364 Unions ville
// Norfolk
// Ohio
// 99536
// Lesotho
// 88.792592
// 174.504681
}
364 Unions ville, Norfolk, Ohio 99536
364 Unions ville
Norfolk
Ohio
99536
Lesotho
88.792592
174.504681
func (*Faker) Adjective ¶
Adjective will generate a random adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Adjective())
// Output: Dutch
}
Dutch
func (*Faker) AdjectiveDemonstrative ¶
AdjectiveDemonstrative will generate a random demonstrative adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdjectiveDemonstrative())
// Output: this
}
this
func (*Faker) AdjectiveDescriptive ¶
AdjectiveDescriptive will generate a random descriptive adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdjectiveDescriptive())
// Output: brave
}
brave
func (*Faker) AdjectiveIndefinite ¶
AdjectiveIndefinite will generate a random indefinite adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdjectiveIndefinite())
// Output: few
}
few
func (*Faker) AdjectiveInterrogative ¶
AdjectiveInterrogative will generate a random interrogative adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdjectiveInterrogative())
// Output: what
}
what
func (*Faker) AdjectivePossessive ¶
AdjectivePossessive will generate a random possessive adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdjectivePossessive())
// Output: our
}
our
func (*Faker) AdjectiveProper ¶
AdjectiveProper will generate a random proper adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdjectiveProper())
// Output: Afghan
}
Afghan
func (*Faker) AdjectiveQuantitative ¶
AdjectiveQuantitative will generate a random quantitative adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdjectiveQuantitative())
// Output: a little
}
a little
func (*Faker) Adverb ¶
Adverb will generate a random adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Adverb())
// Output: over
}
over
func (*Faker) AdverbDegree ¶
AdverbDegree will generate a random degree adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdverbDegree())
// Output: intensely
}
intensely
func (*Faker) AdverbFrequencyDefinite ¶
AdverbFrequencyDefinite will generate a random frequency definite adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdverbFrequencyDefinite())
// Output: hourly
}
hourly
func (*Faker) AdverbFrequencyIndefinite ¶
AdverbFrequencyIndefinite will generate a random frequency indefinite adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdverbFrequencyIndefinite())
// Output: occasionally
}
occasionally
func (*Faker) AdverbManner ¶
AdverbManner will generate a random manner adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdverbManner())
// Output: stupidly
}
stupidly
func (*Faker) AdverbPlace ¶
AdverbPlace will generate a random place adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdverbPlace())
// Output: east
}
east
func (*Faker) AdverbTimeDefinite ¶
AdverbTimeDefinite will generate a random time definite adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdverbTimeDefinite())
// Output: now
}
now
func (*Faker) AdverbTimeIndefinite ¶
AdverbTimeIndefinite will generate a random time indefinite adverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AdverbTimeIndefinite())
// Output: already
}
already
func (*Faker) Animal ¶
Animal will return a random animal
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Animal())
// Output: elk
}
elk
func (*Faker) AnimalType ¶
AnimalType will return a random animal type
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AnimalType())
// Output: amphibians
}
amphibians
func (*Faker) AppAuthor ¶
AppAuthor will generate a random company or person name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AppAuthor())
// Output: Marcel Pagac
}
Marcel Pagac
func (*Faker) AppName ¶
AppName will generate a random app name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AppName())
// Output: Oxbeing
}
Oxbeing
func (*Faker) AppVersion ¶
AppVersion will generate a random app version
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.AppVersion())
// Output: 1.17.20
}
1.17.20
func (*Faker) BS ¶
BS will generate a random company bs string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BS())
// Output: front-end
}
front-end
func (*Faker) BeerAlcohol ¶
BeerAlcohol will return a random beer alcohol level between 2.0 and 10.0
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerAlcohol())
// Output: 2.7%
}
2.7%
func (*Faker) BeerBlg ¶
BeerBlg will return a random beer blg between 5.0 and 20.0
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerBlg())
// Output: 6.4°Blg
}
6.4°Blg
func (*Faker) BeerHop ¶
BeerHop will return a random beer hop
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerHop())
// Output: Glacier
}
Glacier
func (*Faker) BeerIbu ¶
BeerIbu will return a random beer ibu value between 10 and 100
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerIbu())
// Output: 47 IBU
}
47 IBU
func (*Faker) BeerMalt ¶
BeerMalt will return a random beer malt
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerMalt())
// Output: Munich
}
Munich
func (*Faker) BeerName ¶
BeerName will return a random beer name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerName())
// Output: Duvel
}
Duvel
func (*Faker) BeerStyle ¶
BeerStyle will return a random beer style
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerStyle())
// Output: European Amber Lager
}
European Amber Lager
func (*Faker) BeerYeast ¶
BeerYeast will return a random beer yeast
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BeerYeast())
// Output: 1388 - Belgian Strong Ale
}
1388 - Belgian Strong Ale
func (*Faker) BitcoinAddress ¶
BitcoinAddress will generate a random bitcoin address consisting of numbers, upper and lower characters
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BitcoinAddress())
// Output: 1lYcxjqWkJWv7cLADX0q6BIXbVXHo6jV
}
1lYcxjqWkJWv7cLADX0q6BIXbVXHo6jV
func (*Faker) BitcoinPrivateKey ¶
BitcoinPrivateKey will generate a random bitcoin private key base58 consisting of numbers, upper and lower characters
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BitcoinPrivateKey())
// Output: 5KWjEJ7SnBNJyDjdPUjLuYByYzM9rG1trax8c2NTSBtv7YtR57v
}
5KWjEJ7SnBNJyDjdPUjLuYByYzM9rG1trax8c2NTSBtv7YtR57v
func (*Faker) Bool ¶
Bool will generate a random boolean value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Bool())
// Output: true
}
true
func (*Faker) Breakfast ¶
Breakfast will return a random breakfast name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Breakfast())
// Output: Blueberry banana happy face pancakes
}
Blueberry banana happy face pancakes
func (*Faker) BuzzWord ¶
BuzzWord will generate a random company buzz word string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.BuzzWord())
// Output: disintermediate
}
disintermediate
func (*Faker) CSV ¶
func (f *Faker) CSV(co *CSVOptions) ([]byte, error)
CSV generates an object or an array of objects in json format
Code:
Output: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,Markus,Moen,Dc0VYXjkWABx
// 2,Osborne,Hilll,XPJ9OVNbs5lm
// 3,Mertie,Halvorson,eyl3bhwfV8wA
}
id,first_name,last_name,password
1,Markus,Moen,Dc0VYXjkWABx
2,Osborne,Hilll,XPJ9OVNbs5lm
3,Mertie,Halvorson,eyl3bhwfV8wA
func (*Faker) Car ¶
Car will generate a struct with car information
Code:
Output: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: Fiat
// Gasoline
// Freestyle Fwd
// Automatic
// Passenger car mini
// 1989
}
Fiat
Gasoline
Freestyle Fwd
Automatic
Passenger car mini
1989
func (*Faker) CarFuelType ¶
CarFuelType will return a random fuel type
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CarFuelType())
// Output: CNG
}
CNG
func (*Faker) CarMaker ¶
CarMaker will return a random car maker
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CarMaker())
// Output: Nissan
}
Nissan
func (*Faker) CarModel ¶
CarModel will return a random car model
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CarModel())
// Output: Aveo
}
Aveo
func (*Faker) CarTransmissionType ¶
CarTransmissionType will return a random transmission type
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CarTransmissionType())
// Output: Manual
}
Manual
func (*Faker) CarType ¶
CarType will generate a random car type string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CarType())
// Output: Passenger car mini
}
Passenger car mini
func (*Faker) Cat ¶
Cat will return a random cat breed
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Cat())
// Output: Sokoke
}
Sokoke
func (*Faker) CelebrityActor ¶
CelebrityActor will generate a random celebrity actor
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CelebrityActor())
// Output: Owen Wilson
}
Owen Wilson
func (*Faker) CelebrityBusiness ¶
CelebrityBusiness will generate a random celebrity business person
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CelebrityBusiness())
// Output: Cameron Diaz
}
Cameron Diaz
func (*Faker) CelebritySport ¶
CelebritySport will generate a random celebrity sport person
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CelebritySport())
// Output: Hicham El Guerrouj
}
Hicham El Guerrouj
func (*Faker) ChromeUserAgent ¶
ChromeUserAgent will generate a random chrome browser user agent string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ChromeUserAgent())
// Output: Mozilla/5.0 (X11; Linux i686) AppleWebKit/5360 (KHTML, like Gecko) Chrome/40.0.889.0 Mobile Safari/5360
}
Mozilla/5.0 (X11; Linux i686) AppleWebKit/5360 (KHTML, like Gecko) Chrome/40.0.889.0 Mobile Safari/5360
func (*Faker) City ¶
City will generate a random city string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.City())
// Output: Plano
}
Plano
func (*Faker) Color ¶
Color will generate a random color string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Color())
// Output: MediumOrchid
}
MediumOrchid
func (*Faker) Company ¶
Company will generate a random company name string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Company())
// Output: ClearHealthCosts
}
ClearHealthCosts
func (*Faker) CompanySuffix ¶
CompanySuffix will generate a random company suffix string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CompanySuffix())
// Output: Inc
}
Inc
func (*Faker) Connective ¶
Connective will generate a random connective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Connective())
// Output: such as
}
such as
func (*Faker) ConnectiveCasual ¶
ConnectiveCasual will generate a random casual connective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ConnectiveCasual())
// Output: an outcome of
}
an outcome of
func (*Faker) ConnectiveComparitive ¶
ConnectiveComparitive will generate a random comparative connective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ConnectiveComparitive())
// Output: in addition
}
in addition
func (*Faker) ConnectiveComplaint ¶
ConnectiveComplaint will generate a random complaint connective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ConnectiveComplaint())
// Output: besides
}
besides
func (*Faker) ConnectiveExamplify ¶
ConnectiveExamplify will generate a random examplify connective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ConnectiveExamplify())
// Output: then
}
then
func (*Faker) ConnectiveListing ¶
ConnectiveListing will generate a random listing connective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ConnectiveListing())
// Output: firstly
}
firstly
func (*Faker) ConnectiveTime ¶
Example¶
Code:
{
f := New(11)
fmt.Println(f.ConnectiveTime())
// Output: finally
}
Output:
finally
func (*Faker) Contact ¶
func (f *Faker) Contact() *ContactInfo
Contact will generate a struct with information randomly populated contact information
Code:
Output:Example¶
{
f := New(11)
contact := f.Contact()
fmt.Println(contact.Phone)
fmt.Println(contact.Email)
// Output: 6136459948
// carolecarroll@bosco.com
}
6136459948
carolecarroll@bosco.com
func (*Faker) Country ¶
Country will generate a random country string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Country())
// Output: Cabo Verde
}
Cabo Verde
func (*Faker) CountryAbr ¶
CountryAbr will generate a random abbreviated country string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CountryAbr())
// Output: CV
}
CV
func (*Faker) CreditCard ¶
func (f *Faker) CreditCard() *CreditCardInfo
CreditCard will generate a struct full of credit card information
Code:
Output:Example¶
{
f := New(11)
ccInfo := f.CreditCard()
fmt.Println(ccInfo.Type)
fmt.Println(ccInfo.Number)
fmt.Println(ccInfo.Exp)
fmt.Println(ccInfo.Cvv)
// Output:
// UnionPay
// 4364599489953698
// 02/23
// 300
}
UnionPay
4364599489953698
02/23
300
func (*Faker) CreditCardCvv ¶
CreditCardCvv will generate a random CVV number
Its a string because you could have 017 as an exp date
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CreditCardCvv())
// Output: 513
}
513
func (*Faker) CreditCardExp ¶
CreditCardExp will generate a random credit card expiration date string
Exp date will always be a future date
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CreditCardExp())
// Output: 06/29
}
06/29
func (*Faker) CreditCardNumber ¶
func (f *Faker) CreditCardNumber(cco *CreditCardOptions) string
CreditCardNumber will generate a random luhn credit card number
Code:
Output: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:
// 4136459948995375
// 4635300425914586
// 4111232020276132
// 3054 800889 9827
}
4136459948995375
4635300425914586
4111232020276132
3054 800889 9827
func (*Faker) CreditCardType ¶
CreditCardType will generate a random credit card type string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CreditCardType())
// Output: Visa
}
Visa
func (*Faker) Currency ¶
func (f *Faker) Currency() *CurrencyInfo
Currency will generate a struct with random currency information
Code:
Output:Example¶
{
f := New(11)
currency := f.Currency()
fmt.Printf("%s - %s", currency.Short, currency.Long)
// Output: IQD - Iraq Dinar
}
IQD - Iraq Dinar
func (*Faker) CurrencyLong ¶
CurrencyLong will generate a random long currency name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CurrencyLong())
// Output: Iraq Dinar
}
Iraq Dinar
func (*Faker) CurrencyShort ¶
CurrencyShort will generate a random short currency value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.CurrencyShort())
// Output: IQD
}
IQD
func (*Faker) Date ¶
Date will generate a random time.Time struct
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Date())
// Output: 1995-01-24 13:00:35.820738079 +0000 UTC
}
1995-01-24 13:00:35.820738079 +0000 UTC
func (*Faker) DateRange ¶
DateRange will generate a random time.Time struct between a start and end date
Code:
Output: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-02-04 14:10:37.166933216 +0000 UTC
}
2012-02-04 14:10:37.166933216 +0000 UTC
func (*Faker) Day ¶
Day will generate a random day between 1 - 31
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Day())
// Output: 23
}
23
func (*Faker) Dessert ¶
Dessert will return a random dessert name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Dessert())
// Output: French napoleons
}
French napoleons
func (*Faker) Digit ¶
Digit will generate a single ASCII digit
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Digit())
// Output: 0
}
0
func (*Faker) DigitN ¶
DigitN will generate a random string of length N consists of ASCII digits (note it can start with 0).
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.DigitN(10))
// Output: 0136459948
}
0136459948
func (*Faker) Dinner ¶
Dinner will return a random dinner name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Dinner())
// Output: Wild addicting dip
}
Wild addicting dip
func (*Faker) Dog ¶
Dog will return a random dog breed
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Dog())
// Output: Norwich Terrier
}
Norwich Terrier
func (*Faker) DomainName ¶
DomainName will generate a random url domain name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.DomainName())
// Output: centraltarget.biz
}
centraltarget.biz
func (*Faker) DomainSuffix ¶
DomainSuffix will generate a random domain suffix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.DomainSuffix())
// Output: org
}
org
func (*Faker) Email ¶
Email will generate a random email string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Email())
// Output: markusmoen@pagac.net
}
markusmoen@pagac.net
func (*Faker) Emoji ¶
Emoji will return a random fun emoji
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Emoji())
// Output: 🧛
}
🧛
func (*Faker) EmojiAlias ¶
EmojiAlias will return a random fun emoji alias
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.EmojiAlias())
// Output: deaf_person
}
deaf_person
func (*Faker) EmojiCategory ¶
EmojiCategory will return a random fun emoji category
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.EmojiCategory())
// Output: Food & Drink
}
Food & Drink
func (*Faker) EmojiDescription ¶
EmojiDescription will return a random fun emoji description
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.EmojiDescription())
// Output: confetti ball
}
confetti ball
func (*Faker) EmojiTag ¶
EmojiTag will return a random fun emoji tag
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.EmojiTag())
// Output: strong
}
strong
func (*Faker) FarmAnimal ¶
FarmAnimal will return a random animal that usually lives on a farm
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.FarmAnimal())
// Output: Chicken
}
Chicken
func (*Faker) FileExtension ¶
FileExtension will generate a random file extension
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.FileExtension())
// Output: nes
}
nes
func (*Faker) FileMimeType ¶
FileMimeType will generate a random mime file type
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.FileMimeType())
// Output: application/dsptype
}
application/dsptype
func (*Faker) FirefoxUserAgent ¶
FirefoxUserAgent will generate a random firefox broswer user agent string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.FirefoxUserAgent())
// Output: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_9_10 rv:7.0) Gecko/1995-24-01 Firefox/36.0
}
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_9_10 rv:7.0) Gecko/1995-24-01 Firefox/36.0
func (*Faker) FirstName ¶
FirstName will generate a random first name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.FirstName())
// Output: Markus
}
Markus
func (*Faker) FlipACoin ¶
FlipACoin will return a random value of Heads or Tails
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.FlipACoin())
// Output: Heads
}
Heads
func (*Faker) Float32 ¶
Float32 will generate a random float32 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Float32())
// Output: 3.1128167e+37
}
3.1128167e+37
func (*Faker) Float32Range ¶
Float32Range will generate a random float32 value between min and max
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Float32Range(0, 9999999))
// Output: 914774.6
}
914774.6
func (*Faker) Float64 ¶
Float64 will generate a random float64 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Float64())
// Output: 1.644484108270445e+307
}
1.644484108270445e+307
func (*Faker) Float64Range ¶
Float64Range will generate a random float64 value between min and max
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Float64Range(0, 9999999))
// Output: 914774.5585333086
}
914774.5585333086
func (*Faker) Fruit ¶
Fruit will return a random fruit name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Fruit())
// Output: Peach
}
Peach
func (*Faker) Gamertag ¶
Gamertag will generate a random video game username
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Gamertag())
// Output: PurpleSheep5
}
PurpleSheep5
func (*Faker) Gender ¶
Gender will generate a random gender string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Gender())
// Output: male
}
male
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
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Generate("{firstname} {lastname} ssn is {ssn} and lives at {street}"))
fmt.Println(f.Generate("{sentence:3}"))
fmt.Println(f.Generate("{shuffleints:[1,2,3]}"))
fmt.Println(f.Generate("{number:1,50}"))
fmt.Println(f.Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}"))
// Output: Markus Moen ssn is 526643139 and lives at 599 Dale ton
// Niche backwards caused.
// [1 3 2]
// 27
// [a:b key:value int:string 1:2]
}
Markus Moen ssn is 526643139 and lives at 599 Dale ton
Niche backwards caused.
[1 3 2]
27
[a:b key:value int:string 1:2]
func (*Faker) HTTPMethod ¶
HTTPMethod will generate a random http method
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HTTPMethod())
// Output: HEAD
}
HEAD
func (*Faker) HTTPStatusCode ¶
HTTPStatusCode will generate a random status code
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HTTPStatusCode())
// Output: 404
}
404
func (*Faker) HTTPStatusCodeSimple ¶
HTTPStatusCodeSimple will generate a random simple status code
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HTTPStatusCodeSimple())
// Output: 200
}
200
func (*Faker) HTTPVersion ¶
HTTPVersion will generate a random http version
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HTTPVersion())
// Output: HTTP/1.0
}
HTTP/1.0
func (*Faker) HackerAbbreviation ¶
HackerAbbreviation will return a random hacker abbreviation
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HackerAbbreviation())
// Output: ADP
}
ADP
func (*Faker) HackerAdjective ¶
HackerAdjective will return a random hacker adjective
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HackerAdjective())
// Output: wireless
}
wireless
func (*Faker) HackerNoun ¶
HackerNoun will return a random hacker noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HackerNoun())
// Output: driver
}
driver
func (*Faker) HackerPhrase ¶
HackerPhrase will return a random hacker sentence
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HackerPhrase())
// Output: If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!
}
If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!
func (*Faker) HackerVerb ¶
HackerVerb will return a random hacker verb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HackerVerb())
// Output: synthesize
}
synthesize
func (*Faker) HackeringVerb ¶
HackeringVerb will return a random hacker ingverb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HackeringVerb())
// Output: connecting
}
connecting
func (*Faker) HexColor ¶
HexColor will generate a random hexadecimal color string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HexColor())
// Output: #a99fb4
}
#a99fb4
func (*Faker) HexUint128 ¶
HexUint128 will generate a random uint128 hex value with "0x" prefix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HexUint128())
// Output: 0x875469578e51b5e56c95b64681d147a1
}
0x875469578e51b5e56c95b64681d147a1
func (*Faker) HexUint16 ¶
HexUint16 will generate a random uint16 hex value with "0x" prefix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HexUint16())
// Output: 0x8754
}
0x8754
func (*Faker) HexUint256 ¶
HexUint256 will generate a random uint256 hex value with "0x" prefix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HexUint256())
// Output: 0x875469578e51b5e56c95b64681d147a12cde48a4f417231b0c486abbc263e48d
}
0x875469578e51b5e56c95b64681d147a12cde48a4f417231b0c486abbc263e48d
func (*Faker) HexUint32 ¶
HexUint32 will generate a random uint32 hex value with "0x" prefix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HexUint32())
// Output: 0x87546957
}
0x87546957
func (*Faker) HexUint64 ¶
HexUint64 will generate a random uint64 hex value with "0x" prefix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HexUint64())
// Output: 0x875469578e51b5e5
}
0x875469578e51b5e5
func (*Faker) HexUint8 ¶
HexUint8 will generate a random uint8 hex value with "0x" prefix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HexUint8())
// Output: 0x87
}
0x87
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
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HipsterParagraph(3, 5, 12, "\n"))
// Output: Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.
// Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.
// Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.
}
Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.
Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.
Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.
func (*Faker) HipsterSentence ¶
HipsterSentence will generate a random sentence
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HipsterSentence(5))
// Output: Microdosing roof chia echo pickled.
}
Microdosing roof chia echo pickled.
func (*Faker) HipsterWord ¶
HipsterWord will return a single hipster word
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.HipsterWord())
// Output: microdosing
}
microdosing
func (*Faker) Hobby ¶
Hobby will generate a random hobby string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Hobby())
// Output: Transit map collecting
}
Transit map collecting
func (*Faker) Hour ¶
Hour will generate a random hour - in military time
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Hour())
// Output: 17
}
17
func (*Faker) IPv4Address ¶
IPv4Address will generate a random version 4 ip address
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.IPv4Address())
// Output: 152.23.53.100
}
152.23.53.100
func (*Faker) IPv6Address ¶
IPv6Address will generate a random version 6 ip address
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.IPv6Address())
// Output: 8898:ee17:bc35:9064:5866:d019:3b95:7857
}
8898:ee17:bc35:9064:5866:d019:3b95:7857
func (*Faker) Image ¶
Image generates a random rgba image
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Image(1, 1))
// Output: &{[89 176 195 255] 4 (0,0)-(1,1)}
}
&{[89 176 195 255] 4 (0,0)-(1,1)}
func (*Faker) ImageJpeg ¶
ImageJpeg generates a random rgba jpeg image
Code:
Output: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 216 162 138 43 213 62 92 255 217]
}
[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 216 162 138 43 213 62 92 255 217]
func (*Faker) ImagePng ¶
ImagePng generates a random rgba png image
Code:
Output: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 138 220 112 24 16 0 0 255 255 3 58 1 207 38 214 44 234 0 0 0 0 73 69 78 68 174 66 96 130]
}
[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 138 220 112 24 16 0 0 255 255 3 58 1 207 38 214 44 234 0 0 0 0 73 69 78 68 174 66 96 130]
func (*Faker) ImageURL ¶
ImageURL will generate a random Image Based Upon Height And Width. https://picsum.photos/
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ImageURL(640, 480))
// Output: https://picsum.photos/640/480
}
https://picsum.photos/640/480
func (*Faker) Int16 ¶
Int16 will generate a random int16 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Int16())
// Output: -29607
}
-29607
func (*Faker) Int32 ¶
Int32 will generate a random int32 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Int32())
// Output: -1072427943
}
-1072427943
func (*Faker) Int64 ¶
Int64 will generate a random int64 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Int64())
// Output: -1072427943
}
-1072427943
func (*Faker) Int8 ¶
Int8 will generate a random Int8 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Int8())
// Output: -39
}
-39
func (*Faker) IntRange ¶
IntRange will generate a random int value between min and max
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.IntRange(1, 10))
// Output: 6
}
6
func (*Faker) JSON ¶
func (f *Faker) JSON(jo *JSONOptions) ([]byte, error)
JSON generates an object or an array of objects in json format
Code:
Output: Code:
Output: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": "Markus",
// "last_name": "Moen",
// "password": "Dc0VYXjkWABx"
// },
// {
// "id": 2,
// "first_name": "Osborne",
// "last_name": "Hilll",
// "password": "XPJ9OVNbs5lm"
// },
// {
// "id": 3,
// "first_name": "Mertie",
// "last_name": "Halvorson",
// "password": "eyl3bhwfV8wA"
// }
// ]
}
[
{
"id": 1,
"first_name": "Markus",
"last_name": "Moen",
"password": "Dc0VYXjkWABx"
},
{
"id": 2,
"first_name": "Osborne",
"last_name": "Hilll",
"password": "XPJ9OVNbs5lm"
},
{
"id": 3,
"first_name": "Mertie",
"last_name": "Halvorson",
"password": "eyl3bhwfV8wA"
}
]
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": "Markus",
// "last_name": "Moen",
// "address": {
// "address": "4599 Dale ton, Norfolk, New Jersey 36906",
// "street": "4599 Dale ton",
// "city": "Norfolk",
// "state": "New Jersey",
// "zip": "36906",
// "country": "Tokelau",
// "latitude": 23.058758,
// "longitude": 89.022594
// },
// "password": "qjXy56JHcVlZ"
// }
}
{
"first_name": "Markus",
"last_name": "Moen",
"address": {
"address": "4599 Dale ton, Norfolk, New Jersey 36906",
"street": "4599 Dale ton",
"city": "Norfolk",
"state": "New Jersey",
"zip": "36906",
"country": "Tokelau",
"latitude": 23.058758,
"longitude": 89.022594
},
"password": "qjXy56JHcVlZ"
}
func (*Faker) Job ¶
Job will generate a struct with random job information
Code:
Output:Example¶
{
f := New(11)
jobInfo := f.Job()
fmt.Println(jobInfo.Company)
fmt.Println(jobInfo.Title)
fmt.Println(jobInfo.Descriptor)
fmt.Println(jobInfo.Level)
// Output: ClearHealthCosts
// Agent
// Future
// Tactics
}
ClearHealthCosts
Agent
Future
Tactics
func (*Faker) JobDescriptor ¶
JobDescriptor will generate a random job descriptor string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.JobDescriptor())
// Output: Central
}
Central
func (*Faker) JobLevel ¶
JobLevel will generate a random job level string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.JobLevel())
// Output: Assurance
}
Assurance
func (*Faker) JobTitle ¶
JobTitle will generate a random job title string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.JobTitle())
// Output: Director
}
Director
func (*Faker) Language ¶
Language will return a random language
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Language())
// Output: Kazakh
}
Kazakh
func (*Faker) LanguageAbbreviation ¶
LanguageAbbreviation will return a random language abbreviation
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LanguageAbbreviation())
// Output: kk
}
kk
func (*Faker) LanguageBCP ¶
LanguageBCP will return a random language BCP (Best Current Practices)
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LanguageBCP())
// Output: de-DE
}
de-DE
func (*Faker) LastName ¶
LastName will generate a random last name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LastName())
// Output: Daniel
}
Daniel
func (*Faker) Latitude ¶
Latitude will generate a random latitude float64
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Latitude())
// Output: -73.534057
}
-73.534057
func (*Faker) LatitudeInRange ¶
LatitudeInRange will generate a random latitude within the input range
Code:
Output:Example¶
{
f := New(11)
lat, _ := f.LatitudeInRange(21, 42)
fmt.Println(lat)
// Output: 22.921026
}
22.921026
func (*Faker) Letter ¶
Letter will generate a single random lower case ASCII letter
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Letter())
// Output: g
}
g
func (*Faker) LetterN ¶
LetterN will generate a random ASCII string with length N
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LetterN(10))
// Output: gbRMaRxHki
}
gbRMaRxHki
func (*Faker) Lexify ¶
Lexify will replace ? with random generated letters
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Lexify("?????"))
// Output: gbRMa
}
gbRMa
func (*Faker) LogLevel ¶
LogLevel will generate a random log level
See data/LogLevels for list of available levels
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LogLevel("")) // This will also use general
fmt.Println(f.LogLevel("syslog"))
fmt.Println(f.LogLevel("apache"))
// Output: error
// debug
// trace1-8
}
error
debug
trace1-8
func (*Faker) Longitude ¶
Longitude will generate a random longitude float64
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Longitude())
// Output: -147.068113
}
-147.068113
func (*Faker) LongitudeInRange ¶
LongitudeInRange will generate a random longitude within the input range
Code:
Output:Example¶
{
f := New(11)
long, _ := f.LongitudeInRange(-10, 10)
fmt.Println(long)
// Output: -8.170451
}
-8.170451
func (*Faker) LoremIpsumParagraph ¶
func (f *Faker) LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
LoremIpsumParagraph will generate a random paragraphGenerator
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LoremIpsumParagraph(3, 5, 12, "\n"))
// Output: Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.
// Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.
// Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.
}
Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.
Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.
Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.
func (*Faker) LoremIpsumSentence ¶
LoremIpsumSentence will generate a random sentence
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LoremIpsumSentence(5))
// Output: Quia quae repellat consequatur quidem.
}
Quia quae repellat consequatur quidem.
func (*Faker) LoremIpsumWord ¶
LoremIpsumWord will generate a random word
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.LoremIpsumWord())
// Output: quia
}
quia
func (*Faker) Lunch ¶
Lunch will return a random lunch name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Lunch())
// Output: No bake hersheys bar pie
}
No bake hersheys bar pie
func (*Faker) MacAddress ¶
MacAddress will generate a random mac address
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MacAddress())
// Output: e1:74:cb:01:77:91
}
e1:74:cb:01:77:91
func (*Faker) Map ¶
Map will generate a random set of map data
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Map())
// Output: map[contrast:Associate gauva:map[jump:scale] generally:8504801 him:[them whomever ours hence here his] its:8335564 table:map[did:[these delay these]] therefore:map[nearly:784141.8] thing:map[everything:[where caused why week hourly]]]
}
map[contrast:Associate gauva:map[jump:scale] generally:8504801 him:[them whomever ours hence here his] its:8335564 table:map[did:[these delay these]] therefore:map[nearly:784141.8] thing:map[everything:[where caused why week hourly]]]
func (*Faker) MinecraftAnimal ¶
MinecraftAnimal will generate a random Minecraft animal
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftAnimal())
// Output:
// chicken
}
chicken
func (*Faker) MinecraftArmorPart ¶
MinecraftArmorPart will generate a random Minecraft armor part
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftArmorPart())
// Output:
// helmet
}
helmet
func (*Faker) MinecraftArmorTier ¶
MinecraftArmorTier will generate a random Minecraft armor tier
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftArmorTier())
// Output:
// leather
}
leather
func (*Faker) MinecraftBiome ¶
MinecraftBiome will generate a random Minecraft biome
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftBiome())
// Output:
// stone shore
}
stone shore
func (*Faker) MinecraftDye ¶
MinecraftDye will generate a random Minecraft dye
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftDye())
// Output:
// light gray
}
light gray
func (*Faker) MinecraftFood ¶
MinecraftFood will generate a random Minecraft food
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftFood())
// Output:
// beetroot
}
beetroot
func (*Faker) MinecraftMobBoss ¶
MinecraftMobBoss will generate a random Minecraft mob boss
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftMobBoss())
// Output:
// ender dragon
}
ender dragon
func (*Faker) MinecraftMobHostile ¶
MinecraftMobHostile will generate a random Minecraft mob hostile
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftMobHostile())
// Output:
// blaze
}
blaze
func (*Faker) MinecraftMobNeutral ¶
MinecraftMobNeutral will generate a random Minecraft mob neutral
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftMobNeutral())
// Output:
// wolf
}
wolf
func (*Faker) MinecraftMobPassive ¶
MinecraftMobPassive will generate a random Minecraft mob passive
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftMobPassive())
// Output:
// chicken
}
chicken
func (*Faker) MinecraftOre ¶
MinecraftOre will generate a random Minecraft ore
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftOre())
// Output:
// coal
}
coal
func (*Faker) MinecraftTool ¶
MinecraftTool will generate a random Minecraft tool
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftTool())
// Output:
// pickaxe
}
pickaxe
func (*Faker) MinecraftVillagerJob ¶
MinecraftVillagerJob will generate a random Minecraft villager job
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftVillagerJob())
// Output:
// toolsmith
}
toolsmith
func (*Faker) MinecraftVillagerLevel ¶
MinecraftVillagerLevel will generate a random Minecraft villager level
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftVillagerLevel())
// Output:
// novice
}
novice
func (*Faker) MinecraftVillagerStation ¶
MinecraftVillagerStation will generate a random Minecraft villager station
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftVillagerStation())
// Output:
// cauldron
}
cauldron
func (*Faker) MinecraftWeapon ¶
MinecraftWeapon will generate a random Minecraft weapon
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftWeapon())
// Output:
// sword
}
sword
func (*Faker) MinecraftWeather ¶
MinecraftWeather will generate a random Minecraft weather
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftWeather())
// Output:
// clear
}
clear
func (*Faker) MinecraftWood ¶
MinecraftWood will generate a random Minecraft wood
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MinecraftWood())
// Output:
// oak
}
oak
func (*Faker) Minute ¶
Minute will generate a random minute
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Minute())
// Output: 5
}
5
func (*Faker) Month ¶
Month will generate a random month int
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Month())
// Output: 6
}
6
func (*Faker) MonthString ¶
MonthString will generate a random month string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.MonthString())
// Output: June
}
June
func (*Faker) Name ¶
Name will generate a random First and Last Name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Name())
// Output: Markus Moen
}
Markus Moen
func (*Faker) NamePrefix ¶
NamePrefix will generate a random name prefix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NamePrefix())
// Output: Mr.
}
Mr.
func (*Faker) NameSuffix ¶
NameSuffix will generate a random name suffix
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NameSuffix())
// Output: Jr.
}
Jr.
func (*Faker) NanoSecond ¶
NanoSecond will generate a random nano second
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NanoSecond())
// Output: 693298265
}
693298265
func (*Faker) Noun ¶
Noun will generate a random noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Noun())
// Output: aunt
}
aunt
func (*Faker) NounAbstract ¶
NounAbstract will generate a random abstract noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounAbstract())
// Output: confusion
}
confusion
func (*Faker) NounCollectiveAnimal ¶
NounCollectiveAnimal will generate a random collective noun animal
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounCollectiveAnimal())
// Output: party
}
party
func (*Faker) NounCollectivePeople ¶
NounCollectivePeople will generate a random collective noun person
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounCollectivePeople())
// Output: body
}
body
func (*Faker) NounCollectiveThing ¶
NounCollectiveThing will generate a random collective noun thing
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounCollectiveThing())
// Output: hand
}
hand
func (*Faker) NounCommon ¶
NounCommon will generate a random common noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounCommon())
// Output: part
}
part
func (*Faker) NounConcrete ¶
NounConcrete will generate a random concrete noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounConcrete())
// Output: snowman
}
snowman
func (*Faker) NounCountable ¶
NounCountable will generate a random countable noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounCountable())
// Output: neck
}
neck
func (*Faker) NounProper ¶
NounProper will generate a random proper noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounProper())
// Output: Marcel
}
Marcel
func (*Faker) NounUncountable ¶
NounUncountable will generate a random uncountable noun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.NounUncountable())
// Output: seafood
}
seafood
func (*Faker) Number ¶
Number will generate a random number between given min And max
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Number(50, 23456))
// Output: 12583
}
12583
func (*Faker) Numerify ¶
Numerify will replace # with random numerical values
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Numerify("###-###-####"))
// Output: 613-645-9948
}
613-645-9948
func (*Faker) OperaUserAgent ¶
OperaUserAgent will generate a random opera browser user agent string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.OperaUserAgent())
// Output: Opera/8.20 (Macintosh; U; PPC Mac OS X 10_9_10; en-US) Presto/2.9.198 Version/11.00
}
Opera/8.20 (Macintosh; U; PPC Mac OS X 10_9_10; en-US) Presto/2.9.198 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
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Paragraph(3, 5, 12, "\n"))
// Output: There had result everything niche backwards caused quarterly without week it hungry. Thing someone him regularly today whomever this revolt hence from his timing. As quantity us these yours live these frantic not may another how. This ours his them those whose them batch its Iraqi most that. Few abroad cheese this whereas next how there gorgeous genetics time choir.
// Fiction therefore yourselves am those infrequently heap software quarterly rather punctuation yellow. Where several his orchard to frequently hence victorious boxers each does auspicious. Yourselves first soup tomorrow this that must conclude anyway some yearly who. Cough laugh himself both yet rarely me dolphin intensely block would leap. Plane us first then down them eager would hundred super throughout animal.
// Yet themselves been group flock shake part purchase up usually it her. None it hers boat what their there Turkmen moreover one Lebanese to. Brace these shower in it everybody should whatever those uninterested several nobody. Yours thankful innocent power to any from its few luxury none boy. Religion themselves it there might must near theirs mine thing tonight outside.
}
There had result everything niche backwards caused quarterly without week it hungry. Thing someone him regularly today whomever this revolt hence from his timing. As quantity us these yours live these frantic not may another how. This ours his them those whose them batch its Iraqi most that. Few abroad cheese this whereas next how there gorgeous genetics time choir.
Fiction therefore yourselves am those infrequently heap software quarterly rather punctuation yellow. Where several his orchard to frequently hence victorious boxers each does auspicious. Yourselves first soup tomorrow this that must conclude anyway some yearly who. Cough laugh himself both yet rarely me dolphin intensely block would leap. Plane us first then down them eager would hundred super throughout animal.
Yet themselves been group flock shake part purchase up usually it her. None it hers boat what their there Turkmen moreover one Lebanese to. Brace these shower in it everybody should whatever those uninterested several nobody. Yours thankful innocent power to any from its few luxury none boy. Religion themselves it there might must near theirs mine thing tonight outside.
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.
Code:
Output: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: vodnqxzsuptgehrzylximvylxzoywexw
// ZSRQWJFJWCSTVGXKYKWMLIAFGFELFJRG
// 61718615932495608398906260648432
// @$,@#:,(,).{?:%?)>*..<=};#$(:{==
// CkF{wwb:?Kb},w?vdz{Zox C&>Prt99:
// j ;9X
}
vodnqxzsuptgehrzylximvylxzoywexw
ZSRQWJFJWCSTVGXKYKWMLIAFGFELFJRG
61718615932495608398906260648432
@$,@#:,(,).{?:%?)>*..<=};#$(:{==
CkF{wwb:?Kb},w?vdz{Zox C&>Prt99:
j ;9X
func (*Faker) Person ¶
func (f *Faker) Person() *PersonInfo
Person will generate a struct with person information
Code:
Output: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.Image)
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:
// Markus
// Moen
// male
// 275413589
// https://picsum.photos/300/300/people
// Morgan Stanley
// Associate
// Human
// Usability
// 99536 Pine mouth, Fremont, Indiana 30042
// 99536 Pine mouth
// Fremont
// Indiana
// 30042
// Madagascar
// -75.631793
// -83.487777
// 4583023202
// jalonrolfson@quigley.info
// Hiper
// 4011781714800889
// 09/26
// 272
}
Markus
Moen
male
275413589
https://picsum.photos/300/300/people
Morgan Stanley
Associate
Human
Usability
99536 Pine mouth, Fremont, Indiana 30042
99536 Pine mouth
Fremont
Indiana
30042
Madagascar
-75.631793
-83.487777
4583023202
jalonrolfson@quigley.info
Hiper
4011781714800889
09/26
272
func (*Faker) PetName ¶
PetName will return a random fun pet name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PetName())
// Output: Ozzy Pawsborne
}
Ozzy Pawsborne
func (*Faker) Phone ¶
Phone will generate a random phone number string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Phone())
// Output: 6136459948
}
6136459948
func (*Faker) PhoneFormatted ¶
PhoneFormatted will generate a random phone number string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PhoneFormatted())
// Output: 136-459-9489
}
136-459-9489
func (*Faker) Phrase ¶
Phrase will return a random phrase
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Phrase())
// Output: horses for courses
}
horses for courses
func (*Faker) PhraseAdverb ¶
PhraseAdverb will return a random adverb phrase
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PhraseAdverb())
// Output: fully gladly
}
fully gladly
func (*Faker) PhraseNoun ¶
PhraseNoun will return a random noun phrase
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PhraseNoun())
// Output: the purple tribe
}
the purple tribe
func (*Faker) PhrasePreposition ¶
PhrasePreposition will return a random preposition phrase
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PhrasePreposition())
// Output: out the tribe
}
out the tribe
func (*Faker) PhraseVerb ¶
PhraseVerb will return a random preposition phrase
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PhraseVerb())
// Output: gladly dream indeed swiftly till a problem poorly
}
gladly dream indeed swiftly till a problem poorly
func (*Faker) Preposition ¶
Preposition will generate a random preposition
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Preposition())
// Output: other than
}
other than
func (*Faker) PrepositionCompound ¶
PrepositionCompound will generate a random compound preposition
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PrepositionCompound())
// Output: according to
}
according to
func (*Faker) PrepositionDouble ¶
PrepositionDouble will generate a random double preposition
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PrepositionDouble())
// Output: before
}
before
func (*Faker) PrepositionSimple ¶
PrepositionSimple will generate a random simple preposition
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PrepositionSimple())
// Output: out
}
out
func (*Faker) Price ¶
Price will take in a min and max value and return a formatted price
Code:
Output:Example¶
{
f := New(11)
fmt.Printf("%.2f", f.Price(0.8618, 1000))
// Output: 92.26
}
92.26
func (*Faker) ProgrammingLanguage ¶
ProgrammingLanguage will return a random programming language
Code:
Output:Example¶
{
f := New(464)
fmt.Println(f.ProgrammingLanguage())
// Output: Go
}
Go
func (*Faker) ProgrammingLanguageBest ¶
ProgrammingLanguageBest will return a random programming language
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.ProgrammingLanguageBest())
// Output: Go
}
Go
func (*Faker) Pronoun ¶
Pronoun will generate a random pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Pronoun())
// Output: me
}
me
func (*Faker) PronounDemonstrative ¶
PronounDemonstrative will generate a random demonstrative pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounDemonstrative())
// Output: this
}
this
func (*Faker) PronounIndefinite ¶
PronounIndefinite will generate a random indefinite pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounIndefinite())
// Output: few
}
few
func (*Faker) PronounInterrogative ¶
PronounInterrogative will generate a random interrogative pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounInterrogative())
// Output: what
}
what
func (*Faker) PronounObject ¶
PronounObject will generate a random object pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounObject())
// Output: it
}
it
func (*Faker) PronounPersonal ¶
PronounPersonal will generate a random personal pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounPersonal())
// Output: it
}
it
func (*Faker) PronounPossessive ¶
PronounPossessive will generate a random possessive pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounPossessive())
// Output: mine
}
mine
func (*Faker) PronounReflective ¶
PronounReflective will generate a random reflective pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounReflective())
// Output: myself
}
myself
func (*Faker) PronounRelative ¶
PronounRelative will generate a random relative pronoun
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.PronounRelative())
// Output: as
}
as
func (*Faker) Question ¶
Question will return a random question
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Question())
// Output: Roof chia echo pickled?
}
Roof chia echo pickled?
func (*Faker) Quote ¶
Quote will return a random quote from a random person
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Quote())
// Output: "Roof chia echo pickled." - Marques Jakubowski
}
"Roof chia echo pickled." - Marques Jakubowski
func (*Faker) RGBColor ¶
RGBColor will generate a random int slice color
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.RGBColor())
// Output: [89 176 195]
}
[89 176 195]
func (*Faker) RandomInt ¶
RandomInt will take in a slice of int and return a randomly selected value
Code:
Output:Example¶
{
f := New(11)
ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(f.RandomInt(ints))
// Output: 52
}
52
func (*Faker) RandomMapKey ¶
func (f *Faker) RandomMapKey(mapI interface{}) interface{}
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
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.RandomString([]string{"hello", "world"}))
// Output: hello
}
hello
func (*Faker) RandomUint ¶
RandomUint will take in a slice of uint and return a randomly selected value
Code:
Output:Example¶
{
f := New(11)
ints := []uint{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(f.RandomUint(ints))
// Output: 52
}
52
func (*Faker) Regex ¶
Regex will generate a string based upon a RE2 syntax
Code:
Output: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: affec
// RXHKI
// world
// tapwyjdnsm@gtlxw.net
}
affec
RXHKI
world
tapwyjdnsm@gtlxw.net
func (*Faker) SSN ¶
SSN will generate a random Social Security Number
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.SSN())
// Output: 493298265
}
493298265
func (*Faker) SafariUserAgent ¶
SafariUserAgent will generate a random safari browser user agent string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.SafariUserAgent())
// Output: Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X; en-US) AppleWebKit/536.4.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B120 Safari/6536.4.4
}
Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X; en-US) AppleWebKit/536.4.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B120 Safari/6536.4.4
func (*Faker) SafeColor ¶
SafeColor will generate a random safe color string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.SafeColor())
// Output: black
}
black
func (*Faker) Second ¶
Second will generate a random second
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Second())
// Output: 5
}
5
func (*Faker) Sentence ¶
Sentence will generate a random sentence
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Sentence(5))
// Output: There had result everything niche.
}
There had result everything niche.
func (*Faker) SentenceSimple ¶
SentenceSimple will generate a random simple sentence
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.SentenceSimple())
// Output: The purple tribe indeed swiftly laugh.
}
The purple tribe indeed swiftly laugh.
func (*Faker) ShuffleAnySlice ¶
func (f *Faker) ShuffleAnySlice(v interface{})
ShuffleAnySlice takes in a slice and outputs it in a random order
Code:
Output: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:
// [good everyone have for times a day happy]
// [777 74125 941 854 89416 52 8413 841657]
}
[good everyone have for times a day happy]
[777 74125 941 854 89416 52 8413 841657]
func (*Faker) ShuffleInts ¶
ShuffleInts will randomize a slice of ints
Code:
Output:Example¶
{
f := New(11)
ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
f.ShuffleInts(ints)
fmt.Println(ints)
// Output: [74125 777 941 89416 8413 854 52 841657]
}
[74125 777 941 89416 8413 854 52 841657]
func (*Faker) ShuffleStrings ¶
ShuffleStrings will randomize a slice of strings
Code:
Output:Example¶
{
f := New(11)
strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"}
f.ShuffleStrings(strings)
fmt.Println(strings)
// Output: [good everyone have for times a day happy]
}
[good everyone have for times a day happy]
func (*Faker) Slice ¶
func (f *Faker) Slice(v interface{})
Slice fills built-in types and exported fields of a struct with random data.
Code:
Output: Code:
Output:Example¶
{
f := New(11)
var S []string
f.Slice(&S)
I := make([]int8, 3)
f.Slice(&I)
fmt.Println(S)
fmt.Println(I)
// Output: [RMaRxHkiJ PtapWYJdn MKgtlxwnq qclaYkWw oRLOPxLIok qanPAKaXS]
// [-88 -101 60]
}
[RMaRxHkiJ PtapWYJdn MKgtlxwnq qclaYkWw oRLOPxLIok qanPAKaXS]
[-88 -101 60]
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: [{Marcel -652938557 1.9343967e+38} {Lura -101175613 2.670526e+38} {Lucinda 1412367049 1.0427679e+38} {Santino 1631045574 2.2573786e+38} {Dawn -924758850 4.249854e+37} {Alice -937677379 1.0573345e+38}]
}
[{Marcel -652938557 1.9343967e+38} {Lura -101175613 2.670526e+38} {Lucinda 1412367049 1.0427679e+38} {Santino 1631045574 2.2573786e+38} {Dawn -924758850 4.249854e+37} {Alice -937677379 1.0573345e+38}]
func (*Faker) Snack ¶
Snack will return a random snack name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Snack())
// Output: Hoisin marinated wing pieces
}
Hoisin marinated wing pieces
func (*Faker) State ¶
State will generate a random state string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.State())
// Output: Hawaii
}
Hawaii
func (*Faker) StateAbr ¶
StateAbr will generate a random abbreviated state string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.StateAbr())
// Output: CO
}
CO
func (*Faker) Street ¶
Street will generate a random address street string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Street())
// Output: 364 Unions ville
}
364 Unions ville
func (*Faker) StreetName ¶
StreetName will generate a random address street name string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.StreetName())
// Output: View
}
View
func (*Faker) StreetNumber ¶
StreetNumber will generate a random address street number string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.StreetNumber())
// Output: 13645
}
13645
func (*Faker) StreetPrefix ¶
StreetPrefix will generate a random address street prefix string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.StreetPrefix())
// Output: Lake
}
Lake
func (*Faker) StreetSuffix ¶
StreetSuffix will generate a random address street suffix string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.StreetSuffix())
// Output: land
}
land
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.
Code:
Output: Code:
Output: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"`
Map map[string]string `fakesize:"2"`
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.Bar)
// Output: bRMaRx
// -605057214
// 1412367049
// Andre
// 1
// <nil>
// [PtapWYJdn MKgtlxwnq]
// map[qanPAKaXS:QFpZysVaHG qclaYkWw:oRLOPxLIok]
// {Name:yvqqdH Number:-356428491 Float:2.8838284e+38}
}
bRMaRx
-605057214
1412367049
Andre
1
<nil>
[PtapWYJdn MKgtlxwnq]
map[qanPAKaXS:QFpZysVaHG qclaYkWw:oRLOPxLIok]
{Name:yvqqdH Number:-356428491 Float:2.8838284e+38}
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"`
}
var fm FooMany
f.Struct(&fm)
fmt.Printf("%v\n", fm.Foos)
fmt.Printf("%v\n", fm.Names)
// Output:
// [{bRMaRx -605057214 Paolo 4 <nil>}]
// [Santino Carole Enrique]
}
[{bRMaRx -605057214 Paolo 4 <nil>}]
[Santino Carole Enrique]
func (*Faker) Teams ¶
Teams takes in an array of people and team names and randomly places the people into teams as evenly as possible
Code:
Output: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:[Fabian Connor Steve] Team 2:[Jeff Sharon Justin] Team 3:[Robert Billy]]
}
map[Team 1:[Fabian Connor Steve] Team 2:[Jeff Sharon Justin] Team 3:[Robert Billy]]
func (*Faker) TimeZone ¶
TimeZone will select a random timezone string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.TimeZone())
// Output: Kaliningrad Standard Time
}
Kaliningrad Standard Time
func (*Faker) TimeZoneAbv ¶
TimeZoneAbv will select a random timezone abbreviation string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.TimeZoneAbv())
// Output: KST
}
KST
func (*Faker) TimeZoneFull ¶
TimeZoneFull will select a random full timezone string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.TimeZoneFull())
// Output: (UTC+03:00) Kaliningrad, Minsk
}
(UTC+03:00) Kaliningrad, Minsk
func (*Faker) TimeZoneOffset ¶
TimeZoneOffset will select a random timezone offset
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.TimeZoneOffset())
// Output: 3
}
3
func (*Faker) TimeZoneRegion ¶
TimeZoneRegion will select a random region style timezone string, e.g. "America/Chicago"
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.TimeZoneRegion())
// Output: America/Vancouver
}
America/Vancouver
func (*Faker) URL ¶
URL will generate a random url string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.URL())
// Output: https://www.dynamiciterate.name/target/seamless
}
https://www.dynamiciterate.name/target/seamless
func (*Faker) UUID ¶
UUID (version 4) will generate a random unique identifier based upon random numbers
Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.UUID())
// Output: 590c1440-9888-45b0-bd51-a817ee07c3f2
}
590c1440-9888-45b0-bd51-a817ee07c3f2
func (*Faker) Uint16 ¶
Uint16 will generate a random uint16 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Uint16())
// Output: 34968
}
34968
func (*Faker) Uint32 ¶
Uint32 will generate a random uint32 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Uint32())
// Output: 1075055705
}
1075055705
func (*Faker) Uint64 ¶
Uint64 will generate a random uint64 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Uint64())
// Output: 10067102729548074073
}
10067102729548074073
func (*Faker) Uint8 ¶
Uint8 will generate a random uint8 value
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Uint8())
// Output: 152
}
152
func (*Faker) UintRange ¶
UintRange will generate a random uint value between min and max
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.UintRange(1, 10))
// Output: 1
}
1
func (*Faker) UserAgent ¶
UserAgent will generate a random broswer user agent
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.UserAgent())
// Output: Mozilla/5.0 (Windows NT 5.0) AppleWebKit/5312 (KHTML, like Gecko) Chrome/40.0.800.0 Mobile Safari/5312
}
Mozilla/5.0 (Windows NT 5.0) AppleWebKit/5312 (KHTML, like Gecko) Chrome/40.0.800.0 Mobile Safari/5312
func (*Faker) Username ¶
Username will generate a random username based upon picking a random lastname and random numbers at the end
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Username())
// Output: Daniel1364
}
Daniel1364
func (*Faker) Vegetable ¶
Vegetable will return a random vegetable name
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Vegetable())
// Output: Amaranth Leaves
}
Amaranth Leaves
func (*Faker) Verb ¶
Verb will generate a random verb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Verb())
// Output: does
}
does
func (*Faker) VerbAction ¶
VerbAction will generate a random action verb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.VerbAction())
// Output: close
}
close
func (*Faker) VerbHelping ¶
VerbHelping will generate a random helping verb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.VerbHelping())
// Output: be
}
be
func (*Faker) VerbIntransitive ¶
VerbIntransitive will generate a random intransitive verb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.VerbIntransitive())
// Output: laugh
}
laugh
func (*Faker) VerbLinking ¶
VerbLinking will generate a random linking verb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.VerbLinking())
// Output: was
}
was
func (*Faker) VerbTransitive ¶
VerbTransitive will generate a random transitive verb
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.VerbTransitive())
// Output: follow
}
follow
func (*Faker) WeekDay ¶
WeekDay will generate a random weekday string (Monday-Sunday)
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.WeekDay())
// Output: Tuesday
}
Tuesday
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
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Word())
// Output: there
}
there
func (*Faker) XML ¶
func (f *Faker) XML(xo *XMLOptions) ([]byte, error)
XML generates an object or an array of objects in json format
Code:
Output: Code:
Output: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>Markus</first_name>
// <last_name>Moen</last_name>
// <password>Dc0VYXjkWABx</password>
// </record>
// <record>
// <first_name>Osborne</first_name>
// <last_name>Hilll</last_name>
// <password>XPJ9OVNbs5lm</password>
// </record>
// </xml>
}
<xml>
<record>
<first_name>Markus</first_name>
<last_name>Moen</last_name>
<password>Dc0VYXjkWABx</password>
</record>
<record>
<first_name>Osborne</first_name>
<last_name>Hilll</last_name>
<password>XPJ9OVNbs5lm</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>Markus</first_name>
// <last_name>Moen</last_name>
// <password>Dc0VYXjkWABx</password>
// </xml>
}
<xml>
<first_name>Markus</first_name>
<last_name>Moen</last_name>
<password>Dc0VYXjkWABx</password>
</xml>
func (*Faker) Year ¶
Year will generate a random year between 1900 - current year
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Year())
// Output: 1995
}
1995
func (*Faker) Zip ¶
Zip will generate a random Zip code string
Code:
Output:Example¶
{
f := New(11)
fmt.Println(f.Zip())
// Output: 13645
}
13645
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 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"` Generate func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) `json:"-"` }
Info structures fields to better break down what each one generates
func GetFuncLookup ¶
GetFuncLookup will lookup
func (*Info) GetBool ¶
GetBool will retrieve boolean field from data
func (*Info) GetField ¶
GetField will retrieve field from data
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) GetInt ¶
GetInt will retrieve int field from data
func (*Info) GetIntArray ¶
GetIntArray will retrieve []int field from data
func (*Info) GetString ¶
GetString will retrieve string field from data
func (*Info) GetStringArray ¶
GetStringArray will retrieve []string field from data
func (*Info) GetUint ¶
GetUint will retrieve uint field from data
type JSONOptions ¶
type JSONOptions struct { Type string `json:"type" xml:"type"` // array or object RowCount int `json:"row_count" xml:"row_count"` Fields []Field `json:"fields" xml:"fields"` Indent bool `json:"indent" xml:"indent"` }
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
func Job ¶
func Job() *JobInfo
Job will generate a struct with random job information
Code:
Output:Example¶
{
Seed(11)
jobInfo := Job()
fmt.Println(jobInfo.Company)
fmt.Println(jobInfo.Title)
fmt.Println(jobInfo.Descriptor)
fmt.Println(jobInfo.Level)
// Output: ClearHealthCosts
// Agent
// Future
// Tactics
}
ClearHealthCosts
Agent
Future
Tactics
type MapParams ¶
type MapParams map[string]MapParamsValue
MapParams is the values to pass into a lookup generate
func NewMapParams ¶
func NewMapParams() *MapParams
NewMapParams will create a new MapParams
func (*MapParams) Add ¶
Add will take in a field and value and add it to the map params type
func (*MapParams) Get ¶
Get will return the array of string from the provided field
func (*MapParams) Size ¶
Size will return the total size of the underlying map
type MapParamsValue ¶
type MapParamsValue []string
func (*MapParamsValue) UnmarshalJSON ¶
func (m *MapParamsValue) UnmarshalJSON(data []byte) error
UnmarshalJSON will unmarshal the json into the []string
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"` Image string `json:"image" xml:"image"` 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
Code:
Output: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.Image)
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:
// Markus
// Moen
// male
// 275413589
// https://picsum.photos/300/300/people
// Morgan Stanley
// Associate
// Human
// Usability
// 99536 Pine mouth, Fremont, Indiana 30042
// 99536 Pine mouth
// Fremont
// Indiana
// 30042
// Madagascar
// -75.631793
// -83.487777
// 4583023202
// jalonrolfson@quigley.info
// Hiper
// 4011781714800889
// 09/26
// 272
}
Markus
Moen
male
275413589
https://picsum.photos/300/300/people
Morgan Stanley
Associate
Human
Usability
99536 Pine mouth, Fremont, Indiana 30042
99536 Pine mouth
Fremont
Indiana
30042
Madagascar
-75.631793
-83.487777
4583023202
jalonrolfson@quigley.info
Hiper
4011781714800889
09/26
272
type XMLOptions ¶
type XMLOptions struct { Type string `json:"type" xml:"type"` // single or multiple RootElement string `json:"root_element" xml:"root_element"` RecordElement string `json:"record_element" xml:"record_element"` RowCount int `json:"row_count" xml:"row_count"` Fields []Field `json:"fields" xml:"fields"` Indent bool `json:"indent" xml:"indent"` }
XMLOptions defines values needed for json generation
Source Files ¶
address.go animal.go app.go auth.go beer.go car.go celebrity.go color.go company.go csv.go doc.go emoji.go faker.go file.go food.go game.go generate.go hacker.go helpers.go hipster.go image.go internet.go json.go languages.go lookup.go lorem.go minecraft.go misc.go number.go payment.go person.go slice.go string.go struct.go time.go weighted.go word_adjective.go word_adverb.go word_connective.go word_general.go word_grammar.go word_helper.go word_noun.go word_phrase.go word_preposition.go word_pronoun.go word_sentence.go word_verb.go xml.go
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/gofakeit | |
cmd/gofakeitserver | |
data |
- Version
- v6.13.1
- Published
- Jan 14, 2022
- Platform
- js/wasm
- Imports
- 23 packages
- Last checked
- now –
Tools for package owners.