feat: Use databaseBackend config repace databaseEtcd

databaseBackend config contains type and url sub config, It can facilitate the expansion of other types of databases in the future.
This commit is contained in:
hudeng
2022-02-11 18:14:26 +08:00
committed by André Roth
parent f29449db14
commit 59bf4501e8
8 changed files with 47 additions and 13 deletions

View File

@@ -41,6 +41,14 @@ type ConfigStructure struct { // nolint: maligned
LogFormat string `json:"logFormat"`
ServeInAPIMode bool `json:"serveInAPIMode"`
DatabaseEtcd string `json:"databaseEtcd"`
DatabaseBackend DBConfig `json:"databaseBackend"`
}
// DBConfig
type DBConfig struct {
Type string `json:"type"`
URL string `json:"url"`
DbPath string `json:"dbPath"`
}
type LocalPoolStorage struct {

View File

@@ -144,7 +144,11 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
" \"logLevel\": \"info\",\n"+
" \"logFormat\": \"json\",\n"+
" \"serveInAPIMode\": false,\n"+
" \"databaseEtcd\": \"\"\n"+
" \"databaseEtcd\": \"\",\n"+
" \"databaseBackend\": {\n"+
" \"type\": \"\",\n"+
" \"url\": \"\"\n"+
" }\n"+
"}")
}