Documentation
¶
Overview ¶
Package sourceenv loads configuration from environment variables.
Key normalization:
- FOO__BAR -> foo.bar
- FOO_BAR -> foo_bar
- MY__SERVICE__API_KEY -> my.service.api_key
Example:
source := sourceenv.New(sourceenv.Options{Prefix: "APP_"})
loader := rigging.NewLoader[Config]().WithSource(source)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Prefix filters vars starting with prefix (stripped before normalization).
// Empty = load all vars.
// Prefix matching behavior is controlled by CaseSensitive.
Prefix string
// CaseSensitive controls prefix matching (default: false).
// When false, prefix matching is case-insensitive (APP_ matches app_, App_, etc.).
// When true, prefix must match exactly.
// Keys are always normalized to lowercase after prefix stripping.
CaseSensitive bool
}
Options configures environment variable source behavior.
Click to show internal directories.
Click to hide internal directories.