Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBothSecretsSet = errors.New("both secrets are set, please use one or the other") ErrBothSecretsNotSet = errors.New("neither secrets are set, please use one or the other") ErrInvalidHttpUrl = errors.New("invalid HTTP URL") ErrParseConfigFailed = errors.New("failed to parse config from environment") )
Functions ¶
func LoadFileBasedEnvVars ¶ added in v0.36.0
func LoadFileBasedEnvVars(mappings *[]EnvVarFileMapping) error
LoadFileBasedEnvVars loads env-based config values from file-based env vars if set.
func ParseConfigFromEnv ¶ added in v0.36.0
func ParseConfigFromEnv(config any, mappings *[]EnvVarFileMapping) error
ParseConfigFromEnv parses the configuration from environment variables and file-based environment variables.
Types ¶
type EnvVarFileMapping ¶ added in v0.36.0
type EnvVarFileMapping struct {
EnvName string // EnvName is the name/key of the environment variable (e.g. API_SECRET)
EnvValue *string // EnvValue is the value of the environment variable
FileValue *string // FileValue is the content of the file that is specified in the environment variable (e.g. API_SECRET_FILE)
AllowUnset bool // AllowUnset indicates if both the fileField and value can be unset
}
EnvVarFileMapping holds the mappings for file-based environment variables.
Click to show internal directories.
Click to hide internal directories.