mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
3695aa8140
This is a massive overhaul to the SQL Storage for Authelia. It facilitates a whole heap of utility commands to help manage the database, primary keys, ensures all database requests use a context for cancellations, and paves the way for a few other PR's which improve the database. Fixes #1337
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package configuration
|
|
|
|
import (
|
|
"github.com/knadh/koanf"
|
|
"github.com/spf13/pflag"
|
|
|
|
"github.com/authelia/authelia/v4/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
|
|
}
|
|
|
|
// CommandLineSource loads configuration from the command line flags.
|
|
type CommandLineSource struct {
|
|
koanf *koanf.Koanf
|
|
flags *pflag.FlagSet
|
|
callback func(flag *pflag.Flag) (string, interface{})
|
|
}
|