Rename current db to boltdb

This commit is contained in:
Daan Sprenkels
2020-10-23 16:14:57 +02:00
parent 104dbab335
commit f36fa30eff
9 changed files with 49 additions and 50 deletions

View File

@@ -13,7 +13,7 @@ import (
"strings"
"testing"
"gitea.hashru.nl/dsprenkels/rushlink/internal/db"
"gitea.hashru.nl/dsprenkels/rushlink/internal/boltdb"
"github.com/gorilla/mux"
"go.etcd.io/bbolt"
)
@@ -31,12 +31,12 @@ func createTemporaryRouter(t *testing.T) (*mux.Router, *rushlink) {
os.RemoveAll(tempDir)
})
fileStore, err := db.OpenFileStore(filepath.Join(tempDir, "filestore"))
fileStore, err := boltdb.OpenFileStore(filepath.Join(tempDir, "filestore"))
if err != nil {
t.Fatalf("opening temporary filestore: %s\n", err)
}
databasePath := filepath.Join(tempDir, "rushlink.db")
database, err := db.OpenDB(databasePath, fileStore)
database, err := boltdb.OpenDB(databasePath, fileStore)
if err != nil {
t.Fatalf("opening temporary database: %s\n", err)
}
@@ -136,7 +136,7 @@ func TestIssue53(t *testing.T) {
// Check that any attempt to do directory traversal has failed.
rl.db.Bolt.View(func(tx *bbolt.Tx) error {
fus, err := db.AllFileUploads(tx)
fus, err := boltdb.AllFileUploads(tx)
if err != nil {
t.Fatal(err)
}