package
1.4.5-alpha1
Repository: https://github.com/ottemo/commerce.git
Documentation: pkg.go.dev

# Functions

CheckIsBlank checks if value is blank (zero value).
Clone will create a replica for a given object.
CryptAsURLString encrypts given string with base64 and hex encoding.
CryptToURLString encrypts given string with base64 and hex encoding.
DataTypeArrayBaseType returns data type of array elements.
DataTypeArrayOf adds array modifier to given dataType, returns "" for unknown types.
DataTypeIsArray returns true if dataType is kind of array.
DataTypeIsFloat returns true if dataType representation for GO language is float64 type.
DataTypeIsString returns true if dataType representation for GO language is string type.
DataTypeParse tries to parse given string representation of datatype into DataType struct.
DataTypeWPrecision adds precision modifier to given dataType, returns "" for unknown types.
DataTypeWPrecisionAndScale adds precision and scale modifier to given dataType, returns "" for unknown types.
DecodeJSONToArray decodes json string to []interface{} if it's possible.
DecodeJSONToInterface decodes json string to interface{} if it's possible.
DecodeJSONToStringKeyMap decodes json string to map[string]interface{} if it's possible.
DecryptData decrypts given data with crypto/cipher algorithm.
DecryptString decodes base64.StdEncoding string un-salting it and then decrypts it with crypto/cipher, returns original value or error.
DecryptURLString decode given encoded string and returns decoded value.
EncodeToJSONString encodes inputData to JSON string if it's possible.
EncryptData encrypts given data with crypto/cipher algorithm.
EncryptReader decrypts given stream with crypto/cipher algorithm.
EncryptString encrypts string with crypto/cipher, salting it and makes base64.StdEncoding, returns blank string if encoding fails.
EncryptWriter encrypts given stream with crypto/cipher algorithm.
EscapeRegexSpecials returns regular expression special characters escaped value.
Explode returns trimmed []string array of [separators] delimited values.
GetFirstMapValue returns map key value or nil if not found, will be returned first found key value.
GetKey returns a key used in crypto/cipher algorithm.
GetPointer returns the memory address value for a given subject or an error for scalar values.
GetTemplateFunctions returns clone of templateFuncs (safe to manipulate).
InterfaceToArray converts interface{} to []interface{}.
InterfaceToBool converts interface{} to string.
InterfaceToFloat64 converts interface{} to float64.
InterfaceToInt converts interface{} to integer.
InterfaceToMap converts interface{} to map[string]interface{}.
InterfaceToString converts interface{} to string.
InterfaceToStringArray converts interface{} to []string.
InterfaceToTime converts interface{} to time.Time.
IsAmongStr searches for presence of 1-st arg string option among provided options since 2-nd argument.
IsInArray searches for item in array/slice, returns true if found.
IsInListStr searches for a string in []string slice.
IsMD5 checks if value is MD5.
IsZeroTime checks time for zero value.
KeysInMapAndNotBlank checks presence of non blank values for keys in map - first arg must be map - fallowing arguments are map keys you want to check.
MakeTZTime returns given time in specified timezone (current time.Locale() ignores) and offset from GMT in duration format.
MakeUTCOffsetTime returns given time in UTC offset timezone (i.e.
MakeUTCTime returns given time in UTC-00:00 timezone (current time.Locale() ignores) and offset from GMT in duration format.
MatchMapAValuesToMapB compares key values of mapA to same key value of mapB, returns true if all keys in mapA present and matches keys in mapB.
ParseTimeZone returns zone name and it's offset from GMT.
PasswordCheck compare inputed password with stored one.
PasswordEncode encode inputed password with using salt, if no salt it will use default one.
RegisterTemplateFunction registers custom function within text template processing.
Round rounds value to given precision (roundOn=0.5 usual cases).
RoundPrice normalize price after calculations, so it rounds it to money precision.
SetKey changes a key that package using for crypto/cipher algorithm.
SetTimeZoneName set name to zone for given time object.
SortByFunc sorts slice with a given comparator function - to sort in ascending order pass reverse as false - to sort in descending order pass reverse as true.
SortMapByKeys sorts given map by specified keys values - to sort in ascending order pass reverse as false - to sort in descending order pass reverse as true.
SplitQuotedStringBy splits string by character(s) unless it in quotes.
StringToFloat converts string to float64.
StringToInteger converts string to integer.
StringToInterface converts string to Interface{} which can be float, int, bool, string, or json as map[string]value.
StringToType converts string coded value to type.
StrKeysInMap checks presence of string keys in map.
Convert string from snake_case to camelCase format.
Convert string to snake_case format.
SyncGet - synchronized read access tree like variables - the -1 index for a slice means to init new blank slice value sample: var x map[string]map[int][]int = ..
SyncLock holds mutex on a given subject.
SyncMutex creates a mutex element for a given subject or error for a scalar values (un-addressable values).
ScalarSyncLock holds mutex on a given scalar subject.
ScalarSyncUnlock releases mutex on a given scalar subject.
SyncSet - synchronized write access to tree like variables - the value could be a func(oldValue {type}) {type} which would be synchronized called - the -1 index for a slice means it's extensions for a new element.
SyncUnlock releases mutex on a given subject.
TextTemplate evaluates text template, returns error if not possible.
TimeToUTCTime returns a given time in UTC timezone (converts time.Locale() to offset for UTC time).
ValidEmailAddress takes an email address as string compares it agasint a regular expression - returns true if email address is in a valid format - returns false if email address is not in a valid format.

# Constants

set of known data types.
set of known data types.
set of known data types.
set of known data types.
set of known data types.
set of known data types.
set of known data types.
set of known data types.
set of known data types.
set of known data types.
set of known data types.

# Variables

StaticTimezoneRegexp is a regular expression used to parse time zone.
StaticTypeRegexp is a regular expression used to parse datatype.
TimeZones list of known Time Zone Abbreviations – Worldwide List.

# Structs

DataType represents data type details.