Documentation
¶
Index ¶
- func CompareMaps(existing, new map[string]string) bool
- func CompareMapsWithExceptions(existing, new map[string]string, prefixExceptions ...string) bool
- func CompareStructNumTypeAgnostic(src, dst any) bool
- func ConvertInterfaceMapToStringMap(interfaceMap map[string]interface{}) map[string]string
- func ExtractPath(data any, path []string) (any, bool, error)
- func IsMapSubset(requiredKVPairs map[string]string, mapToCheck map[string]string) bool
- func IsNumber(value any) bool
- func MergeMaps(existing, new map[string]string) map[string]string
- func NewWorkQueue(queueName string) workqueue.TypedRateLimitingInterface[interface{}]
- func OptionalString(ptr any) string
- func RemovePaths(m map[string]any, excludedPaths []string, pathSeparator string)
- func ResolveTemplatedSpec(data any, args map[string]interface{}) (map[string]interface{}, error)
- func StructToStruct(src any, dst any) error
- func ToFloat64(value any) (float64, bool)
- func ToInt64(value any) (int64, bool)
- type OptionalBoolStr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareMaps ¶ added in v0.9.0
func CompareMapsWithExceptions ¶ added in v0.23.0
CompareMapsWithExceptions compares two maps but ignoring any differences where the keys are prefixed with any of the 'prefixExceptions'
func CompareStructNumTypeAgnostic ¶ added in v0.13.0
CompareStructNumTypeAgnostic compares two structs, ignoring the type of numbers (e.g., int, float32, float64) and treating them as equal if their values are equal.
func ConvertInterfaceMapToStringMap ¶ added in v0.28.0
ConvertInterfaceMapToStringMap converts a map[string]interface{} to map[string]string by type asserting each value to string. Non-string values are skipped.
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 IsMapSubset ¶ added in v0.27.0
func NewWorkQueue ¶ added in v0.2.0
func NewWorkQueue(queueName string) workqueue.TypedRateLimitingInterface[interface{}]
func OptionalString ¶ added in v0.13.0
take any pointer passed in and print "nil" if it's nil, and otherwise the value (convenience function for logging)
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 ResolveTemplatedSpec ¶ added in v0.27.0
resolves templated definitions of a resource with any arguments
func StructToStruct ¶ added in v0.2.0
StructToStruct converts a struct type (src) into another (dst)
Types ¶
type OptionalBoolStr ¶ added in v0.28.3
type OptionalBoolStr string
OptionalBoolStr is a string type that represents an optional boolean value
func (OptionalBoolStr) ToString ¶ added in v0.28.3
func (o OptionalBoolStr) ToString() string