summaryrefslogtreecommitdiff
path: root/internal/configuration/types.go
blob: 68a49a7216b9b3983d1e314b7e830b75c60e29d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package configuration

import (
	"github.com/knadh/koanf"

	"github.com/authelia/authelia/internal/configuration/schema"
)

// Source is an abstract representation of a configuration Source implementation.
type Source interface {
	Name() (name string)
	Merge(ko *koanf.Koanf, val *schema.StructValidator) (err error)
	Load(val *schema.StructValidator) (err error)
}

// YAMLFileSource is a configuration Source with a YAML File.
type YAMLFileSource struct {
	koanf *koanf.Koanf
	path  string
}

// EnvironmentSource is a configuration Source which loads values from the environment.
type EnvironmentSource struct {
	koanf     *koanf.Koanf
	prefix    string
	delimiter string
}

// SecretsSource loads environment variables that have a value pointing to a file.
type SecretsSource struct {
	koanf     *koanf.Koanf
	prefix    string
	delimiter string
}