Documentation
¶
Index ¶
- func HasLocale(locale string) bool
- func SetLocaleData(locale string, data LocaleData) error
- func TransformBusinessId(input string, locale string) string
- func TransformCity(input string, locale string) string
- func TransformCompanyName(input string, locale string) string
- func TransformFirstName(input string, locale string) string
- func TransformFullName(input string, locale string) string
- func TransformLastName(input string, locale string) string
- func TransformStreet(input string, locale string) string
- type Faker
- type LocaleData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasLocale ¶ added in v2.7.0
HasLocale reports whether data is currently set for locale. Transforms for a locale without data fall back to the default one.
func SetLocaleData ¶ added in v2.7.0
func SetLocaleData(locale string, data LocaleData) error
SetLocaleData adds a locale or replaces an existing one, including the built-in ones. It is safe to call while transforms are running. Fakers that already resolved an unknown locale to the default one keep using the default.
func TransformBusinessId ¶ added in v2.2.0
func TransformCity ¶
func TransformCompanyName ¶
func TransformFirstName ¶
func TransformFullName ¶
func TransformLastName ¶
func TransformStreet ¶
Types ¶
type Faker ¶
type Faker struct {
Locale string
}
func NewWithLocale ¶ added in v2.1.0
NewWithLocale keeps locale even when it has no data yet, so it can be set later with SetLocaleData; until then transforms use the default locale.
type LocaleData ¶ added in v2.7.0
type LocaleData struct {
FirstNames []string `json:"firstNames"`
LastNames []string `json:"lastNames"`
StreetNames []string `json:"streetNames"`
Cities []string `json:"cityNames"`
Companies []string `json:"companies"`
CompanySuffixes []string `json:"companySuffixes"`
BusinessIdFormat string `json:"businessIdFormat"`
}