From 78c033e61c6e7ffd97e37537bb8e2f93f2956f13 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Sat, 14 Sep 2024 20:59:08 +0300 Subject: [PATCH] remove deprecated code --- internal/utils/db.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/internal/utils/db.go b/internal/utils/db.go index 94ce250..5479f27 100644 --- a/internal/utils/db.go +++ b/internal/utils/db.go @@ -1,10 +1,7 @@ package utils import ( - "context" "encoding/binary" - - "git.defalsify.org/vise.git/db" ) type DataTyp uint16 @@ -37,21 +34,3 @@ func PackKey(typ DataTyp, data []byte) []byte { v := typToBytes(typ) return append(v, data...) } - -func ReadEntry(ctx context.Context, store db.Db, sessionId string, typ DataTyp) ([]byte, error) { - store.SetPrefix(db.DATATYPE_USERDATA) - store.SetSession(sessionId) - k := PackKey(typ, []byte(sessionId)) - b, err := store.Get(ctx, k) - if err != nil { - return nil, err - } - return b, nil -} - -func WriteEntry(ctx context.Context, store db.Db, sessionId string, typ DataTyp, value []byte) error { - store.SetPrefix(db.DATATYPE_USERDATA) - store.SetSession(sessionId) - k := PackKey(typ, []byte(sessionId)) - return store.Put(ctx, k, value) -}