toolbox

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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})$"

View Source
const EmailRegex string = "" /* 135-byte string literal not displayed */

EmailRegex regex patter for email

View Source
const ExampleEmailAddressDomainRegex string = ".*@example.io$"

ExampleEmailAddressDomainRegex regex pattern for the an example email address domain

View Source
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

View Source
const UserRoleIdSuffixRegex string = "(__[0-9]+)"

UserRoleIdSuffixRegex is the pattern used when versioning the different roles (from payment integrators)

View Source
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

func DecodeRequestBody(request *http.Request, parsedRequestObject interface{}) error

DecodeRequestBody attempts to decode request to object. returns error on failure

func GenerateNanoId

func GenerateNanoId() string

GenerateNanoId is returning a nano id

func GenerateUuidV4

func GenerateUuidV4() string

GenerateUuidV4 returns Uuidv4 string

func OutputBasicLogString

func OutputBasicLogString(level, message string) string

OutputBasicLogString attempts to output log in a JSON format otherwise will default to plain text

func StringRemoveMultiSpace

func StringRemoveMultiSpace(s string) string

StringRemoveMultiSpace subsitutes all multispace with single space

func StringStandardisedToLower

func StringStandardisedToLower(s string) string

StringStandardisedToLower returns a string with no explicit spacing strategy that is all lowercase and standardised.

func StripNonAlphanumericCharactersRegex

func StripNonAlphanumericCharactersRegex(in []byte, with []byte) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL