summaryrefslogtreecommitdiff
path: root/plugins/kv/boltdb/config.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-05 17:37:17 +0300
committerValery Piashchynski <[email protected]>2021-01-05 17:37:17 +0300
commit13b01ccaba1eedeb99d37842ec8f2019d2625187 (patch)
treec645c240336666fa63d70ed2703a78df828c597f /plugins/kv/boltdb/config.go
parent877b0ed461c7d5e1de87b7561f414aeb236cf3ec (diff)
Finish implementation of the KV
Diffstat (limited to 'plugins/kv/boltdb/config.go')
-rw-r--r--plugins/kv/boltdb/config.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/kv/boltdb/config.go b/plugins/kv/boltdb/config.go
new file mode 100644
index 00000000..6b116611
--- /dev/null
+++ b/plugins/kv/boltdb/config.go
@@ -0,0 +1,23 @@
+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
+
+ Permissions int
+ TTL int
+}
+
+func (s *Config) InitDefaults() error {
+ s.Dir = "." // current dir
+ s.Bucket = "rr" // default bucket name
+ s.File = "rr.db" // default file name
+ s.Permissions = 0777 // free for all
+ s.TTL = 60 // 60 seconds is default TTL
+ return nil
+}