Documentation ¶
Index ¶
- func AskForConfirmation(s string) bool
- func BodyToString(body io.Reader) (string, error)
- func DoesFileExist(filename string) (fileok bool)
- func EnvVariable(exportedName string) (variable string, err error)
- func PrettyJson(i interface{}) (string, error)
- func ReadWholeFile(path string) (body string, err error)
- func ResolveEnv(envName, def string) string
- func SliceContains(slice []string, needle string) bool
- func SlicesDiff(oldSlice, newSlice []string) (removed, added []string)
- func StructToMap(entry interface{}) (retval map[string]interface{})
- func Untar(path string, destinationpath string) error
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskForConfirmation ¶
AskForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.
func BodyToString ¶
BodyToString returns the pure json-string data to screen
func DoesFileExist ¶
func EnvVariable ¶
func PrettyJson ¶
PrettyJson returns pretty converted json
func ReadWholeFile ¶
ReadWholeFile opens and reads whole file and return a body of this file Note that this function should not be used for big files!
func ResolveEnv ¶
ResolveEnv check the env with the provived name and if doesn't exist it will create it and set value to the provided one
func SliceContains ¶
func SlicesDiff ¶
SlicesDiff comparef two slices together and returns two slices of the difference The first slice contains what's been removed, opposite to the other slice Note: First passed slice should be the old/previous/base one, second the new/current one
func StructToMap ¶
func StructToMap(entry interface{}) (retval map[string]interface{})