utils

package
v1.118.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsHeaders

func CorsHeaders() map[string]string

CorsHeaders returns a map to allow Cors

func DeepCopy

func DeepCopy(fromValue interface{}) (toValue interface{})

func FormatPhoneNumber added in v1.113.0

func FormatPhoneNumber(phoneNumber string) string

func GetEnv

func GetEnv(name string, def string) (env string)

GetEnv is a helper function for getting environment variables with a default

func IsUrlStrict added in v1.113.0

func IsUrlStrict(str string) bool

IsUrlStrict Returns whether a URL is valid in a strict way (Must have scheme and host)

func IsValidUsername added in v1.113.0

func IsValidUsername(str string) bool

func PointerToValue added in v1.113.0

func PointerToValue[V any](value *V) V

func RemoveUrlScheme added in v1.113.0

func RemoveUrlScheme(str string) string

RemoveUrlScheme Removes http:// or https:// from a URL

func StandardisePhoneNumber added in v1.113.0

func StandardisePhoneNumber(number string) string

StandardisePhoneNumber standardises phone numbers with +27 instead of 0 prefix

func StripQueryString added in v1.113.0

func StripQueryString(inputUrl string) (string, error)

StripQueryString - Strips the query parameters from a URL

func UnzipData

func UnzipData(data []byte) (map[string][]byte, error)

func ValidateEmailAddress added in v1.113.0

func ValidateEmailAddress(email string) (string, error)

func ValueToPointer added in v1.113.0

func ValueToPointer[V any](value V) *V

func ZipData

func ZipData(fileName string, data []byte) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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