Documentation
¶
Overview ¶
Package config loads explicit, typed application configuration.
Index ¶
- func Dump(v any) ([]byte, error)
- func GetBool(k string, f bool) bool
- func GetDuration(k string, f time.Duration) time.Duration
- func GetInt(k string, f int) int
- func GetString(k, f string) string
- func GetStringSlice(k string, f []string) []string
- func Load(dst any, options ...Options) error
- func Validate(value any) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBool ¶
GetBool reads a boolean environment variable, returning the fallback on invalid input.
func GetInt ¶
GetInt reads an integer environment variable, returning the fallback on invalid input.
func GetStringSlice ¶
GetStringSlice reads comma-separated environment values or copies the fallback.
Types ¶
type Options ¶
type Options struct {
Environment string
Overrides map[string]io.Reader
Values map[string]string
MaxFileBytes int64
Prefix string
Lookup func(string) (string, bool)
File io.Reader
Validate func(any) error
}
Options controls loading. Precedence is defaults, existing values/file, environment.
Click to show internal directories.
Click to hide internal directories.