Versions in this module Expand all Collapse all v0 v0.60.0 Nov 12, 2026 Changes in this version + const AppScope + const DefaultMaxBytes + const MaxKeyBytes + const MaxList + const MaxValueBytes + var ErrApp = errors.New("appdata: not an app name") + var ErrConflict = errors.New("appdata: the condition does not hold") + var ErrCounter = errors.New("appdata: a counter key is written by incr only") + var ErrKey = errors.New("appdata: a key is 1 to 512 printable ASCII characters") + var ErrQuota = errors.New("appdata: the app's data is at its size limit") + var ErrSameDatabase = errors.New(...) + var ErrScope = errors.New("appdata: no such scope") + var ErrValue = errors.New("appdata: a value is valid UTF-8, at most 64 KiB") + func CheckKey(key string) error + func TenantScope(tenant int64) string + type Cond struct + IfAbsent bool + IfRev int64 + type Entry struct + Counter bool + Key string + Rev int64 + Value string + type Postgres struct + func OpenPostgres(ctx context.Context, dsn, filexDSN string, maxBytes int64) (*Postgres, error) + func (p *Postgres) Close() error + func (p *Postgres) Delete(ctx context.Context, app, scope, key string, ifRev int64) (bool, error) + func (p *Postgres) Driver() string + func (p *Postgres) Drop(ctx context.Context, app string) error + func (p *Postgres) Get(ctx context.Context, app, scope, key string) (Entry, bool, error) + func (p *Postgres) Incr(ctx context.Context, app, scope, key string, by int64) (int64, error) + func (p *Postgres) List(ctx context.Context, app, scope, prefix, after string, limit int) ([]Entry, string, error) + func (p *Postgres) NodeLocal() bool + func (p *Postgres) Put(ctx context.Context, app, scope, key, value string, c Cond) (int64, error) + func (p *Postgres) Usage(ctx context.Context, app string) (int64, int64, error) + type SQLite struct + func OpenSQLite(dir string, maxBytes int64) (*SQLite, error) + func (s *SQLite) Close() error + func (s *SQLite) Delete(ctx context.Context, app, scope, key string, ifRev int64) (bool, error) + func (s *SQLite) Driver() string + func (s *SQLite) Drop(_ context.Context, app string) error + func (s *SQLite) Get(ctx context.Context, app, scope, key string) (Entry, bool, error) + func (s *SQLite) Incr(ctx context.Context, app, scope, key string, by int64) (int64, error) + func (s *SQLite) List(ctx context.Context, app, scope, prefix, after string, limit int) ([]Entry, string, error) + func (s *SQLite) NodeLocal() bool + func (s *SQLite) Put(ctx context.Context, app, scope, key, value string, c Cond) (int64, error) + func (s *SQLite) Usage(ctx context.Context, app string) (int64, int64, error) + type Store interface + Close func() error + Delete func(ctx context.Context, app, scope, key string, ifRev int64) (bool, error) + Driver func() string + Drop func(ctx context.Context, app string) error + Get func(ctx context.Context, app, scope, key string) (Entry, bool, error) + Incr func(ctx context.Context, app, scope, key string, by int64) (int64, error) + List func(ctx context.Context, app, scope, prefix, after string, limit int) ([]Entry, string, error) + NodeLocal func() bool + Put func(ctx context.Context, app, scope, key, value string, c Cond) (int64, error) + Usage func(ctx context.Context, app string) (keys, bytes int64, err error)