Documentation
¶
Index ¶
- Variables
- func Getenv(key, fallback string) string
- func GetenvInt(key string, fallback int) int
- func GracefulShutdown(cleanupFun func()) chan bool
- func Hash32(s string) string
- func LoadJson(t testingT, filename string) string
- func PanicOnError(msg string, err error)
- func ReadFileEnvsubst(path string) string
- func TimeEndOf(t time.Time, granularity string) time.Time
- func TimeStartOf(t time.Time, granularity string) time.Time
- func ValidateWithTimeout(t testingT, validator func() bool, timeout time.Duration)
Constants ¶
This section is empty.
Variables ¶
Epoch is the unix epoch time: Jan 1, 1970
Functions ¶
func GracefulShutdown ¶
func GracefulShutdown(cleanupFun func()) chan bool
func PanicOnError ¶
func ReadFileEnvsubst ¶
Read a file (e.g. a configuration file) and replace any environment variable placeholders with their environment counterparts. This is similar to the bash command envsubst
For example, if the file contains: {"key":"$VAR"} then $VAR will be replaced with the environment variable VAR. Only supports environment variables with uppercaser characters and underscore.
func TimeStartOf ¶
TimeStartOf truncates the given timestamp to the given granularity. This is is similar to Time.Truncate, but is also works for year, month and day.
func ValidateWithTimeout ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.