Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func (Loader) Load ¶ added in v0.4.0
Load loads the configuration from the environment.
- to must be a pointer to a struct
- only struct fields load values
func (*Loader) LoadName ¶ added in v0.4.0
func (l *Loader) LoadName() loader.LoaderName
type Option ¶
type Option func(*option)
func WithCheckConfigEnvFile ¶ added in v0.4.0
WithCheckConfigEnvFile enables checking CONFIG_ENV_FILE variable to load specific environment file.
- if true and CONFIG_ENV_FILE is set, the file is appended to the list of env files to load.
- default is true.
func WithEnv ¶
WithEnv sets the environment variables to load and disable from the system environment.
func WithEnvFile ¶
func WithHooks ¶
WithHooks sets the hooks for the environment loader.
- if return type matches the field type, return value is assigned to the field
func WithPrefix ¶
WithPrefix to just load the environment variables with the given prefix.
- if prefix is "APP_", then only the environment variables with the prefix "APP_" are loaded.
- prefix will strip from the field name.
Click to show internal directories.
Click to hide internal directories.