2019-04-24 21:52:08 +00:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// LocalStorageConfiguration represents the configuration when using local storage.
|
|
|
|
type LocalStorageConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
Path string `koanf:"path"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|
|
|
|
|
2020-05-02 05:06:39 +00:00
|
|
|
// SQLStorageConfiguration represents the configuration of the SQL database.
|
2019-11-16 10:38:21 +00:00
|
|
|
type SQLStorageConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
Host string `koanf:"host"`
|
|
|
|
Port int `koanf:"port"`
|
|
|
|
Database string `koanf:"database"`
|
|
|
|
Username string `koanf:"username"`
|
|
|
|
Password string `koanf:"password"`
|
2019-11-16 10:38:21 +00:00
|
|
|
}
|
|
|
|
|
2020-05-02 05:06:39 +00:00
|
|
|
// MySQLStorageConfiguration represents the configuration of a MySQL database.
|
2019-11-16 19:50:58 +00:00
|
|
|
type MySQLStorageConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
SQLStorageConfiguration `koanf:",squash"`
|
2019-11-16 19:50:58 +00:00
|
|
|
}
|
|
|
|
|
2020-05-02 05:06:39 +00:00
|
|
|
// PostgreSQLStorageConfiguration represents the configuration of a Postgres database.
|
2019-11-16 19:50:58 +00:00
|
|
|
type PostgreSQLStorageConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
SQLStorageConfiguration `koanf:",squash"`
|
|
|
|
SSLMode string `koanf:"sslmode"`
|
2019-11-16 19:50:58 +00:00
|
|
|
}
|
|
|
|
|
2019-04-24 21:52:08 +00:00
|
|
|
// StorageConfiguration represents the configuration of the storage backend.
|
|
|
|
type StorageConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
Local *LocalStorageConfiguration `koanf:"local"`
|
|
|
|
MySQL *MySQLStorageConfiguration `koanf:"mysql"`
|
|
|
|
PostgreSQL *PostgreSQLStorageConfiguration `koanf:"postgres"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|