diff options
author | Valery Piashchynski <[email protected]> | 2021-01-07 15:53:11 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-07 15:53:11 +0300 |
commit | ac71c41bec81fcb457e2ad18f4cbaa3f4b99d6c4 (patch) | |
tree | 5d42ca5aecf65609ebaabc517c1368d43dbce179 /plugins/kv/boltdb/config.go | |
parent | 984953a9db1d94817bda2e3d9266583151b1b437 (diff) | |
parent | 74405558a4a5bafefd081553f70d85943e9a3a37 (diff) |
Merge pull request #468 from spiral/plugin/kv
Plugin/kv
Diffstat (limited to 'plugins/kv/boltdb/config.go')
-rw-r--r-- | plugins/kv/boltdb/config.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/kv/boltdb/config.go b/plugins/kv/boltdb/config.go new file mode 100644 index 00000000..b2e1e636 --- /dev/null +++ b/plugins/kv/boltdb/config.go @@ -0,0 +1,24 @@ +package boltdb + +type Config struct { + // Dir is a directory to store the DB files + Dir string + // File is boltDB file. No need to create it by your own, + // boltdb driver is able to create the file, or read existing + File string + // Bucket to store data in boltDB + Bucket string + // db file permissions + Permissions int + // timeout + Interval uint `yaml:"interval"` +} + +// 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 +} |