Implement storageservice in nats subscription object

This commit is contained in:
lash 2024-11-03 23:10:44 +00:00
parent f441047fa1
commit 6c4f91b0b8
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -9,22 +9,27 @@ import (
"git.defalsify.org/vise.git/db" "git.defalsify.org/vise.git/db"
) )
// TestStorageService wraps db for nats subscription.
type TestStorageService struct { type TestStorageService struct {
Store db.Db Store db.Db
} }
// GetUserdataDb implements urdt/ussd/common.StorageServices.
func(ss *TestStorageService) GetUserdataDb(ctx context.Context) (db.Db, error) { func(ss *TestStorageService) GetUserdataDb(ctx context.Context) (db.Db, error) {
return ss.Store, nil return ss.Store, nil
} }
// GetPersister implements urdt/ussd/common.StorageServices.
func(ts *TestStorageService) GetPersister(ctx context.Context) (*persist.Persister, error) { func(ts *TestStorageService) GetPersister(ctx context.Context) (*persist.Persister, error) {
return nil, errors.New("not implemented") return nil, errors.New("not implemented")
} }
// GetResource implements urdt/ussd/common.StorageServices.
func(ts *TestStorageService) GetResource(ctx context.Context) (resource.Resource, error) { func(ts *TestStorageService) GetResource(ctx context.Context) (resource.Resource, error) {
return nil, errors.New("not implemented") return nil, errors.New("not implemented")
} }
// EnsureDbDir implements urdt/ussd/common.StorageServices.
func(ss *TestStorageService) EnsureDbDir() error { func(ss *TestStorageService) EnsureDbDir() error {
return nil return nil
} }