util

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorkQueue added in v0.2.0

func NewWorkQueue(queueName string) workqueue.RateLimitingInterface

func RemovePaths added in v0.7.0

func RemovePaths(m map[string]any, excludedPaths []string, pathSeparator string)

RemovePaths removes all of the excludedPaths passed in from m, where each excludedPath is a string representation of the path, demarcated by pathSeparator

func SplitMap added in v0.6.0

func SplitMap(m map[string]any, paths []string, excludedPaths []string, pathSeparator string) (onlyPaths map[string]any, withoutPaths map[string]any, err error)

SplitMap returns 2 maps from a given map and a slice of paths. One of the 2 output maps will include only the paths from the slice while the second returned map will include all other paths. NOTE: any path in "paths" which is not found in m will have an associated key in "onlyPaths", which is "{}" If the caller is calling this function on 2 maps for the purpose of comparing them, and if the key is not found in either one, then 'key: {}' will be returned for both, and they will be deemed equal

Also ignores any paths in the excludedPaths list which are each demarcated by "pathSeparator" value

func SplitObject added in v0.6.0

func SplitObject(obj []byte, paths []string, excludedPaths []string, pathSeparator string) (map[string]any, map[string]any, error)

SplitObject returns 2 maps from a given object as bytes array and a slice of paths. One of the 2 output maps will include only the paths from the slice while the second returned map will include all other paths.

func StructToStruct added in v0.2.0

func StructToStruct(src any, dst any) error

StructToStruct converts a struct type (src) into another (dst)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL