@@ -67,6 +67,7 @@ type SectionStat struct {
|
||||
Engine string `yaml:"engine"`
|
||||
Redis SectionRedis `yaml:"redis"`
|
||||
BoltDB SectionBoltDB `yaml:"boltdb"`
|
||||
BuntDB SectionBuntDB `yaml:"buntdb"`
|
||||
}
|
||||
|
||||
// SectionRedis is sub seciont of config.
|
||||
@@ -82,6 +83,11 @@ type SectionBoltDB struct {
|
||||
Bucket string `yaml:"bucket"`
|
||||
}
|
||||
|
||||
// SectionBuntDB is sub seciont of config.
|
||||
type SectionBuntDB struct {
|
||||
Path string `yaml:"path"`
|
||||
}
|
||||
|
||||
// BuildDefaultPushConf is default config setting.
|
||||
func BuildDefaultPushConf() ConfYaml {
|
||||
var conf ConfYaml
|
||||
@@ -130,6 +136,8 @@ func BuildDefaultPushConf() ConfYaml {
|
||||
conf.Stat.BoltDB.Path = "gorush.db"
|
||||
conf.Stat.BoltDB.Bucket = "gorush"
|
||||
|
||||
conf.Stat.BuntDB.Path = "gorush.db"
|
||||
|
||||
return conf
|
||||
}
|
||||
|
||||
|
||||
@@ -43,3 +43,5 @@ stat:
|
||||
boltdb:
|
||||
path: "gorush.db"
|
||||
bucket: "gorush"
|
||||
buntdb:
|
||||
path: "gorush.db"
|
||||
|
||||
@@ -96,6 +96,8 @@ func (suite *ConfigTestSuite) TestValidateConfDefault() {
|
||||
|
||||
assert.Equal(suite.T(), "gorush.db", suite.ConfGorushDefault.Stat.BoltDB.Path)
|
||||
assert.Equal(suite.T(), "gorush", suite.ConfGorushDefault.Stat.BoltDB.Bucket)
|
||||
|
||||
assert.Equal(suite.T(), "gorush.db", suite.ConfGorushDefault.Stat.BuntDB.Path)
|
||||
}
|
||||
|
||||
func (suite *ConfigTestSuite) TestValidateConf() {
|
||||
@@ -142,6 +144,8 @@ func (suite *ConfigTestSuite) TestValidateConf() {
|
||||
|
||||
assert.Equal(suite.T(), "gorush.db", suite.ConfGorush.Stat.BoltDB.Path)
|
||||
assert.Equal(suite.T(), "gorush", suite.ConfGorush.Stat.BoltDB.Bucket)
|
||||
|
||||
assert.Equal(suite.T(), "gorush.db", suite.ConfGorush.Stat.BuntDB.Path)
|
||||
}
|
||||
|
||||
func TestConfigTestSuite(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user