Documentation ¶
Index ¶
- func ByteArrayToString(b []byte) string
- func DownloadFile(URL, destFile string) error
- func FileExists(path string) bool
- func GetObjectSlice(configuration *viper.Viper, key string) []map[string]interface{}
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsURL(s string) bool
- func RetryUntilSuccessful(duration time.Duration, interval time.Duration, callback func() bool) error
- func StringMapToString(source map[string]string) string
- func StringSliceToIntSlice(stringSlice []string) ([]int, error)
- func StringToStringMap(source string) map[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 ByteArrayToString ¶
ByteArrayToString converts a byte array to a string
func DownloadFile ¶
func FileExists ¶
FileExists returns true if the file @ path exists
func GetObjectSlice ¶
GetObjectSlice extracts a list of objects from a viper instance. there may be a better way to do this with viper but i've yet to find it (TODO: post issue?)
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 StringMapToString ¶
StringToStringMap 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=x,b=y to a map of a: x, b: y
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.