configuration

package
v4.30.5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEnvDelimiter = "_"

DefaultEnvDelimiter is the default environment delimiter.

View Source
const DefaultEnvPrefix = "AUTHELIA_"

DefaultEnvPrefix is the default environment prefix.

Variables

This section is empty.

Functions

func EnsureConfigurationExists

func EnsureConfigurationExists(path string) (created bool, err error)

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.

func (EnvironmentSource) Name

func (s EnvironmentSource) Name() (name string)

Name of the Source.

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.

func (SecretsSource) Name

func (s SecretsSource) Name() (name string)

Name of the Source.

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

func NewDefaultSources(filePaths []string, prefix, delimiter string) (sources []Source)

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.

func (YAMLFileSource) Name

func (s YAMLFileSource) Name() (name string)

Name of the Source.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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