Documentation
¶
Index ¶
- func DownloadFile(URL, destFile string) error
- func FileExists(path string) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsURL(s string) bool
- func MapInterfaceInterfaceToMapStringInterface(mapInterfaceInterface map[interface{}]interface{}) map[string]interface{}
- func MapStringInterfaceGetOrDefault(mapStringInterface map[string]interface{}, key string, ...) interface{}
- func MapToSlice(m map[string]interface{}) []interface{}
- func Redact(redactions []string, runOutput string) string
- func RemoveEmptyLines(input string) string
- func RetryUntilSuccessful(duration time.Duration, interval time.Duration, callback func() bool) error
- func RunningInContainer() bool
- func StringMapToString(source map[string]string) string
- func StringSliceToIntSlice(stringSlice []string) ([]int, error)
- func StringToStringMap(source string, separator string) map[string]string
- func StripPrefixes(input string, prefixes []string) string
- func StructureToMap(input interface{}) map[string]interface{}
- func TempFileSuffix(dir, suffix string) (f *os.File, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
func FileExists ¶
FileExists returns true if the file @ path exists
func MapInterfaceInterfaceToMapStringInterface ¶
func MapInterfaceInterfaceToMapStringInterface(mapInterfaceInterface map[interface{}]interface{}) map[string]interface{}
MapInterfaceInterfaceToMapStringInterface recursively converts map[interface{}]interface{} to map[string]interface{}
func MapStringInterfaceGetOrDefault ¶
func MapStringInterfaceGetOrDefault(mapStringInterface map[string]interface{}, key string, defaultValue interface{}) interface{}
MapStringInterfaceGetIntOrDefault will return the key as an integer or return a default
func MapToSlice ¶
func MapToSlice(m map[string]interface{}) []interface{}
MapToSlice converts {key1: val1, key2: val2 ...} to [key1, val1, key2, val2 ...]
func RemoveEmptyLines ¶
RemoveEmptyLines removes all empty lines from a string
func RetryUntilSuccessful ¶
func RetryUntilSuccessful(duration time.Duration, interval time.Duration, callback func() bool) error
RetryUntilSuccessful calls callback every interval for duration until it returns true
func RunningInContainer ¶
func RunningInContainer() bool
RunningInContainer returns true if currently running in a container, false otherwise
func StringMapToString ¶
StringMapToString converts a map of a: x, b: y to a string in the form of "a=x,b=y"
func StringSliceToIntSlice ¶
StringSliceToIntSlice converts slices of strings to slices of int. e.g. ["1", "3"] -> [1, 3]
func StringToStringMap ¶
StringToStringMap converts a string in the form of a{separator}x,b{separator}y to a map of a: x, b: y, inputs source-string & string-separator
func StripPrefixes ¶
func StructureToMap ¶
func StructureToMap(input interface{}) map[string]interface{}
StructureToMap converts a strcuture to a map, flattening all members
func TempFileSuffix ¶
TempFile creates a new temporary file in the directory dir with a name beginning with prefix, opens the file for reading and writing, and returns the resulting *os.File. If dir is the empty string, TempFile uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempFile simultaneously will not choose the same file. The caller can use f.Name() to find the pathname of the file. It is the caller's responsibility to remove the file when no longer needed.
Types ¶
This section is empty.