fix(config): add config loading functions and tests, also fix config issues
This commit is contained in:
parent
67da1ea0eb
commit
32a003d789
11 changed files with 42 additions and 69 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
|
||||
var (
|
||||
ErrBucketNotFound = errors.New("bucket not found")
|
||||
DBName = "quickshare.db"
|
||||
)
|
||||
|
||||
type BoltPvd struct {
|
||||
|
@ -25,7 +26,7 @@ type BoltPvd struct {
|
|||
}
|
||||
|
||||
func New(dbPath string, maxStrLen int) *BoltPvd {
|
||||
boltPath := path.Join(path.Clean(dbPath), "quickshare.db")
|
||||
boltPath := path.Join(path.Clean(dbPath), DBName)
|
||||
db, err := bolt.Open(boltPath, 0600, &bolt.Options{Timeout: 1 * time.Second})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue