Documentation ¶
Index ¶
- func CloseAndLog(level logrus.Level, close func() error)
- func CloseFileAndLogError(f *os.File)
- func ContainsString(sa []string, os string) bool
- func CountUniq[S []E, E any, F comparable](arr S, f func(E) F) int
- func Dedup(slice []string) []string
- func FromEnv(key, otherwise string) string
- func GetDirPath(dir string) (string, error)
- func GetEnvBool(varName string, defaultVal bool) bool
- func GetEnvInt(varName string, defaultVal int) int
- func IsUUID(s string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseAndLog ¶
func CloseFileAndLogError ¶
CloseFileAndLogError closes a file and logs any errors
func ContainsString ¶
ContainsString returns true if `os` is in the array `sa` and false if it is not.
func CountUniq ¶
func CountUniq[S []E, E any, F comparable](arr S, f func(E) F) int
Count the number of unique values in the slice based on given function
func FromEnv ¶
FromEnv always returns a string that is either a non-empty value from the environment variable named by key or the string otherwise
func GetDirPath ¶
Look for a directory by increasingly looking up the directory tree by appending '.../' It will look a max of 5 levels up before accepting failure and returning an empty string and an error
func GetEnvBool ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.