summaryrefslogtreecommitdiff
path: root/plugins/boltdb/boltkv/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/boltdb/boltkv/config.go')
-rw-r--r--plugins/boltdb/boltkv/config.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/boltdb/boltkv/config.go b/plugins/boltdb/boltkv/config.go
new file mode 100644
index 00000000..56d00674
--- /dev/null
+++ b/plugins/boltdb/boltkv/config.go
@@ -0,0 +1,30 @@
+package boltkv
+
+type Config struct {
+ // 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 int `mapstructure:"interval"`
+}
+
+// InitDefaults initializes default values for the boltdb
+func (s *Config) InitDefaults() {
+ s.bucket = "default"
+
+ if s.File == "" {
+ s.File = "rr.db" // default file name
+ }
+
+ if s.Permissions == 0 {
+ s.Permissions = 0777 // free for all
+ }
+
+ if s.Interval == 0 {
+ s.Interval = 60 // default is 60 seconds timeout
+ }
+}