Documentation ¶
Index ¶
- Variables
- func ConcatSlice(first, second []string) []string
- func FormatFilters(filters []string) (map[string][]string, error)
- func FormatFiltersWithKeyConverter(filters []string, keyNameConverter func(string) string) (map[string][]string, error)
- func GetFileName(path string) string
- func GetFullPlatformName(name, release string) string
- func GetFullProfileName(name, release string) string
- func GetLastLine(input string) string
- func IndexOf(haystack []string, needle string) (int, error)
- func IsNumeric(word string) bool
- func SliceContains(haystack []string, needle string) bool
- func SliceDifference(first, second []string) []string
- func SliceFilter(in []string, f func(string) bool) []string
- func SliceIntersection(first, second []string) []string
- func SliceReject(haystack []string, needle string) []string
- func SubSlice(s1 []string, s2 []string) bool
- func Title(s string) string
- func TitleReplace(s string, sep string, rep string) string
- func TitleSplit(s string, sep string) string
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("Not found")
Functions ¶
func ConcatSlice ¶
func FormatFilters ¶
FormatFilters Will receive an array of filters and will format them into a map of strings
Example:
[ "environment:adios", "environment:hola", "cookbook:awesome", "roles:lalala", ]
The returned filters would look like:
map[string][]string [
"environment": ["adios","hola"], "cookbook": ["awesome"], "roles": ["lalala"],
]
func FormatFiltersWithKeyConverter ¶
func FormatFiltersWithKeyConverter(filters []string, keyNameConverter func(string) string) (map[string][]string, error)
FormatFiltersWithKeyConverter The same as FormatFilters with the function keyNameConverter that converts the keys from aliases.
func GetFileName ¶
func GetFullPlatformName ¶
func GetFullProfileName ¶
func GetLastLine ¶
func SliceContains ¶
func SliceDifference ¶
This method is used to return uncomman elements between the two slices. It returns (A-B) operation
func SliceFilter ¶
SliceFilter calls the input function on each element of the input slice and returns a slice of all elements for which the function returns true. From here: https://gobyexample.com/collection-functions
func SliceIntersection ¶
This method is used to return comman elements between the two slices
func SliceReject ¶
SliceReject takes a slice of strings and a string to removed a returns a slice with any matching reject strings removed.
func Title ¶
Title returns a copy of the string s with all Unicode letters that begin words mapped to their title case. strings.Title has been deprecated since Go 1.18
func TitleSplit ¶
TitleSplit splits the string s by sep and returns a copy of the string s with all Unicode letters that begin words mapped to their title case.
Types ¶
This section is empty.