Skip to main content
Version: Next

Faker functions

Greenmask uses go-faker/faker under the hood for generating of synthetic data.

Faker functions: Address

FunctionDescriptionSignature
fakerRealAddressGenerates a random real-world address that includes: city, state, postal code, latitude, and longitudefakerRealAddress() (res ReadAddress)
fakerLatitudeGenerates random fake latitudefakerLatitude() (res float64)
fakerLongitudeGenerates random fake longitudefakerLongitude() (res float64)

Faker functions: Datetime

FunctionDescriptionSignature
fakerUnixTimeGenerates random Unix time in secondsfakerLongitude() (res int64)
fakerDateGenerates random date with the pattern of YYYY-MM-DDfakerDate() (res string)
fakerTimeStringGenerates random timefakerTimeString() (res string)
fakerMonthNameGenerates a random monthfakerMonthName() (res string)
fakerYearStringGenerates a random yearfakerYearString() (res string)
fakerDayOfWeekGenerates a random day of a weekfakerDayOfWeek() (res string)
fakerDayOfMonthGenerates a random day of a monthfakerDayOfMonth() (res string)
fakerTimestampGenerates a random timestamp with the pattern of YYYY-MM-DD HH:MM:SSfakerTimestamp() (res string)
fakerCenturyGenerates a random centuryfakerCentury() (res string)
fakerTimezoneGenerates a random timezone namefakerTimezone() (res string)
fakerTimeperiodGenerates a random time period with the patter of either AM or PMfakerTimeperiod() (res string)

Faker functions: Internet

FunctionDescriptionSignature
fakerEmailGenerates a random emailfakerEmail() (res string)
fakerMacAddressGenerates a random MAC addressfakerMacAddress() (res string)
fakerDomainNameGenerates a random domain namefakerDomainName() (res string)
fakerURLGenerates a random URL with the pattern of https://www.domainname.some/somepathfakerURL() (res string)
fakerUsernameGenerates a random usernamefakerUsername() (res string)
fakerIPv4Generates a random IPv4 addressfakerIPv4() (res string)
fakerIPv6Generates a random IPv6 addressfakerIPv6() (res string)
fakerPasswordGenerates a random passwordfakerPassword() (res string)

Faker functions: words and sentences

FunctionDescriptionSignature
fakerWordGenerates a random wordfakerWord() (res string)
fakerSentenceGenerates a random sentencefakerSentence() (res string)
fakerParagraphGenerates a random sequence of sentences as a paragraphfakerParagraph() (res string)

Faker functions: Payment

FunctionDescriptionSignature
fakerCCTypeGenerates a random credit card type, e.g. VISA, MasterCard, etc.fakerCCType() (res string)
fakerCCNumberGenerates a random credit card numberfakerCCNumber() (res string)
fakerCurrencyGenerates a random currency namefakerCurrency() (res string)
fakerAmountWithCurrencyGenerates random amount preceded with random currencyfakerAmountWithCurrency() (res string)

Faker functions: Person

FunctionDescriptionSignature
fakerTitleMaleGenerates a random male title from the predefined listfakerTitleMale() (res string)
fakerTitleFemaleGenerates a random female title from the predefined listfakerTitleFemale() (res string)
fakerFirstNameGenerates a random first namefakerFirstName() (res string)
fakerFirstNameMaleGenerates a random male first namefakerFirstNameMale() (res string)
fakerFirstNameFemaleGenerates a random female first namefakerFirstNameFemale() (res string)
fakerFirstLastNameGenerates a random last namefakerFirstLastName() (res string)
fakerNameGenerates a random full name preceded with a titlefakerName() (res string)

Faker functions: Phone

FunctionDescriptionSignature
fakerPhoneNumberGenerates a random phone numberfakerPhoneNumber() (res string)
fakerTollFreePhoneNumberGenerates a random phone number with the pattern of (123) 456-7890fakerTollFreePhoneNumber() (res string)
fakerE164PhoneNumberGenerates a random phone number with the pattern of +12345678900fakerE164PhoneNumber() (res string)

Faker functions: UUID

FunctionDescriptionSignature
fakerUUIDHyphenatedGenerates a random unique user ID separated by hyphensfakerUUID() (res string)
fakerUUIDDigitGenerates a random unique user ID in the HEX formatfakerUUIDDigit() (res string)
Copyright © GreenMask 2026