Documentation ¶
Overview ¶
Package env implements a koanf.Provider that reads environment variables as conf maps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env implements an environment variables provider.
func Provider ¶
Provider returns an environment variables provider that returns a nested map[string]interface{} of environment variable where the nesting hierarchy of keys are defined by delim. For instance, the delim "." will convert the key `parent.child.key: 1` to `{parent: {child: {key: 1}}}`.
If prefix is specified (case sensitive), only the env vars with the prefix are captured. cb is an optional callback that takes a string and returns a string (the env variable name) in case transformatios have to be applied, for instance, to lowercase everything, strip prefixes and replace _ with . etc.
func (*Env) Read ¶
Read reads all available environment variables into a key:value map and returns it.