package
0.0.0-20250227233008-6305ea83e4e1
Repository: https://github.com/bhatti/api-mock-service.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
EnumInt selects numeric.
EnumString selects substring.
ExtractTopPrimitiveAttributes to fetch attributes.
ExtractTypes extract types from any structure.
FileProperty generator.
FindVariable extracts variable property.
FlatRegexMap to add all regex in same map.
FormatCreditCard formats a credit card number with spaces based on its type.
GenerateCreditCard generates a valid credit card number for the specified type.
GenerateFuzzData using regex, data or types.
GenerateRandomCreditCard generates a random valid credit card number of any type.
IdentifyCardType attempts to identify the card type from a card number.
IsValidCreditCard checks if a credit card number is valid using the Luhn algorithm.
IsValidSSN checks if an SSN is in the correct format and follows basic rules.
NewDataTemplateRequest constructor.
NewRandomSource creates a new random source with a seed.
ParseTemplate parses GO template with dynamic parameters.
PrefixTypeStringToRegEx helper method for adding prefix and regex.
PropertyContains checks if variable contains value.
PropertyEquals checks if variable is equal to the value.
RandAddress Generate a random address.
RandAirport returns a random airport from the list.
RandBool generator.
RandCity generator.
RandCountry country generator.
RandCountryCode country generator.
No description provided by the author
RandEin Generate a random United States Employer Identification Number EIN).
RandEmail generator.
RandFileLine generator.
RandFirstFemaleName first name.
RandFirstMaleName first name.
RandFirstName first name.
RandFlightNumber generates a random flight number using real airline patterns.
RandFloatMax returns random number between 0 and max.
RandFloatMinMax returns random number between min and max.
RandHost generator.
RandIntArrayMinMax generator.
RandIntMax returns random number between 0 and max.
RandIntMinMax returns random number between min and max.
RandItin generator for random United States Individual Taxpayer Identification Number ITIN).
RandLastName last name.
RandName name generator.
RandomAirportByRegion returns a random airport from a specific region.
RandParagraph generate a paragraph with at least min sentences and at most max sentences.
RandPhone generator.
RandRegex generator.
RandSentence generate a sentence with at least min words and at most max words.
RandSsn Generate a random invalid United States Social Security Identification Number SSN).
No description provided by the author
RandString generator.
RandStringArrayMinMax generator.
RandStringMinMax generator.
RandTriString phrase generator.
RandURL generator.
RandUSState Generate US State.
RandUSStateAbbr Generate US State.
RandWord generate a word with at least min letters and at most max letters.
ReMarshalArrayOrObjectWithIndent helper method to unmarshal and marshal with indent.
SeededAddress Generate a random address.
SeededAirport returns a deterministic airport based on a seed.
SeededAirportByRegion returns a deterministic airport from a specific region.
SeededBool generator.
SeededCity generator.
SeededCountry country generator.
SeededCountryCode country generator.
No description provided by the author
SeededFileLine generator.
SeededFirstFemaleName first name.
SeededFirstMaleName first name.
SeededFirstName first name.
SeededFlightNumber generates a deterministic flight number based on a seed.
SeededLastName last name.
SeededName name generator.
SeededRandFloatMax returns random number with seed upto a max.
SeededRandIntMax returns random number with seed upto a max.
SeededSSN generates a random valid SSN - First 3 digits (area number): cannot be 000, 666, or 900-999 - Middle 2 digits (group number): cannot be 00 - Last 4 digits (serial number): cannot be 0000.
SeededTriString phrase generator.
SeededUSPostal Generate US postal code.
SeededUSState Generate US State.
SeededUSStateAbbr Generate US State.
SeededUUID generates a deterministic UUID v4 based on a seed value.
StripTypeTags removes type prefixes.
TemplateFuncs returns template functions.
ToFloat64 converter.
ULID generator.
UnmarshalArrayOrObject helper function to unmarshal bytes based on object/array.
UnmarshalArrayOrObjectAndExtractTypes helper method to unmarshal, add types and marshal again.
UnmarshalArrayOrObjectAndExtractTypesAndMarshal helper method to unmarshal, add types and marshal again.
UUID generator.
ValidateRegexMap validate data against regex map.
ValueToRegEx value to regex.
VariableJsonPath Enhance PropertyMatches to support nested objects with JSON path.
VariableNumber returns numeric value for variable.
VariableSize finds size of the variable.
# Constants
No description provided by the author
AnyWordRegex constant.
BooleanPrefixRegex constant.
No description provided by the author
No description provided by the author
EmailRegex constant.
EmailRegex2 constant.
EmailRegex3 constant.
EmailRegex4 constant.
FixtureDataExt extension.
IntPrefixRegex constant.
No description provided by the author
No description provided by the author
NumberPrefixRegex constant.
PrefixTypeArray type.
PrefixTypeBoolean type.
PrefixTypeExample type.
PrefixTypeNumber type.
PrefixTypeObject type.
PrefixTypeString type.
RequestCount name.
UintPrefixRegex constant.
UnescapeHTML flag.
No description provided by the author
No description provided by the author
WildRegex constant.
# Structs
Airline represents an airline with its code and flight number range.
Airport represents an airport with its IATA code, city, and country.
CardInfo stores credit card type prefix information.
DataTemplateRequest for generating random data pattern.
# Type aliases
CardType represents different credit card types.