2019-04-24 21:52:08 +00:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// LocalStorageConfiguration represents the configuration when using local storage.
|
|
|
|
type LocalStorageConfiguration struct {
|
2020-01-21 20:56:44 +00:00
|
|
|
Path string `mapstructure:"path"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|
|
|
|
|
2019-11-16 10:38:21 +00:00
|
|
|
// SQLStorageConfiguration represents the configuration of the SQL database
|
|
|
|
type SQLStorageConfiguration struct {
|
2020-01-21 20:56:44 +00:00
|
|
|
Host string `mapstructure:"host"`
|
|
|
|
Port int `mapstructure:"port"`
|
|
|
|
Database string `mapstructure:"database"`
|
|
|
|
Username string `mapstructure:"username"`
|
|
|
|
Password string `mapstructure:"password"`
|
2019-11-16 10:38:21 +00:00
|
|
|
}
|
|
|
|
|
2019-11-16 19:50:58 +00:00
|
|
|
// MySQLStorageConfiguration represents the configuration of a MySQL database
|
|
|
|
type MySQLStorageConfiguration struct {
|
2020-01-21 20:56:44 +00:00
|
|
|
SQLStorageConfiguration `mapstructure:",squash"`
|
2019-11-16 19:50:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// PostgreSQLStorageConfiguration represents the configuration of a Postgres database
|
|
|
|
type PostgreSQLStorageConfiguration struct {
|
2020-01-21 20:56:44 +00:00
|
|
|
SQLStorageConfiguration `mapstructure:",squash"`
|
|
|
|
SSLMode string `mapstructure:"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 {
|
2020-01-21 20:56:44 +00:00
|
|
|
Local *LocalStorageConfiguration `mapstructure:"local"`
|
|
|
|
MySQL *MySQLStorageConfiguration `mapstructure:"mysql"`
|
|
|
|
PostgreSQL *PostgreSQLStorageConfiguration `mapstructure:"postgres"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|