diff options
author | Valery Piashchynski <[email protected]> | 2021-01-21 13:25:36 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-01-21 13:25:36 +0300 |
commit | 7da6c78449776e1f3c6716250bca0b712a0423a4 (patch) | |
tree | f3512de66aca2bba408485a0ea2fc936c0e4fb9b /plugins/kv/boltdb/config.go | |
parent | 0ff05b2732b4fd0783f959c94c54d7e39169f979 (diff) |
Uniform all configs
Add debug server
Check nil's for all plugin intialization
Diffstat (limited to 'plugins/kv/boltdb/config.go')
-rw-r--r-- | plugins/kv/boltdb/config.go | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/plugins/kv/boltdb/config.go b/plugins/kv/boltdb/config.go index ea0e3375..ebe73c25 100644 --- a/plugins/kv/boltdb/config.go +++ b/plugins/kv/boltdb/config.go @@ -16,9 +16,22 @@ type Config struct { // InitDefaults initializes default values for the boltdb func (s *Config) InitDefaults() { - s.Dir = "." // current dir - s.Bucket = "rr" // default bucket name - s.File = "rr.db" // default file name - s.Permissions = 0777 // free for all - s.Interval = 60 // default is 60 seconds timeout + if s.Dir == "" { + s.Dir = "." // current dir + } + if s.Bucket == "" { + s.Bucket = "rr" // default bucket name + } + + if s.File == "" { + s.File = "rr.db" // default file name + } + + if s.Permissions == 0 { + s.Permissions = 777 // free for all + } + + if s.Interval == 0 { + s.Interval = 60 // default is 60 seconds timeout + } } |