Documentation
¶
Index ¶
- Variables
- func CreateDateSubstitute(cache interface{}, subname, format string, option string) (value string, date interface{})
- func GetCitySubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func GetDateSubstitute(cache interface{}, subname string, format string, option string) (value string, date interface{})
- func GetEmailSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func GetFirstNameSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func GetLastNameSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func GetPhoneSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func GetStateSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func GetStreetSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func GetZipSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func NewGuidSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func QuoteString(input string) string
- func QuoteSubstitute(cache interface{}, funcName string, format string, option string) (value string, data interface{})
- func SetDateSubstitute(cache interface{}, subname, format string, option string) (value string, date interface{})
- func ToLowerSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- func ToUpperSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
- type Consumer
- type LocationDetails
- type NameDetails
- type Result
Constants ¶
This section is empty.
Variables ¶
var CreateDateDefinition = shell.SubstitutionFunction{ Name: "createdate", Group: "date", FunctionHelp: "Create a date value relative to current time (or unix 0)", Formats: []shell.SubstitutionItemHelp{ shell.SubstitutionItemHelp{Item: "local", Description: "Local time value"}, shell.SubstitutionItemHelp{Item: "utc", Description: "Utc time value"}, shell.SubstitutionItemHelp{Item: "unix", Description: "Unix timestamp value; value 0"}, }, OptionDescription: "", Options: []shell.SubstitutionItemHelp{ shell.SubstitutionItemHelp{ Item: "{modifier=[-]value;modifer=[-]value}", Description: "Add or subtract a given value from the date", }, shell.SubstitutionItemHelp{ Item: "S", Description: "Add the specified seconds to time", }, shell.SubstitutionItemHelp{ Item: "n", Description: "Add the specified minutes to time", }, shell.SubstitutionItemHelp{ Item: "h", Description: "Add the specified hours to time", }, shell.SubstitutionItemHelp{ Item: "d", Description: "Add the specified days to date", }, shell.SubstitutionItemHelp{ Item: "m", Description: "Add the specified months to date", }, shell.SubstitutionItemHelp{ Item: "y", Description: "Add the specified years to the date", }, shell.SubstitutionItemHelp{ Item: "t", Description: "Truncate the given date/time component to zero (y,m,d,h,n,s)", }, }, Function: CreateDateSubstitute, }
CreateDateDefinition --
var GetCityDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getcity", FunctionHelp: "Get a random city of a consumer", Formats: nil, OptionDescription: "", Options: nil, Function: GetCitySubstitute, }
var GetDateDefinition = shell.SubstitutionFunction{ Name: "getdate", Group: "date", FunctionHelp: "Generate a date", FormatDescription: "Format Parameter selects type of time:", Formats: []shell.SubstitutionItemHelp{ shell.SubstitutionItemHelp{Item: "local", Description: "Local time value"}, shell.SubstitutionItemHelp{Item: "utc", Description: "Utc time value"}, shell.SubstitutionItemHelp{Item: "unix", Description: "Unix timestamp value"}, }, OptionDescription: "Option controls format of date string", Options: []shell.SubstitutionItemHelp{ shell.SubstitutionItemHelp{ Item: "{specification}", Description: "Golang format string", }, shell.SubstitutionItemHelp{ Item: "2006-01-02 15:04:05.000", Description: "Example Golang format for date and time", }, shell.SubstitutionItemHelp{ Item: "Mon", Description: "Example Golang format for day of week", }, shell.SubstitutionItemHelp{ Item: "2006", Description: "Example Golang format for year", }, }, Function: GetDateSubstitute, }
GetDateDefinition --
var GetEmailDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getemail", FunctionHelp: "Get a random email address of a consumer", Formats: nil, OptionDescription: "", Options: nil, Function: GetEmailSubstitute, }
var GetFirstNameDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getfirstname", FunctionHelp: "Get a random first name of a consumer", Formats: nil, OptionDescription: "", Options: nil, Function: GetFirstNameSubstitute, }
var GetLastNameDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getlastname", FunctionHelp: "Get a random last name of a consumer", Formats: nil, OptionDescription: "", Options: nil, Function: GetLastNameSubstitute, }
var GetPhoneDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getphone", FunctionHelp: "Get a random phone number of a consumer", Formats: []shell.SubstitutionItemHelp{ {"raw", "Raw unformatted phone number"}, {"dots", "Format phone with periods"}, {"dashes", "Format phone with dashes"}, }, OptionDescription: "", Options: []shell.SubstitutionItemHelp{ {"main", "(Default) Provide the main phone number"}, {"Cell", "Provide the cell phone number instead of main"}, }, Function: GetPhoneSubstitute, }
var GetStateDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getstate", FunctionHelp: "Get a random state of a consumer", Formats: []shell.SubstitutionItemHelp{ {"default", "Full state name"}, {"abbr", "Abbreviated state code"}, }, OptionDescription: "", Options: nil, Function: GetStateSubstitute, }
var GetStreetDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getstreet", FunctionHelp: "Get a random street of a consumer", Formats: nil, OptionDescription: "", Options: nil, Function: GetStreetSubstitute, }
var GetZipDefinition = shell.SubstitutionFunction{ Group: "randomuser", Name: "getzip", FunctionHelp: "Get a random zip code of a consumer", Formats: nil, OptionDescription: "", Options: nil, Function: GetZipSubstitute, }
var NewGuidDefinition = shell.SubstitutionFunction{ Name: "newguid", Group: "newguid", FunctionHelp: "Generate a guid formated as specified", Formats: nil, OptionDescription: "", Options: nil, Function: NewGuidSubstitute, }
var Quote = shell.SubstitutionFunction{ Name: "quote", Group: "quote", FunctionHelp: "Quote a variable", Formats: []shell.SubstitutionItemHelp{ {"var", "Option is a variable name"}, }, OptionDescription: "", Options: nil, Function: QuoteSubstitute, }
var SetDateDefinition = shell.SubstitutionFunction{ Name: "setdate", Group: "date", FunctionHelp: "Set a date value equal to the option string", Formats: []shell.SubstitutionItemHelp{ shell.SubstitutionItemHelp{Item: "local", Description: "Local time value"}, shell.SubstitutionItemHelp{Item: "utc", Description: "Utc time value"}, shell.SubstitutionItemHelp{Item: "unix", Description: "Unix timestamp value"}, }, OptionDescription: "", Options: []shell.SubstitutionItemHelp{ shell.SubstitutionItemHelp{ Item: "2006-01-02T15:04:05", Description: "Formatted date string", }, }, Function: SetDateSubstitute, }
SetDateDefinition --
var ToLowerDefinition = shell.SubstitutionFunction{ Name: "tolower", Group: "tolower", FunctionHelp: "Lower case an options parameter as identified by format", Formats: []shell.SubstitutionItemHelp{ {"var", "Option is a variable name"}, }, OptionDescription: "", Options: nil, Function: ToLowerSubstitute, }
var ToUpperDefinition = shell.SubstitutionFunction{ Name: "toupper", Group: "toupper", FunctionHelp: "Upper case an options parameter as identified by format", Formats: []shell.SubstitutionItemHelp{ {"var", "Option is a variable name"}, }, OptionDescription: "", Options: nil, Function: ToUpperSubstitute, }
Functions ¶
func CreateDateSubstitute ¶
func CreateDateSubstitute(cache interface{}, subname, format string, option string) (value string, date interface{})
CreateDateSubstitute -- A function that creates a date from a offset from now TODO: started function; need to finish
func GetCitySubstitute ¶
func GetCitySubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetCitySubstitute -- Get a random city
func GetDateSubstitute ¶
func GetDateSubstitute(cache interface{}, subname string, format string, option string) (value string, date interface{})
GetDateSubstitute --
func GetEmailSubstitute ¶
func GetEmailSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetEmailSubstitute -- Get a random last name
func GetFirstNameSubstitute ¶
func GetFirstNameSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetFirstNameSubstitute -- Get a random first name
func GetLastNameSubstitute ¶
func GetLastNameSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetLastNameSubstitute -- Get a random last name
func GetPhoneSubstitute ¶
func GetPhoneSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetPhoneSubstitute -- Get a random first name
func GetStateSubstitute ¶
func GetStateSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetStateSubstitute -- Get a random state
func GetStreetSubstitute ¶
func GetStreetSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetStreetSubstitute -- Get a random last name
func GetZipSubstitute ¶
func GetZipSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
GetZipSubstitute -- Get a random zip code
func NewGuidSubstitute ¶
func NewGuidSubstitute(cache interface{}, subname string, format string, option string) (value string, data interface{})
NewGuidSubstitute -- Implementatino of guid substitution
func QuoteString ¶
QuoteString -- Quote a string handling '\"' as well
func QuoteSubstitute ¶
func QuoteSubstitute(cache interface{}, funcName string, format string, option string) (value string, data interface{})
Quote -- quote the input string including escaping inner quotes and escape sequences
func SetDateSubstitute ¶
func SetDateSubstitute(cache interface{}, subname, format string, option string) (value string, date interface{})
SetDateSubstitute -- A function that returns an empty string but sets the date value used by the date group functions
Types ¶
type Consumer ¶
type Consumer struct {
Gender string `json:"gender"`
Name NameDetails `json:"name"`
Location LocationDetails `json:"location"`
Email string `json:"email"`
Phone string `json:"phone"`
Cell string `json:"cell"`
}