Documentation
¶
Index ¶
- func CopyFile(src, dest string) error
- func CopyFileToDir(src, destDir string) (string, error)
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func DeepHashString(obj interface{}) string
- func FindEnvVar(envVars []corev1.EnvVar, name string) *corev1.EnvVar
- func FindEnvVarInContainer(container *corev1.Container, name string) *corev1.EnvVar
- func GetKey(obj metav1.Object) client.ObjectKey
- func GetMapNested(m map[string]interface{}, key string, keys ...string) (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 DeepHashObject ¶ added in v1.3.0
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.
func DeepHashString ¶
func DeepHashString(obj interface{}) string
func FindEnvVar ¶ added in v1.2.0
func FindEnvVarInContainer ¶ added in v1.2.0
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 all 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. If allowOverwrite is false, an error is returned if the key already exists and its value is not nil.
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; nested entries are always of type map[string]interface{} to allow for nested entries to be further inserted. If allowOverwrite is false, an error is returned if the key already exists and its value is not nil.
func RemoveValue ¶
func SliceContains ¶
func UnmarshalToMap ¶
Types ¶
This section is empty.