using own Db wrapper class around bolt db

This commit is contained in:
2023-03-01 13:31:44 +01:00
parent 8e5f33c99b
commit 84bef91657
5 changed files with 106 additions and 28 deletions

View File

@@ -22,7 +22,6 @@ import (
"github.com/gofiber/fiber/v2/middleware/logger"
"github.com/gofiber/fiber/v2/middleware/requestid"
"github.com/tlinden/up/upd/cfg"
bolt "go.etcd.io/bbolt"
)
func Runserver(cfg *cfg.Config, args []string) error {
@@ -42,7 +41,7 @@ func Runserver(cfg *cfg.Config, args []string) error {
Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}\n",
}))
db, err := bolt.Open(cfg.DbFile, 0600, nil)
db, err := NewDb(cfg.DbFile)
if err != nil {
return err
}