Documentation
¶
Index ¶
- func CombineMapTrees[K comparable](destination map[K]interface{}, input map[K]interface{})
- func GetMapValueAsIntViaPath(m map[string]interface{}, path string) int
- func GetMapValueAsMapViaPath(m map[string]interface{}, path string) map[string]interface{}
- func GetMapValueAsStringViaPath(m map[string]interface{}, path string) string
- func GetMapValueViaPath(m map[string]interface{}, path string) interface{}
- func KeyValuesToMap(values []string) map[string]string
- func MapHasValue[K comparable, V comparable](m map[K]V, value V) bool
- func MapKeys[V interface{}](m map[string]V) []string
- func MapToKeyValues(values map[string]string) []string
- func MapToString(m map[string]string) string
- func MergeMaps[K comparable, V interface{}](maps ...map[K]V) map[K]V
- func SetMapValueViaPath(m map[string]interface{}, path string, value interface{})
- func StringMapHasValue(m map[string]string, value string) bool
- func ToObjectMap(object interface{}) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineMapTrees ¶
func CombineMapTrees[K comparable](destination map[K]interface{}, input map[K]interface{})
CombineMapTrees recursively copies all the values from the input map into the destination map preserving any missing entries in the destination
func GetMapValueAsIntViaPath ¶
GetMapValueAsIntViaPath returns the int value at the given path mean `m["foo"]["bar"]["whatnot"]`
func GetMapValueAsMapViaPath ¶
GetMapValueAsMapViaPath returns the map value at the given path mean `m["foo"]["bar"]["whatnot"]`
func GetMapValueAsStringViaPath ¶
GetMapValueAsStringViaPath returns the string value at the given path mean `m["foo"]["bar"]["whatnot"]`
func GetMapValueViaPath ¶
GetMapValueViaPath returns the value at the given path mean `m["foo"]["bar"]["whatnot"]`
func KeyValuesToMap ¶
KeyValuesToMap converts the set of values of the form "foo=abc" into a map
func MapHasValue ¶ added in v3.4.8
func MapHasValue[K comparable, V comparable](m map[K]V, value V) bool
StringHasValue returns true if the given map contains the given value
func MapToKeyValues ¶
MapToKeyValues converts the map into a sorted array of key/value pairs
func MapToString ¶
MapToString converts the map to a string
func MergeMaps ¶
func MergeMaps[K comparable, V interface{}](maps ...map[K]V) map[K]V
MergeMaps merges all the maps together with the entries in the last map overwriting any earlier values
so if you want to add some annotations to a resource you can do resource.Annotations = kube.MergeMaps(resource.Annotations, myAnnotations)
func SetMapValueViaPath ¶
SetMapValueViaPath sets the map key using the given path which supports the form `foo.bar.whatnot` to mean `m["foo"]["bar"]["whatnot"]` lazily creating maps as the path is navigated
func StringMapHasValue ¶
StringMapHasValue returns true if the given map contains the given value
func ToObjectMap ¶
ToObjectMap converts the given object into a map of strings/maps using YAML marshalling
Types ¶
This section is empty.