Documentation
¶
Overview ¶
Package env provides typed environment variable helpers.
Index ¶
- func Duration(key string, fallback time.Duration) time.Duration
- func Get[T convutil.Scalar](key string, fallback T) T
- func IsDev() bool
- func IsProd() bool
- func IsSet(key string) bool
- func Must(key string) string
- func Slice(key, separator string, fallback []string) []string
- func Value(key string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Duration ¶ added in v0.0.12
Duration reads key as a time.Duration. It expects Go duration syntax such as "500ms", "5s", or "2h".
func Get ¶
Get reads key and converts it into T. It returns fallback when key is unset or conversion fails.
func IsDev ¶
func IsDev() bool
IsDev returns true if GO_ENV, APP_ENV, or ENV is "development" or "dev".
func IsProd ¶
func IsProd() bool
IsProd returns true if GO_ENV, APP_ENV, or ENV is "production" or "prod".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.