Documentation ¶
Index ¶
- func ConcatP(args ...*string) string
- func Equal(a string, b string) bool
- func EscapeOpenSearchSearchString(str string) string
- func Float64ToString(number float64, precision int) string
- func Float64ToStringWithPrec(number float64, prec int) string
- func FormatPhoneNumber(phoneNumber string) string
- func Int64SliceToString(numbers []int64) string
- func Int64SliceToStringSlice(numbers []int64) []string
- func Int64ToString(number int64) string
- func IntToString(number int) string
- func IsAlphaNumeric(str string) bool
- func IsAlphaNumericOrDash(str string) bool
- func IsEmpty(sp *string) bool
- func IsNumericString(s string) bool
- func IsSnakeCase(name string) bool
- func IsUrlStrict(str string) bool
- func IsValidEmail(email string) bool
- func IsValidUsername(str string) bool
- func KeyToHumanReadable(s string) string
- func LimitStringToMaxLength(str string, maxLen int) string
- func PascalCaseToSentence(pascal string) string
- func PtoString(stringPointer *string) string
- func RemoveAllWhiteSpaces(s string) string
- func RemoveUrlScheme(str string) string
- func ReplaceCaseInsensitive(string, toReplace, replaceWith string) string
- func ReplaceNonSpacingMarks(str string) string
- func SentenceCase(str string) string
- func SnakeToKebabString(s string) string
- func SplitString(str string, sep []rune) []string
- func StandardisePhoneNumber(number string) string
- func StringToFloat64(stringValue string) (float64, error)
- func StringToInt(stringValue string) (int, error)
- func StringToInt64(stringValue string) (int64, error)
- func StringTrimQuotes(stringToTrim string) string
- func StripQueryString(inputUrl string) (string, error)
- func ToJSONString(object interface{}) (string, error)
- func TrimP(sp *string) *string
- func TrimQuotes(stringToTrim string) string
- func UnwrapString(s *string) string
- func ValidateStringAsInt64(stringValue string) error
- type KeyReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeOpenSearchSearchString ¶
EscapeOpenSearchSearchString See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters
func Float64ToString ¶
func Float64ToStringWithPrec ¶
func FormatPhoneNumber ¶
func Int64SliceToString ¶
func Int64SliceToStringSlice ¶
func Int64ToString ¶
func IntToString ¶
func IsAlphaNumeric ¶
func IsAlphaNumericOrDash ¶
func IsNumericString ¶
IsNumericString returns true if the string can be converted to a float without error
func IsSnakeCase ¶
func IsUrlStrict ¶
IsUrlStrict Returns whether a URL is valid in a strict way (Must have scheme and host)
func IsValidEmail ¶
func IsValidUsername ¶
func KeyToHumanReadable ¶
func LimitStringToMaxLength ¶
func PascalCaseToSentence ¶
func RemoveAllWhiteSpaces ¶
func RemoveUrlScheme ¶
RemoveUrlScheme Removes http:// or https:// from a URL
func ReplaceCaseInsensitive ¶
func ReplaceNonSpacingMarks ¶
ReplaceNonSpacingMarks removes diacritics e.g. êžů becomes ezu
func SentenceCase ¶
func SnakeToKebabString ¶
func SplitString ¶
SplitString separates a string on any character in the list of sep
func StandardisePhoneNumber ¶
StandardisePhoneNumber standardises phone numbers with +27 instead of 0 prefix
func StringToFloat64 ¶
func StringToInt ¶
func StringToInt64 ¶
func StringTrimQuotes ¶
StringTrimQuotes - trims quotes from a string (ie: "foo" will return foo)
func StripQueryString ¶
StripQueryString - Strips the query parameters from a URL
func ToJSONString ¶
func TrimQuotes ¶
TrimQuotes - trims quotes from a string (ie: "foo" will return foo)
func UnwrapString ¶
func ValidateStringAsInt64 ¶
Types ¶
type KeyReader ¶
type KeyReader interface { Keys(prefix string) []string GetString(key string) (value string, ok bool) }
KeyReader is an interface to read string "<key>":"<value>" pairs which is common to read from the environment it is abstracted so the same interface can be implemented for reading for example from REDIS and other sources
func EnvironmentKeyReader ¶
func EnvironmentKeyReader() KeyReader