Documentation ¶
Index ¶
- Variables
- func Account(length int) string
- func AddValueToList(l string, v string) string
- func Amount(min float32, max float32, currency string) string
- func Atoi(s string) int
- func BirthDate(minAge int, maxAge int) string
- func Bitcoin() string
- func BuildingNumber(n int) string
- func Cache(name string) (bool, error)
- func Capital() string
- func CapitalAt(index int) string
- func Cardinal(short bool) string
- func City() string
- func CityAt(index int) string
- func CodiceFiscale() string
- func Company() string
- func Contains(s []string, str string) bool
- func Counter(c string, start, step int) int
- func Country() string
- func CountryAt(index int) string
- func CountryCode() string
- func CountryCodeAt(index int) string
- func CountryRandom() string
- func CreditCard(issuer string) string
- func CreditCardCVV(length int) string
- func Cusip() string
- func CusipCheckDigit(code string) string
- func DateBetween(fromDate string, toDate string) string
- func DatesBetween(fromDate string, toDate string, num int) []string
- func DescriptionMap() map[string]FunctionDescription
- func Email() string
- func EmailProvider() string
- func Ethereum() string
- func ExecuteTemplate(key *template.Template, value *template.Template, oneline bool) (string, string, error)
- func FromCsv(c string) string
- func FunctionsMap() template.FuncMap
- func Future(years int) string
- func Gender() string
- func GetV(s string) string
- func GetValueFromListAtIndex(s string, index int) string
- func HttpMethod() string
- func Image(width int, height int) string
- func ImageOf(width int, height int, imageType string) string
- func Imei() string
- func IndexOf(s string, name string) int
- func InitCSV(csvpath string)
- func Inject(probability float64, injected, original any) any
- func Ip(cidr string) string
- func IpKnownPort() string
- func IpKnownProtocol() string
- func Ipv6() string
- func Isin(country string) string
- func IsinCheckDigit(code string) string
- func Latitude() string
- func Len(name string) string
- func Longitude() string
- func Lorem(size int) string
- func LuhnCheckDigit(code string) string
- func Mac() string
- func Maxint(a, b int) int
- func Middlename() string
- func Minint(a, b int) int
- func MobilePhone() string
- func MobilePhoneAt(index int) string
- func Name() string
- func NameF() string
- func NameM() string
- func NearbyGPS(latitude float64, longitude float64, radius int) string
- func Nonsense(prefixLen, numWords int, baseText string) string
- func Password(length int, memorable bool, prefix string, suffix string) string
- func Past(years int) string
- func Phone() string
- func PhoneAt(index int) string
- func RandomBool() string
- func RandomIndex(name string) string
- func RandomNValuesFromList(s string, n int) []string
- func RandomString(min, max int) string
- func RandomStringVocabulary(min, max int, source string) string
- func RandomValueFromList(s string) string
- func Recent(days int) string
- func Regex(regex string) (string, error)
- func Sedol() string
- func SedolCheckDigit(code string) string
- func Seed(rndSeed int64) string
- func Sentence(numWords int) string
- func SentencePrefix(prefixLen, numWords int) string
- func SetSeed(rndSeed int64)
- func SetV(s string, v string) string
- func Soon(days int) string
- func Ssn() string
- func State() string
- func StateAt(index int) string
- func StateShort() string
- func StateShortAt(index int) string
- func StockSymbol() string
- func Street() string
- func Surname() string
- func Swift() string
- func UniqueId() string
- func UnixTimeStamp(days int) int64
- func User(firstName string, lastName string, size int) string
- func UserAgent() string
- func Username(firstName string, lastName string) string
- func Valor() string
- func Wkn() string
- func Word(name string) string
- func WordAt(name string, index int) string
- func WordShuffle(name string) []string
- func WordShuffleN(name string, n int) []string
- func WorkEmail() string
- func YesOrNo() string
- func Zip() string
- func ZipAt(index int) string
- type Chain
- type FunctionDescription
- type Prefix
Constants ¶
This section is empty.
Variables ¶
var Random = rand.New(rand.NewSource(0))
Functions ¶
func AddValueToList ¶
AddValueToList adds value v to Context list l
func BuildingNumber ¶
BuildingNumber generates a random building number of max n digits
func CodiceFiscale ¶
func CodiceFiscale() string
CodiceFiscale return a valid Italian Codice Fiscale
func CountryCodeAt ¶
CountryCodeAt returns a Country Code prefix at a given index
func CreditCardCVV ¶
CreditCardCVV returns a random credit card CVV of given length
func CusipCheckDigit ¶
CusipCheckDigit calculates cusip check digit
func DateBetween ¶
DateBetween returns a date between fromDate and toDate
func DatesBetween ¶
DatesBetween returns an array of num dates between fromDate and toDate
func DescriptionMap ¶
func DescriptionMap() map[string]FunctionDescription
func ExecuteTemplate ¶
func FunctionsMap ¶
func Gender ¶
func Gender() string
Gender returns a random gender. Note: it gets the gender context automatically setup by previous name calls
func GetValueFromListAtIndex ¶
GetValuesFromList returns a value from Context list l at index
func Inject ¶
Inject is used to inject a different value with a given probability, typically used to generate a bad value
func IpKnownProtocol ¶
func IpKnownProtocol() string
IpKnownProtocol returns a random known protocol
func IsinCheckDigit ¶
IsinCheckDigit calculates an isin check digit
func LuhnCheckDigit ¶
LuhnCheckDigit calculates luhn check digit
func MobilePhoneAt ¶
MobilePhoneAt returns a mobile phone at a given index
func Nonsense ¶
Nonsense generates a random Sentence of numWords wordsm using a prefixLen and a baseText to start from
func Password ¶
Password returns a random Password of given length, memorable, and with prefix and suffix
func RandomIndex ¶
RandomIndex returns a random index in a word file
func RandomNValuesFromList ¶
RandomNValuesFromList returns a random value from Context list l
func RandomString ¶
RandomString returns a random string long between min and max characters
func RandomStringVocabulary ¶
RandomStringVocabulary returns a random string long between min and max characters using a vocabulary
func RandomValueFromList ¶
RandomValueFromList returns a random value from Context list l
func SedolCheckDigit ¶
SedolCheckDigit calculates sedol check digit
func SentencePrefix ¶
SentencePrefix generates an 'alice in wonderland' text of size words with given prefixLen
func StateShortAt ¶
StateShortAt returns short State at given index
func UnixTimeStamp ¶
UnixTimeStamp returns a random unix timestamp not older than the given number of days
func WordShuffle ¶
WordShuffle returns a shuffled list of strings in a file.
func WordShuffleN ¶
wordShuffleN return a subset of n elements in a list of string in a file.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain contains a map ("chain") of prefixes to a list of suffixes. A prefix is a string of prefixLen words joined with spaces. A suffix is a single word. A prefix can have multiple suffixes.
type FunctionDescription ¶
type FunctionDescription struct { Name string Category string Description string Parameters string Localizable bool Return string Example string Output string }
func Description ¶
func Description(name string) (FunctionDescription, bool)