Documentation ¶
Index ¶
Constants ¶
const DefaultEnvDelimiter = "_"
DefaultEnvDelimiter is the default environment delimiter.
const DefaultEnvPrefix = "AUTHELIA_"
DefaultEnvPrefix is the default environment prefix.
Variables ¶
This section is empty.
Functions ¶
func EnsureConfigurationExists ¶
EnsureConfigurationExists is an auxiliary function to the main Configuration tools that ensures the Configuration template is created if it doesn't already exist.
func Load ¶
func Load(val *schema.StructValidator, sources ...Source) (keys []string, configuration *schema.Configuration, err error)
Load the configuration given the provided options and sources.
Types ¶
type EnvironmentSource ¶
type EnvironmentSource struct {
// contains filtered or unexported fields
}
EnvironmentSource is a configuration Source which loads values from the environment.
func NewEnvironmentSource ¶
func NewEnvironmentSource(prefix, delimiter string) (source *EnvironmentSource)
NewEnvironmentSource returns a Source configured to load from environment variables.
func (*EnvironmentSource) Load ¶
func (s *EnvironmentSource) Load(_ *schema.StructValidator) (err error)
Load the Source into the EnvironmentSource koanf.Koanf.
func (*EnvironmentSource) Merge ¶
func (s *EnvironmentSource) Merge(ko *koanf.Koanf, _ *schema.StructValidator) (err error)
Merge the EnvironmentSource koanf.Koanf into the provided one.
type SecretsSource ¶
type SecretsSource struct {
// contains filtered or unexported fields
}
SecretsSource loads environment variables that have a value pointing to a file.
func NewSecretsSource ¶
func NewSecretsSource(prefix, delimiter string) (source *SecretsSource)
NewSecretsSource returns a Source configured to load from secrets.
func (*SecretsSource) Load ¶
func (s *SecretsSource) Load(val *schema.StructValidator) (err error)
Load the Source into the SecretsSource koanf.Koanf.
func (*SecretsSource) Merge ¶
func (s *SecretsSource) Merge(ko *koanf.Koanf, val *schema.StructValidator) (err error)
Merge the SecretsSource koanf.Koanf into the provided one.
type Source ¶
type Source interface { Name() (name string) Merge(ko *koanf.Koanf, val *schema.StructValidator) (err error) Load(val *schema.StructValidator) (err error) }
Source is an abstract representation of a configuration Source implementation.
func NewDefaultSources ¶
NewDefaultSources returns a slice of Source configured to load from specified YAML files.
type YAMLFileSource ¶
type YAMLFileSource struct {
// contains filtered or unexported fields
}
YAMLFileSource is a configuration Source with a YAML File.
func NewYAMLFileSource ¶
func NewYAMLFileSource(path string) (source *YAMLFileSource)
NewYAMLFileSource returns a Source configured to load from a specified YAML path. If there is an issue accessing this path it also returns an error.
func NewYAMLFileSources ¶
func NewYAMLFileSources(paths []string) (sources []*YAMLFileSource)
NewYAMLFileSources returns a slice of Source configured to load from specified YAML files.
func (*YAMLFileSource) Load ¶
func (s *YAMLFileSource) Load(_ *schema.StructValidator) (err error)
Load the Source into the YAMLFileSource koanf.Koanf.
func (*YAMLFileSource) Merge ¶
func (s *YAMLFileSource) Merge(ko *koanf.Koanf, _ *schema.StructValidator) (err error)
Merge the YAMLFileSource koanf.Koanf into the provided one.