summaryrefslogtreecommitdiff
path: root/plugins/boltdb/boltjobs/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/boltdb/boltjobs/config.go')
-rw-r--r--plugins/boltdb/boltjobs/config.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/boltdb/boltjobs/config.go b/plugins/boltdb/boltjobs/config.go
new file mode 100644
index 00000000..8cc098c1
--- /dev/null
+++ b/plugins/boltdb/boltjobs/config.go
@@ -0,0 +1,39 @@
+package boltjobs
+
+const (
+ file string = "file"
+ priority string = "priority"
+ prefetch string = "prefetch"
+)
+
+type GlobalCfg struct {
+ // db file permissions
+ Permissions int `mapstructure:"permissions"`
+ // consume timeout
+}
+
+func (c *GlobalCfg) InitDefaults() {
+ if c.Permissions == 0 {
+ c.Permissions = 0777
+ }
+}
+
+type Config struct {
+ File string `mapstructure:"file"`
+ Priority int `mapstructure:"priority"`
+ Prefetch int `mapstructure:"prefetch"`
+}
+
+func (c *Config) InitDefaults() {
+ if c.File == "" {
+ c.File = "rr.db"
+ }
+
+ if c.Priority == 0 {
+ c.Priority = 10
+ }
+
+ if c.Prefetch == 0 {
+ c.Prefetch = 1000
+ }
+}