storage

package
v0.6.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MenuStorageService struct {
	// contains filtered or unexported fields
}

func NewMenuStorageService

func NewMenuStorageService(dbDir string, resourceDir string) *MenuStorageService
func (ms *MenuStorageService) Close() error
func (ms *MenuStorageService) EnsureDbDir() error
func (ms *MenuStorageService) GetPersister(ctx context.Context) (*persist.Persister, error)
func (ms *MenuStorageService) GetResource(ctx context.Context) (resource.Resource, error)
func (ms *MenuStorageService) GetStateStore(ctx context.Context) (db.Db, error)
func (ms *MenuStorageService) GetUserdataDb(ctx context.Context) (db.Db, error)

type PrefixDb

type PrefixDb interface {
	Get(ctx context.Context, key []byte) ([]byte, error)
	Put(ctx context.Context, key []byte, val []byte) error
}

PrefixDb interface abstracts the database operations.

type SimpleStorageProvider

type SimpleStorageProvider struct {
	*Storage
}

func (*SimpleStorageProvider) Close

func (p *SimpleStorageProvider) Close() error

func (*SimpleStorageProvider) Get

func (p *SimpleStorageProvider) Get(sessionId string) (*Storage, error)

func (*SimpleStorageProvider) Put

func (p *SimpleStorageProvider) Put(sessionId string, storage *Storage) error

type Storage

type Storage struct {
	Persister  *persist.Persister
	UserdataDb db.Db
}

type StorageProvider

type StorageProvider interface {
	Get(sessionId string) (*Storage, error)
	Put(sessionId string, storage *Storage) error
	Close() error
}

func NewSimpleStorageProvider

func NewSimpleStorageProvider(stateStore db.Db, userdataStore db.Db) StorageProvider

type StorageService

type StorageService interface {
	GetPersister(ctx context.Context) (*persist.Persister, error)
	GetUserdataDb(ctx context.Context) db.Db
	GetResource(ctx context.Context) (resource.Resource, error)
	EnsureDbDir() error
}

type SubPrefixDb

type SubPrefixDb struct {
	// contains filtered or unexported fields
}

func NewSubPrefixDb

func NewSubPrefixDb(store db.Db, pfx []byte) *SubPrefixDb

func (*SubPrefixDb) Get

func (s *SubPrefixDb) Get(ctx context.Context, key []byte) ([]byte, error)

func (*SubPrefixDb) Put

func (s *SubPrefixDb) Put(ctx context.Context, key []byte, val []byte) error

type ThreadGdbmDb

type ThreadGdbmDb struct {
	// contains filtered or unexported fields
}

func NewThreadGdbmDb

func NewThreadGdbmDb() *ThreadGdbmDb

func (*ThreadGdbmDb) Close

func (tdb *ThreadGdbmDb) Close() error

func (*ThreadGdbmDb) Connect

func (tdb *ThreadGdbmDb) Connect(ctx context.Context, connStr string) error

func (*ThreadGdbmDb) Dump

func (tdb *ThreadGdbmDb) Dump(ctx context.Context, key []byte) (*db.Dumper, error)

func (*ThreadGdbmDb) Get

func (tdb *ThreadGdbmDb) Get(ctx context.Context, key []byte) ([]byte, error)

func (*ThreadGdbmDb) Prefix

func (tdb *ThreadGdbmDb) Prefix() uint8

func (*ThreadGdbmDb) Put

func (tdb *ThreadGdbmDb) Put(ctx context.Context, key []byte, val []byte) error

func (*ThreadGdbmDb) Safe

func (tdb *ThreadGdbmDb) Safe() bool

func (*ThreadGdbmDb) SetLanguage

func (tdb *ThreadGdbmDb) SetLanguage(lng *lang.Language)

func (*ThreadGdbmDb) SetLock

func (tdb *ThreadGdbmDb) SetLock(typ uint8, locked bool) error

func (*ThreadGdbmDb) SetPrefix

func (tdb *ThreadGdbmDb) SetPrefix(pfx uint8)

func (*ThreadGdbmDb) SetSession

func (tdb *ThreadGdbmDb) SetSession(sessionId string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL