mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
a7e867a699
This commit replaces github.com/spf13/viper with github.com/knadh/koanf. Koanf is very similar library to viper, with less dependencies and several quality of life differences. This also allows most config options to be defined by ENV. Lastly it also enables the use of split configuration files which can be configured by setting the --config flag multiple times. Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package schema
|
|
|
|
// LocalStorageConfiguration represents the configuration when using local storage.
|
|
type LocalStorageConfiguration struct {
|
|
Path string `koanf:"path"`
|
|
}
|
|
|
|
// SQLStorageConfiguration represents the configuration of the SQL database.
|
|
type SQLStorageConfiguration struct {
|
|
Host string `koanf:"host"`
|
|
Port int `koanf:"port"`
|
|
Database string `koanf:"database"`
|
|
Username string `koanf:"username"`
|
|
Password string `koanf:"password"`
|
|
}
|
|
|
|
// MySQLStorageConfiguration represents the configuration of a MySQL database.
|
|
type MySQLStorageConfiguration struct {
|
|
SQLStorageConfiguration `koanf:",squash"`
|
|
}
|
|
|
|
// PostgreSQLStorageConfiguration represents the configuration of a Postgres database.
|
|
type PostgreSQLStorageConfiguration struct {
|
|
SQLStorageConfiguration `koanf:",squash"`
|
|
SSLMode string `koanf:"sslmode"`
|
|
}
|
|
|
|
// StorageConfiguration represents the configuration of the storage backend.
|
|
type StorageConfiguration struct {
|
|
Local *LocalStorageConfiguration `koanf:"local"`
|
|
MySQL *MySQLStorageConfiguration `koanf:"mysql"`
|
|
PostgreSQL *PostgreSQLStorageConfiguration `koanf:"postgres"`
|
|
}
|