From 67007fcd488994819339422cbc701b7b578b0ac9 Mon Sep 17 00:00:00 2001 From: lash Date: Sat, 4 Jan 2025 07:35:28 +0000 Subject: [PATCH] Factor out gdbm package --- internal/storage/{ => gdbm}/gdbm.go | 5 +++++ internal/storage/storageservice.go | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) rename internal/storage/{ => gdbm}/gdbm.go (95%) diff --git a/internal/storage/gdbm.go b/internal/storage/gdbm/gdbm.go similarity index 95% rename from internal/storage/gdbm.go rename to internal/storage/gdbm/gdbm.go index 31ebf47..dab767a 100644 --- a/internal/storage/gdbm.go +++ b/internal/storage/gdbm/gdbm.go @@ -6,6 +6,11 @@ import ( "git.defalsify.org/vise.git/db" gdbmdb "git.defalsify.org/vise.git/db/gdbm" "git.defalsify.org/vise.git/lang" + "git.defalsify.org/vise.git/logging" +) + +var ( + logg = logging.NewVanilla().WithDomain("gdbmstorage") ) var ( diff --git a/internal/storage/storageservice.go b/internal/storage/storageservice.go index ca28bbb..7856095 100644 --- a/internal/storage/storageservice.go +++ b/internal/storage/storageservice.go @@ -13,6 +13,7 @@ import ( "git.defalsify.org/vise.git/persist" "git.defalsify.org/vise.git/resource" "git.grassecon.net/urdt/ussd/initializers" + gdbmstorage "git.grassecon.net/urdt/ussd/internal/storage/gdbm" ) var ( @@ -75,7 +76,7 @@ func (ms *MenuStorageService) getOrCreateDb(ctx context.Context, existingDb db.D connStr := buildConnStr() err = newDb.Connect(ctx, connStr) } else { - newDb = NewThreadGdbmDb() + newDb = gdbmstorage.NewThreadGdbmDb() storeFile := path.Join(ms.dbDir, fileName) err = newDb.Connect(ctx, storeFile) }