Documentation ¶
Index ¶
- Constants
- type AvatarOptions
- type EmailOptions
- type Faker
- func (f Faker) AMPM() string
- func (f Faker) Address() string
- func (f Faker) AppAuthor() string
- func (f Faker) AppName() string
- func (f Faker) AppVersion() string
- func (f Faker) AvatarImage() string
- func (f Faker) AvatarImageWithOptions(o AvatarOptions) string
- func (f Faker) BookAuthor() string
- func (f Faker) BookGenre() string
- func (f Faker) BookISBN() string
- func (f Faker) BookPublisher() string
- func (f Faker) BookPublisherSuffix() string
- func (f Faker) BookTitle() string
- func (f Faker) Boolean() bool
- func (f Faker) BrazilCNPJ() string
- func (f Faker) BrazilCPF() string
- func (f Faker) Browser() string
- func (f Faker) BuildingNumber() string
- func (f Faker) CMYK() color.CMYK
- func (f Faker) CellPhoneNumber() string
- func (f Faker) Century() string
- func (f Faker) ChromeUserAgent() string
- func (f Faker) City() string
- func (f Faker) CityPrefix() string
- func (f Faker) CitySuffix() string
- func (f Faker) ColorName() string
- func (f Faker) CompanyLogo() string
- func (f Faker) CompanyName() string
- func (f Faker) CompanySuffix() string
- func (f Faker) Country() string
- func (f Faker) CountryCode() string
- func (f Faker) CreditCardExpiryDate() time.Time
- func (f Faker) CreditCardNumber() string
- func (f Faker) CreditCardType() string
- func (f Faker) CurrentLocale() locales.Locale
- func (f Faker) DateTime() time.Time
- func (f Faker) DateTimeAfter(d time.Time) time.Time
- func (f Faker) DateTimeBefore(d time.Time) time.Time
- func (f Faker) DateTimeBetween(d1, d2 time.Time) time.Time
- func (f Faker) DayOfMonth() int
- func (f Faker) DayOfWeek() int
- func (f Faker) Decimal(len, places int) string
- func (f Faker) Digit() int
- func (f Faker) DomainName() string
- func (f Faker) DomainSuffix() string
- func (f Faker) EAN13() string
- func (f Faker) Email() string
- func (f Faker) EmailWithOptions(o EmailOptions) string
- func (f Faker) FirefoxUserAgent() string
- func (f Faker) FirstName() string
- func (f Faker) FreeEmail() string
- func (f Faker) FreeEmailWithOptions(o EmailOptions) string
- func (f Faker) Gender() string
- func (f Faker) HexColor() string
- func (f Faker) Hexadecimal(len int) string
- func (f Faker) IEUserAgent() string
- func (f Faker) IPV4() string
- func (f Faker) IPV6() string
- func (f Faker) LastName() string
- func (f Faker) Latitude() string
- func (f Faker) Longitude() string
- func (f Faker) MD5() string
- func (f Faker) MacAddress() string
- func (f Faker) Month() int
- func (f Faker) Name() string
- func (f Faker) NegativeNumber() int
- func (f Faker) Number(len int) int
- func (f Faker) NumberBetween(first, second int) int
- func (f Faker) OS() string
- func (f Faker) OperaUserAgent() string
- func (f Faker) Password() string
- func (f Faker) PasswordWithOptions(o PassWordOptions) string
- func (f Faker) PhoneAreaCode() string
- func (f Faker) PhoneExchangeCode() string
- func (f Faker) PhoneNumber() string
- func (f Faker) PlaceholderImage() string
- func (f Faker) PlaceholderImageWithOptions(o ImageOptions) string
- func (f Faker) PositiveNumber() int
- func (f Faker) ProductAdjective() string
- func (f Faker) ProductName() string
- func (f Faker) ProductPrice() float64
- func (f Faker) ProductSimpleName() string
- func (f Faker) ProgrammingLanguage() string
- func (f Faker) RFC3339() string
- func (f Faker) RGBA() color.RGBA
- func (f Faker) SHA1() string
- func (f Faker) SHA256() string
- func (f Faker) SHA512() string
- func (f Faker) SafariUserAgent() string
- func (f Faker) SecondaryAddress() string
- func (f Faker) Slug() string
- func (f Faker) SlugWithOptions(o SlugOptions) string
- func (f Faker) State() string
- func (f Faker) StateAbbr() string
- func (f Faker) StoreDepartment() string
- func (f Faker) StreetAddress() string
- func (f Faker) StreetName() string
- func (f Faker) StreetSuffix() string
- func (f Faker) TextEditor() string
- func (f Faker) TimeZone() string
- func (f Faker) URL() string
- func (f Faker) URLWithOptions(o URLOptions) string
- func (f Faker) UniversityName() string
- func (f Faker) UserAgent() string
- func (f Faker) UserName() string
- func (f Faker) UserNameWithOptions(o UserNameOptions) string
- func (f Faker) WebFramework() string
- func (f Faker) Year() int
- func (f Faker) ZipCode() string
- type ImageOptions
- type Options
- type PassWordOptions
- type SlugOptions
- type URLOptions
- type UserNameOptions
Constants ¶
const DefaultLocale = "en"
DefaultLocale is a constant that defines the default locale used in the default configuration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvatarOptions ¶
type EmailOptions ¶
type EmailOptions struct {
Name string
}
type Faker ¶
type Faker struct { CurrentLocaleString string // contains filtered or unexported fields }
Faker is the main API it also holds some config
func NewForLocale ¶
NewForLocale creates a new Faker with the specified locale and random seed
func (Faker) AppVersion ¶
AppVersion returns a fake three digit version MAJOR MINOR and PATCH
func (Faker) AvatarImageWithOptions ¶
func (f Faker) AvatarImageWithOptions(o AvatarOptions) string
AvatarImageWithOptions returns a AvatarImage image
func (Faker) BookISBN ¶
BookISBN returns a fake ISBN number The ISBN number is just an EAN13 code. See https://pt.wikipedia.org/wiki/International_Standard_Book_Number
func (Faker) BookPublisher ¶
BookPublisher return a publisher company name
func (Faker) BookPublisherSuffix ¶
BookPublisherSuffix return a publisher company suffix
func (Faker) BrazilCNPJ ¶
BrazilCNPJ Generates a valid Brazilian CNPJ See: https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica
func (Faker) BrazilCPF ¶
BrazilCPF Generates a valid Brazilian CPF See https://en.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas
func (Faker) BuildingNumber ¶
BuildingNumber return a number of a building
func (Faker) CellPhoneNumber ¶
CellPhoneNumber returns a cellphone number
func (Faker) ChromeUserAgent ¶
func (Faker) CompanyLogo ¶
CompanyLogo returns a fake URL company name
func (Faker) CompanySuffix ¶
CompanySuffix returns a company suffix such as 'corp', 'LLC'
func (Faker) CountryCode ¶
CountryCode returns a ISO Country code
func (Faker) CreditCardExpiryDate ¶
CreditCardExpiryDate returns datetime after now
func (Faker) CreditCardNumber ¶
CreditCardNumber returns a valid credit card number for a while I will not generate a full random valid card I will just return from a list of valid numbers
func (Faker) CreditCardType ¶
CreditCardType returns a valid credit card type
func (Faker) CurrentLocale ¶
CurrentLocale returns the current locale object
func (Faker) DateTime ¶
DateTime returns a random datetime The date is maximum 100 years from now in the past or in the future
func (Faker) DateTimeAfter ¶
DateTimeAfter returns a date after the specified date The date is maximum 100 years from now in the future
func (Faker) DateTimeBefore ¶
DateTimeBefore returns a date before the specified date The date is maximum 100 years from now in the past
func (Faker) DateTimeBetween ¶
DateTimeBetween returns a date beetween d1 and d2
func (Faker) DayOfMonth ¶
DayOfMonth returns a day of the month between 1 and 31
func (Faker) Decimal ¶
Decimal returns a decimal number with digits length and places decimal places length it will panic if len is less than 1
func (Faker) DomainName ¶
func (Faker) DomainSuffix ¶
DomainSuffix returns a domain suffix such as .com, .com.br
func (Faker) EmailWithOptions ¶
func (f Faker) EmailWithOptions(o EmailOptions) string
func (Faker) FirefoxUserAgent ¶
func (Faker) FreeEmailWithOptions ¶
func (f Faker) FreeEmailWithOptions(o EmailOptions) string
FreeEmailWithOptions returns a safe email with the options
func (Faker) Hexadecimal ¶
Hexadecimal returns a alpha numeric with digits length it will panic if len is less than 1
func (Faker) IEUserAgent ¶
func (Faker) MD5 ¶
MD5 returns a random MD5 hexdigest See: https://en.wikipedia.org/wiki/MD5
func (Faker) MacAddress ¶
MacAddress returns a IEEE 802 MAC address
func (Faker) NegativeNumber ¶
NegativeNumber returns an positive int between math.MinInt32 (inclusive) and -1 (inclusive)
func (Faker) Number ¶
Number returns a number with digits length it will panic if len is less than 1
func (Faker) NumberBetween ¶
NumberBetween returns a random integer between first (inclusive) and second (inclusive)
func (Faker) OperaUserAgent ¶
func (Faker) PasswordWithOptions ¶
func (f Faker) PasswordWithOptions(o PassWordOptions) string
PasswordWithOptions returns password defined by the options
func (Faker) PhoneAreaCode ¶
PhoneAreaCode returns an area code
func (Faker) PhoneExchangeCode ¶
PhoneExchangeCode returns an exchange code
func (Faker) PlaceholderImage ¶
PlaceholderImage returns a Placeholder image
func (Faker) PlaceholderImageWithOptions ¶
func (f Faker) PlaceholderImageWithOptions(o ImageOptions) string
PlaceholderImageWithOptions returns a Placeholder image
func (Faker) PositiveNumber ¶
PositiveNumber returns an positive int between 0 (inclusive) and math.MaxUint32 (inclusive)
func (Faker) ProductAdjective ¶
ProductAdjective returns a fake product adjective
func (Faker) ProductName ¶
ProductName returns a fake product name
func (Faker) ProductPrice ¶
ProductPrice returns a fake product price between 0 and 5000
func (Faker) ProductSimpleName ¶
ProductSimpleName returns a fake product name
func (Faker) ProgrammingLanguage ¶
ProgrammingLanguage returns a name of a programming language
func (Faker) SHA1 ¶
SHA1 returns a random SHA1 hexdigest See: https://en.wikipedia.org/wiki/SHA-1
func (Faker) SHA256 ¶
SHA256 returns a random SHA256 hexdigest See: https://en.wikipedia.org/wiki/SHA-2
func (Faker) SHA512 ¶
SHA512 returns a random SHA512 hexdigest See: https://en.wikipedia.org/wiki/SHA-2
func (Faker) SafariUserAgent ¶
func (Faker) SecondaryAddress ¶
SecondaryAddress returns a Secondary Address
func (Faker) SlugWithOptions ¶
func (f Faker) SlugWithOptions(o SlugOptions) string
func (Faker) StoreDepartment ¶
StoreDepartment returns a fake department name
func (Faker) StreetAddress ¶
StreetAddress return a full street address
func (Faker) StreetSuffix ¶
StreetSuffix return a Street Suffix
func (Faker) TextEditor ¶
TextEditor returns a name of a TextEditor
func (Faker) URLWithOptions ¶
func (f Faker) URLWithOptions(o URLOptions) string
func (Faker) UniversityName ¶
UniversityName returns a name of a University
func (Faker) UserNameWithOptions ¶
func (f Faker) UserNameWithOptions(o UserNameOptions) string
UserNameWithOptions returns a username with the default options
func (Faker) WebFramework ¶
WebFramework returns a name of a WebFramework