Documentation ¶
Index ¶
- func EnumToStringArray[T ProtoEnum](items []T, f EnumToStringFunc) []string
- func FilterElementsFromList(l []string, without ...string) []string
- func Lower(e ProtoEnum) string
- func NamedGroupMatches(s string, re *regexp.Regexp) (map[string][]string, []string)
- func ProcessParamsAndQuotes(args []string) []string
- func RandomAlphanumeric(n int) string
- func ScrubANSICodes(input string) string
- func ScrubCredentials(s string) string
- func ScrubCredentialsAll(s string) string
- func StrOrDefault(str, defaultStr string) string
- func Title(e ProtoEnum) string
- type EnumToStringFunc
- type ProtoEnum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnumToStringArray ¶ added in v0.7.22
func EnumToStringArray[T ProtoEnum](items []T, f EnumToStringFunc) []string
EnumToStringArray takes an array of enum values and returns an array of their string values after applying EnumToStringFunc on each item
func FilterElementsFromList ¶ added in v0.8.2
FilterElementsFromList filters out elements from a given list
func NamedGroupMatches ¶ added in v0.7.20
NamedGroupMatches returns a map with all found named regex groups as keys and an array of all matches as the value and an array of all the keys in the order they were set in the regex (this is since the map keys order won't be predictable).
func ProcessParamsAndQuotes ¶ added in v0.7.6
ProcessParamsAndQuotes takes in a slice of strings, and rearranges the slices depending on quotes and parenthesis.
For example "hello ", "wor(", "ld)" becomes "hello ", "wor( ld)".
func RandomAlphanumeric ¶ added in v0.6.20
RandomAlphanumeric returns a random alphanumeric string of length n
func ScrubANSICodes ¶ added in v0.8.13
ScrubANSICodes removes ANSI escape codes from a string.
func ScrubCredentials ¶
ScrubCredentials removes credentials from a string
func ScrubCredentialsAll ¶ added in v0.7.19
ScrubCredentialsAll scrubs all credentials from a longer piece of text.
func StrOrDefault ¶
StrOrDefault returns str or defaultStr when str is empty.
Types ¶
type EnumToStringFunc ¶ added in v0.7.22
EnumToStringFunc takes an ProtoEnum and returns a string