Documentation ¶
Index ¶
- func AddSlashes(str string) string
- func AppAddress() string
- func AppEnv() string
- func AppInDevelopment() bool
- func AppInLive() bool
- func AppInProduction() bool
- func AppInTesting() bool
- func AppName() string
- func AppPort() string
- func AppURL() string
- func ArrayContains(array interface{}, val interface{}) (exists bool, index int)
- func ArrayEqualsInt(a []int, b []int) bool
- func ArrayEqualsStr(a, b []string) bool
- func ArrayMerge(array ...[]interface{}) []interface{}
- func ArrayReverse[T any](arr []T) []T
- func ArrayUnique(strSlice []string) []string
- func Base64Decode(src string) ([]byte, error)
- func Base64Encode(src []byte) string
- func CookieGet(r *http.Request, name string) string
- func CookieSet(w http.ResponseWriter, name string, value string, seconds int)
- func DbDatabase() string
- func DbDriver() string
- func DbHost() string
- func DbPassword() string
- func DbPort() string
- func DbQuery(db *sql.DB, query string) (result map[int]map[string]string, err error)
- func DbUsername() string
- func EmailFromAddress() string
- func EmailFromName() string
- func EmailSend(from string, to []string, subject string, htmlMessage string) (bool, error)
- func Env(key string) string
- func EnvInitialize()
- func FileExists(filePath string) bool
- func FileGetContents(filename string) (string, error)
- func FilePutContents(filename string, data string, mode os.FileMode) error
- func FileToBase64(filePath string) string
- func FromJSON(jsonString string, valueDefault interface{}) (interface{}, error)
- func IP(r *http.Request) string
- func ImgPlaceholderURL(width int, height int, text string) string
- func ImgToBase64Url(filePath string) string
- func InArray(val interface{}, array interface{}) (index int)
- func InterfaceToStringArray(v interface{}) []string
- func IsNumeric(s string) bool
- func IsStringArrayEqual(a, b []string) bool
- func LinkWebsite() string
- func MapToColumn(inputMap []map[string]string, keyName string) []string
- func MapToKeyValue(inputMap []map[string]string, keyName string, valueName string) map[string]string
- func MinCSS(cssString string) (string, error)
- func MinHTML(htmlString string) (string, error)
- func MinScript(sctiptString string) (string, error)
- func RandStr(length int) stringdeprecated
- func RandStrFromGamma(length int, gamma string) stringdeprecated
- func Req(r *http.Request, key string, defaultValue string) string
- func RespondJSON(w http.ResponseWriter, response api.Response)
- func ScriptsHTML(str string) string
- func Slugify(s string, replaceWith rune) stringdeprecated
- func StrBetween(str string, startNeedle string, endNeedle string) (result string, found bool)
- func StrLeftFrom(str, needle string) string
- func StrPadLeft(input string, padLength int, padString string) string
- func StrRandom(length int) string
- func StrRandomFromGamma(length int, gamma string) string
- func StrRightFrom(str, needle string) string
- func StrSlugify(s string, replaceWith rune) string
- func StrToBcryptHash(str string) (string, error)
- func StrToBcryptHashCompare(str string, hash string) bool
- func StrToBytes(s string) []byte
- func StrToInt(s string) (int, error)
- func StrToInt64(s string) (int64, error)
- func StrToMD5Hash(text string) string
- func StrToSHA1Hash(text string) string
- func StrToSHA256Hash(text string) string
- func StrToTimeUnix(str string) (int64, error)
- func StylesHTML(str string) string
- func TemplateParseString(templateString string, data interface{}) string
- func ToBool(str string) bool
- func ToJSON(value interface{}) (string, error)
- func ToString(v interface{}) string
- func Unlink(filename string) error
- func XORDencode(buffer []byte, key []byte) []byte
- func XOREncode(buffer []byte, key []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSlashes ¶ added in v1.4.5
AddSlashes returns a string with backslashes added before characters that need to be escaped.
These characters are: single quote (') double quote (") backslash (\)
func AppAddress ¶ added in v1.2.1
func AppAddress() string
AppAddress return the full URL and PORT for the app
func AppEnv ¶ added in v1.2.1
func AppEnv() string
AppEnv returns the environment the app is running in
func AppInDevelopment ¶ added in v1.14.0
func AppInDevelopment() bool
AppInDevelopment return whether app is in development
func AppInLive ¶ added in v1.14.0
func AppInLive() bool
AppInProduction return whether app is in production / live
func AppInProduction ¶ added in v1.14.0
func AppInProduction() bool
AppInProduction return whether app is in production / live
func AppInTesting ¶ added in v1.14.0
func AppInTesting() bool
AppInTesting return whether app is being tested
func ArrayContains ¶ added in v1.3.7
ArrayContains checks whether an array contains the specified value
func ArrayEqualsInt ¶ added in v1.18.0
ArrayEquals checks whether 2 string arrays are the same
func ArrayEqualsStr ¶ added in v1.18.0
ArrayEquals checks whether 2 string arrays are the same
func ArrayMerge ¶ added in v1.7.0
func ArrayMerge(array ...[]interface{}) []interface{}
ArrayMerge merges two arrays
func ArrayReverse ¶ added in v1.19.0
func ArrayReverse[T any](arr []T) []T
ArrayReverse creates a new reversed array
func ArrayUnique ¶ added in v1.22.0
TODO. ArrayUnique removes duplicate strings from a string slice
func Base64Decode ¶ added in v1.13.0
Base64Encode decodes a string from Base64
func Base64Encode ¶ added in v1.13.0
Base64Encode encodes a string to Base64
func CookieSet ¶ added in v1.20.0
func CookieSet(w http.ResponseWriter, name string, value string, seconds int)
func DbDatabase ¶ added in v1.2.2
func DbDatabase() string
DbDatabase return the name of the database
func DbPassword ¶ added in v1.2.2
func DbPassword() string
DbPassword return the password for the database
func DbUsername ¶ added in v1.2.2
func DbUsername() string
DbUsername return the username of the database
func EmailFromAddress ¶ added in v1.2.1
func EmailFromAddress() string
EmailFromAddress return the URL for the app
func EmailFromName ¶ added in v1.2.1
func EmailFromName() string
EmailFromName return the URL for the app
func EnvInitialize ¶ added in v1.4.7
func EnvInitialize()
EnvInitialize intializes the environment variables
func FileExists ¶ added in v1.2.4
FileExists checks if a file exists
func FileGetContents ¶ added in v1.2.4
FileGetContents reads entire file into a string
func FilePutContents ¶ added in v1.5.0
FilePutContents adds content to file
func FileToBase64 ¶ added in v1.4.12
FileToBase64 converts a file to Base64 encoded string
func ImgPlaceholderURL ¶ added in v1.25.0
ImgPlaceholderURL returns a placeholder image
func ImgToBase64Url ¶ added in v1.4.12
ImgToBase64Url converts an image file to Base64 encoded URL string
func InArray ¶ added in v1.2.1
func InArray(val interface{}, array interface{}) (index int)
TODO. Update ArrayContents to use this style as its more readable
func InterfaceToStringArray ¶ added in v1.4.1
func InterfaceToStringArray(v interface{}) []string
InterfaceToStringArray converts an interface to String array
func IsStringArrayEqual ¶ added in v1.4.1
IsStringArrayEqual checks whether 2 string arrays are the same
func LinkWebsite ¶ added in v1.3.1
func LinkWebsite() string
LinkWebsite returns a URL to the current website
func MapToColumn ¶ added in v1.3.2
MapToColumn Returns a column from map
func MapToKeyValue ¶ added in v1.3.2
func MapToKeyValue(inputMap []map[string]string, keyName string, valueName string) map[string]string
MapToKeyValue returns a key-value array an array of maps
func RandStrFromGamma
deprecated
added in
v1.13.0
func RespondJSON ¶ added in v1.4.10
func RespondJSON(w http.ResponseWriter, response api.Response)
RespondJSON returns an API response as JSON
func ScriptsHTML ¶ added in v1.4.6
ScriptsHTML the HTML from scripts string
func Slugify
deprecated
added in
v1.3.2
Slugify replaces each run of characters which are not ASCII letters or numbers with the Replacement character, except for leading or trailing runs. Letters will be stripped of diacritical marks and lowercased. Letter or number codepoints that do not have combining marks or a lower-cased variant will be passed through unaltered.
Deprecated: Slugify is deprecated, new code should use StrSlugify instead.
func StrBetween ¶ added in v1.17.0
StrBetween returns the string between two needles
func StrLeftFrom ¶ added in v1.16.0
StrLeftFrom returns the substring on the left side of the needle
func StrPadLeft ¶ added in v1.24.0
func StrRandomFromGamma ¶ added in v1.17.0
StrRandomFromGamma generates random string of specified length with the characters specified in the gamma string
func StrRightFrom ¶ added in v1.16.0
StrRightFrom returns the substring on the left side of the needle
func StrSlugify ¶ added in v1.18.0
StrSlugify replaces each run of characters which are not ASCII letters or numbers with the Replacement character, except for leading or trailing runs. Letters will be stripped of diacritical marks and lowercased. Letter or number codepoints that do not have combining marks or a lower-cased variant will be passed through unaltered.
func StrToBcryptHash ¶ added in v1.22.0
StrToBcryptHash converts the string to bcrypt hash
func StrToBcryptHashCompare ¶ added in v1.22.0
StrToBcryptHashCompare compares the string to a bcrypt hash
func StrToBytes ¶ added in v1.17.0
StrToBytes converts string to bytes
func StrToInt64 ¶ added in v1.7.0
StrToInt64 converts a string to Int64
func StrToMD5Hash ¶ added in v1.13.0
StrToMD5Hash converts a string to MD5 hash
func StrToSHA1Hash ¶ added in v1.13.0
StrToSHA1Hash converts a string to SHA1 hash
func StrToSHA256Hash ¶ added in v1.13.0
StrToSHA256Hash converts a string to SHA256 hash
func StrToTimeUnix ¶ added in v1.7.0
StrToTimeUnix converts sting to Unix time
func TemplateParseString ¶
TemplateParseString parses a template string with the passed data
func ToBool ¶ added in v1.21.0
ToBool converts a string with common names ("yes", "true", "1") to boolean
func ToString ¶ added in v1.6.0
func ToString(v interface{}) string
ToString converts an interface to string
func XORDencode ¶ added in v1.20.0
Types ¶
This section is empty.
Source Files ¶
- AddSlashes.go
- ArrayContains.go
- ArrayEquals.go
- ArrayMerge.go
- ArrayReverse.go
- ArrayUnique.go
- Base64Decode.go
- Base64Encode.go
- CookieGet.go
- CookieSet.go
- DbQuery.go
- EmailSend.go
- FileExists.go
- FileGetContents.go
- FilePutContents.go
- FileToBase64.go
- FromJSON.go
- IP.go
- ImgPlaceholderURL.go
- IsNumeric.go
- LinkWebsite.go
- MapToColumn.go
- MapToKeyValue.go
- Req.go
- RespondJSON.go
- StrBetween.go
- StrLeftFrom.go
- StrPadLeft.go
- StrRandom.go
- StrRandomFromGamma.go
- StrRightFrom.go
- StrSlugify.go
- StrToBcryptHash.go
- StrToBcryptHashCompare.go
- StrToBytes.go
- StrToInt.go
- StrToInt64.go
- StrToMD5Hash.go
- StrToSHA1Hash.go
- StrToSHA256Hash.go
- StrToTimeUnix.go
- ToBool.go
- ToJSON.go
- ToString.go
- XORDecode.go
- XOREncode.go
- app.go
- arrays.go
- env.go
- files.go
- html.go
- interface.go
- misc.go
- strings.go
- templates.go