Documentation ¶
Index ¶
- Constants
- func DecodeRequestBody(request *http.Request, parsedRequestObject interface{}) error
- func GenerateNanoId() string
- func GenerateUuidV4() string
- func OutputBasicLogString(level, message string) string
- func StringRemoveMultiSpace(s string) string
- func StringStandardisedToLower(s string) string
- func StripNonAlphanumericCharactersRegex(in []byte, with []byte) string
- func TimeNowUTC() string
Constants ¶
const Base64EncodedRegex string = "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$"
Base64EncodedRegex is pattern to identify if something is base64 format Another regex: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$"
const EmailRegex string = "" /* 135-byte string literal not displayed */
EmailRegex regex patter for email
const ExampleEmailAddressDomainRegex string = ".*@example.io$"
ExampleEmailAddressDomainRegex regex pattern for the an example email address domain
const TimeNowUTCAsStringRegex string = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$"
TimeNowUTCAsStringRegex basic regex for formatted time as string
const UserRoleIdSuffixRegex string = "(__[0-9]+)"
UserRoleIdSuffixRegex is the pattern used when versioning the different roles (from payment integrators)
const UuidV4Regex string = "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
UuidV4Regex regex pattern for Uuidv4
Variables ¶
This section is empty.
Functions ¶
func DecodeRequestBody ¶
DecodeRequestBody attempts to decode request to object. returns error on failure
func OutputBasicLogString ¶
OutputBasicLogString attempts to output log in a JSON format otherwise will default to plain text
func StringRemoveMultiSpace ¶
StringRemoveMultiSpace subsitutes all multispace with single space
func StringStandardisedToLower ¶
StringStandardisedToLower returns a string with no explicit spacing strategy that is all lowercase and standardised.
func StripNonAlphanumericCharactersRegex ¶
StripNonAlphanumericCharactersRegex handles remove all non-alpanumeric charactes from passed string
func TimeNowUTC ¶
func TimeNowUTC() string
TimeNowUTC returns time as string in RFC3339 format w/o timezone
Types ¶
This section is empty.