Documentation
¶
Index ¶
- func DeepCopyMap(in map[string]any) map[string]any
- func DeepCopyValue(value any) any
- func DeleteValueAtPath(data any, keys []string) error
- func GetValueAtPath(data any, keys []string) (any, error)
- func NavigateToParentMap(data any, keys []string, createMissing bool) (parentMap map[string]any, lastKey string, err error)
- func SetValueAtPath(data any, keys []string, value any) error
- type KeyNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepCopyValue ¶
DeepCopyValue creates a deep copy of an any value.
func DeleteValueAtPath ¶
DeleteValueAtPath deletes the value at the specified path in the data map. If path is not found, this is a noop.
func GetValueAtPath ¶
GetValueAtPath retrieves the value at the specified path in the data map.
func NavigateToParentMap ¶
func NavigateToParentMap( data any, keys []string, createMissing bool, ) (parentMap map[string]any, lastKey string, err error)
NavigateToParentMap navigates to the parent map of the last key in the given path. It returns the parent map, the last key, and any error encountered. If createMissing is true, it creates any missing maps along the path.
Types ¶
type KeyNotFoundError ¶
KeyNotFoundError is a custom error type for missing keys.
func (*KeyNotFoundError) Error ¶
func (e *KeyNotFoundError) Error() string
Error implements the error interface.
Click to show internal directories.
Click to hide internal directories.