{"modulePath":"github.com/AlaudaDevops/pkg","version":"v0.14.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package maps\n\nPackage maps contains methods to operate maps of all kinds\n\nPackage maps contains methods to operate maps of all kinds\n\n## Functions\n\n```go\nfunc AsBool(data map[string]string, key string) (*bool, error)\n```\nAsBool will parse value in data\\[\"key\"] to bool if the key not exist, it will return nil if the value is not a valid bool string, it will return error\n\n```go\nfunc AsObject(data map[string]string, key string, object interface{}) error\n```\nAsObject will parse value in data\\[\"key\"] to object it expects the value should be yaml content\n\n```go\nfunc IsSameStringMap(first map[string]string, second map[string]string) bool\n```\nIsSameStringMap return true if provided two map\\[string]string are same or false if they are different\n\n```go\nfunc MergeMap(left, right map[string]string) map[string]string\n```\nMergeMap merges the right map into left map overwritting any matching keys\n\n```go\nfunc MergeMapIfNotExists(left, right map[string]string) map[string]string\n```\nMergeMapIfNotExists merges the right map into left map if right key is not exists in left\n\n```go\nfunc MergeMapMap(left, right map[string]map[string]string) map[string]map[string]string\n```\nMergeMapMap merges the right map into left map overwritting any matching keys\n\n```go\nfunc MergeMapSlice(left, right map[string][]string) map[string][]string\n```\nMergeMapSlice merges the right map into left map overwritting any matching keys\n\n```go\nfunc SelectAndMutateMap(maps map[string]string, match MatchFunc, mutate MutateFunc) map[string]string\n```\nSelectAndMutateMap select elements from a map based on a match function and mutate it's key and value\n\n## Types\n\n```go\ntype KeyValue struct {\n\t// Key of the map\n\tKey string\n\t// Value of string map\n\tValue string\n}\n```\nKeyValue a key/value pair just like a map\\[string]string\n\n```go\nfunc SortedKeyValue(dict map[string]string) (items []KeyValue)\n```\nSortedKeyValue returns a list of key values sorted by key\n\n```go\ntype MatchFunc func(key, value string) bool\n```\nMatchFunc return true if key and value match condition\n\n```go\ntype MutateFunc func(key, value string) (string, string)\n```\nMutateFunc return mutated key and value\n\n","path":"github.com/AlaudaDevops/pkg/maps","name":"maps","synopsis":"Package maps contains methods to operate maps of all kinds","isRedistributable":true}
