summaryrefslogtreecommitdiff
path: root/plugins/kv/boltdb/config.go
blob: 6b116611b86f5f0464bb8e84735b22ff9e052c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}