Documentation
¶
Index ¶
- func CopyFile(src, dest string) error
- func CopyFileToDir(src, destDir string) (string, error)
- func DeepHashString(obj interface{}) string
- func GetKey(obj metav1.Object) client.ObjectKey
- func GetMapNested(m map[string]interface{}, key string, keys ...string) (interface{}, bool)
- func IsNil(v interface{}) bool
- func ListFiles(root, pattern string) ([]string, error)
- func MergeMap(sources ...map[string]string) map[string]string
- func MergeMapNested(allowOverwrite bool, sources ...map[string]interface{}) (map[string]interface{}, error)
- func PutMapNested(allowOverwrite bool, m map[string]interface{}, val interface{}, key string, ...) error
- func ReadLines(file string) ([]string, error)
- func RemoveValue(slice []string, value string) []string
- func SliceContains(slice []string, s string) bool
- func UnmarshalToMap(data []byte) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶ added in v1.1.0
CopyFile copies file src to file dest. File src must exist. File dest doesn't need to exist nor its parent directories, they will be created if required. Existing dest file will be overwritten.
func CopyFileToDir ¶ added in v1.1.0
CopyFileToDir copies file src to directory destDir. File src must exist. Directory destDir doesn't need exist nor its parent directories, they will be created if required. The destination file will have the same name as src. If that file already exists, it will be overwritten.
func DeepHashString ¶
func DeepHashString(obj interface{}) string
func GetMapNested ¶ added in v1.1.0
GetMapNested gets the value at the given keys in the given map. It returns nil and false if the map does not contain any of the keys.
func ListFiles ¶ added in v1.1.0
ListFiles lists all files whose names match pattern in root directory and its subdirectories.
func MergeMap ¶
MergeMap will take two or more maps, merging the entries of the sources map into a destination map. If both maps share the same key then destination's value for that key will be overwritten with what's in source.
func MergeMapNested ¶ added in v1.1.0
func MergeMapNested(allowOverwrite bool, sources ...map[string]interface{}) (map[string]interface{}, error)
MergeMapNested will take two or more maps, merging the entries of the sources map into a destination map. If both maps share the same key then destination's value for that key will be merged with what's in source. The source maps are not modified.
func PutMapNested ¶ added in v1.1.0
func PutMapNested(allowOverwrite bool, m map[string]interface{}, val interface{}, key string, keys ...string) error
PutMapNested puts the given value in the given map at the given keys. When a key is not present, the entry is created on the fly; created entries are always of type map[string]interface{} to allow for nested entries to be further inserted.
func RemoveValue ¶
func SliceContains ¶
func UnmarshalToMap ¶
Types ¶
This section is empty.