dictdb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store provides access to dictionary storage backed by a TreeDB backend.

func New

func New(backend *db.DB) *Store

New wraps an existing backend.

func Open

func Open(path string, opts db.Options) (*Store, error)

Open opens a dictdb backend at path and returns a Store.

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying backend.

func (*Store) GetCurrent

func (s *Store) GetCurrent(_ context.Context) (uint64, error)

GetCurrent returns the current dictionary ID or 0 if unset.

func (*Store) GetDictBytes

func (s *Store) GetDictBytes(_ context.Context, dictID uint64) ([]byte, error)

GetDictBytes returns the dictionary bytes for dictID.

func (*Store) GetK

func (s *Store) GetK(ctx context.Context, dictID uint64) (int, error)

GetK loads the preferred frame group size (K) for dictID. Returns 0 when unset.

func (*Store) PutDictBytes

func (s *Store) PutDictBytes(ctx context.Context, dictBytes []byte) (uint64, error)

PutDictBytes inserts dict bytes (deduped by hash) and returns its dictID.

func (*Store) SetCurrent

func (s *Store) SetCurrent(ctx context.Context, dictID uint64) error

SetCurrent marks dictID as the current dictionary.

func (*Store) SetK

func (s *Store) SetK(ctx context.Context, dictID uint64, k int) error

SetK stores the preferred frame group size (K) for dictID.

Jump to

Keyboard shortcuts

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