Documentation ¶
Index ¶
- func Concat(args []string, separator string) string
- func ConcatP(args ...*string) string
- func Equal(a string, b string) bool
- func Float64ToString(number float64, precision int) string
- func Float64ToStringWithPrec(number float64, prec int) 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 KeyToHumanReadable(s string) string
- func LimitStringToMaxLength(str string, maxLen int) string
- func PascalCaseToSentence(pascal string) string
- func PrettyJSON(jsonString string) (validJson bool, prettyString string)
- func RemoveAllWhiteSpaces(s 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 StringTrimQuotes(stringToTrim string) string
- func ToJSONString(object interface{}) (string, error)
- func TrimP(sp *string) *string
- func TrimQuotes(stringToTrim string) string
- func ValidateStringAsInt64(stringValue string) error
- type KeyReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Concat ¶ added in v1.111.0
Concat concatenates all specified non-empty strings with ", " separators
func Float64ToString ¶
func Float64ToStringWithPrec ¶
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 KeyToHumanReadable ¶
func LimitStringToMaxLength ¶
func PascalCaseToSentence ¶
func PrettyJSON ¶ added in v1.101.0
func RemoveAllWhiteSpaces ¶
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 StringTrimQuotes ¶
StringTrimQuotes - trims quotes from a string (ie: "foo" will return foo)
func ToJSONString ¶
func TrimQuotes ¶
TrimQuotes - trims quotes from a string (ie: "foo" will return foo)
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