Documentation
¶
Overview ¶
Package envutil provides shared helpers for environment variable parsing.
Index ¶
- func Get(key, fallback string) string
- func GetBoolLoose(key string, fallback bool) bool
- func GetBoolStrict(key string, fallback bool) bool
- func GetDuration(key string, fallback time.Duration) time.Duration
- func GetDurationOrSeconds(key string, fallback time.Duration) time.Duration
- func GetFloat(key string, fallback float64) float64
- func GetInt(key string, fallback int) int
- func LookupBoolLoose(key string) (bool, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBoolLoose ¶
GetBoolLoose parses common bool strings (true/1/yes/on) and uses fallback when unset.
func GetBoolStrict ¶
GetBoolStrict parses bool values using strconv.ParseBool semantics.
func GetDuration ¶
GetDuration parses a duration env var, returning fallback when unset/invalid.
func GetDurationOrSeconds ¶
GetDurationOrSeconds parses duration first; if that fails, parses integer seconds.
func LookupBoolLoose ¶
LookupBoolLoose looks up a bool env var and reports whether a non-empty value was present.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.