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