storage

package
v0.8.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATATYPE_EXTEND = 128
)

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)
func (ms *MenuStorageService) WithGettext(path string, lns []lang.Language) *MenuStorageService

WithGettext triggers use of gettext for translation of templates and menus.

The first language in `lns` will be used as default language, to resolve node keys to language strings.

If `lns` is an empty array, gettext will not be used.

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
}

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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