config

package
v0.87.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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.

type HttpUrl added in v0.17.0

type HttpUrl string // HttpUrl is a type for strings that represent HTTP URLs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL