Documentation ¶
Index ¶
- func CompareMaps(existing, new map[string]string) bool
- func ExtractPath(data any, path []string) (any, bool, error)
- func MergeMaps(existing, new map[string]string) map[string]string
- func NewWorkQueue(queueName string) workqueue.TypedRateLimitingInterface[interface{}]
- func RemovePaths(m map[string]any, excludedPaths []string, pathSeparator string)
- func StructToStruct(src any, dst any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareMaps ¶ added in v0.9.0
func ExtractPath ¶ added in v0.8.0
ExtractPath extracts the fields specified by the path (given as slice of strings) from the given data.
The function takes two arguments:
- data: The input data, which can be a map, a slice, or a nested combination of both.
- path: A slice of strings representing the path to the desired fields.
It returns three values:
- any: The extracted data, which can be a map, a slice, or a single value (including nil).
- bool: A boolean indicating whether last field in the path is a map.
- error: An error if any occurred during the extraction process.
The function works by recursively traversing the input data according to the provided path. It handles maps and slices, extracting the corresponding values at each level. If the path leads to a value that is neither a map nor a slice, it returns that value.
func NewWorkQueue ¶ added in v0.2.0
func NewWorkQueue(queueName string) workqueue.TypedRateLimitingInterface[interface{}]
func RemovePaths ¶ added in v0.7.0
RemovePaths removes all of the excludedPaths passed in from m, where each excludedPath is a string representation of the path, demarcated by pathSeparator
func StructToStruct ¶ added in v0.2.0
StructToStruct converts a struct type (src) into another (dst)
Types ¶
This section is empty.