Documentation
¶
Index ¶
- func FolderExists(path string) bool
- func GetDecompressedBytesFromRequest(req *http.Request) ([]byte, error)
- func GetEnvVarValueOrSetDefault(envVarName string, defaultVal string) string
- func GetFreePort() (int, error)
- func IsStringInSlice(a string, list []string) bool
- func ProcessError(l *zap.SugaredLogger, err error)
- func RunCommandInDir(l *zap.SugaredLogger, command string, args []string, dir string)
- func Unzip(l *zap.SugaredLogger, archivePath string, destinationFolderPath string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FolderExists ¶
FolderExists returns true if the specified folder exists, and false else.
func GetDecompressedBytesFromRequest ¶
GetDecompressedBytesFromRequest takes a HTTP request in argument and return the raw (decompressed) bytes of the body. The byte array can then be converted into a string for debugging / testing purposes.
func GetEnvVarValueOrSetDefault ¶
GetEnvVarValueOrSetDefault retrieves the environment variable envVarName. If the desired variable is not defined, defaultVal is returned.
func GetFreePort ¶
GetFreePort is a function that queries the kernel and obtains an unused port.
func IsStringInSlice ¶
IsStringInSlice is a utility function that checks if a slice of strings contains a specific string.
func ProcessError ¶
func ProcessError(l *zap.SugaredLogger, err error)
ProcessError is a shorthand function to handle fatal errors, the idiomatic Go way. This should only be used for showstopping errors.
func RunCommandInDir ¶
func RunCommandInDir(l *zap.SugaredLogger, command string, args []string, dir string)
RunCommandInDir runs a shell command with a given set of args in a specified folder. The stderr and stdout can be enabled or disabled.
Types ¶
This section is empty.