Documentation
¶
Index ¶
- func ConvertMap[T any](m Map) (T, error)
- func GetPathAs[T any](m Map, name string) T
- type Map
- func (m Map) GetPath(name string) (any, bool)
- func (m Map) GetPathMap(s string) (Map, bool)
- func (m Map) GetPathString(s string) string
- func (m Map) GetPathStringOr(s string, def string) string
- func (m Map) JSON() string
- func (m Map) MergeFrom(other Map)
- func (m Map) SetPath(paths string, value any) error
- func (m Map) SetPaths(paths ...string) error
- func (m Map) SetSpecPaths(paths ...string) error
- func (m Map) YAML() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMap ¶
ConvertMap translates a Map to a T, via JSON
Types ¶
type Map ¶
Map is a wrapper around an untyped map, used throughout the operator codebase for generic access.
func MapFromJSON ¶
MapFromJSON constructs a Map from JSON
func MapFromYAML ¶
MapFromYAML constructs a Map from YAML
func MustCastAsMap ¶
MustCastAsMap casts a value to a Map; if the value is not a map, it will panic..
func (Map) GetPathString ¶
GetPathString is a helper around TryGetPathAs[string] to allow usage as a method (otherwise impossible with generics)
func (Map) GetPathStringOr ¶
GetPathStringOr is a helper around TryGetPathAs[string] to allow usage as a method (otherwise impossible with generics), with an allowance for a default value if it is not found/not set.
func (Map) MergeFrom ¶
MergeFrom does a key-wise merge between the current map and the passed in map. The other map has precedence, and the result will modify the current map.
func (Map) SetPath ¶
SetPath applies values from a path like `key.subkey`, `key.[0].var`, or `key.[name:foo]`.
func (Map) SetSpecPaths ¶
SetSpecPaths applies values from input like `key.subkey=val`, and applies them under 'spec'