store

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBucket = "kamune-store"
	PeersBucket   = "peers"
)

Variables

View Source
var (
	ErrMissingItem   = errors.New("item not found")
	ErrMissingBucket = errors.New("bucket not found")
)

Functions

This section is empty.

Types

type Command

type Command struct {
	Query
}

func (*Command) AddEncrypted

func (c *Command) AddEncrypted(bucket, key, value []byte) error

func (*Command) AddPlain

func (c *Command) AddPlain(bucket, key, value []byte) error

func (*Command) CreateBucket

func (c *Command) CreateBucket(name []byte) error

func (*Command) Delete

func (c *Command) Delete(bucket, key []byte) error

func (*Command) DeleteBatch added in v0.2.0

func (c *Command) DeleteBatch(bucket []byte, keys [][]byte) (int, error)

DeleteBatch removes multiple keys from the same bucket in a single transaction. Keys that do not exist are silently skipped.

type Query

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

func (*Query) GetEncrypted

func (q *Query) GetEncrypted(bucket, key []byte) ([]byte, error)

func (*Query) GetPlain

func (q *Query) GetPlain(bucket, key []byte) ([]byte, error)

func (*Query) IterateEncrypted

func (q *Query) IterateEncrypted(bucket []byte) iter.Seq2[[]byte, []byte]

func (*Query) IteratePlain

func (q *Query) IteratePlain(bucket []byte) iter.Seq2[[]byte, []byte]

func (*Query) ListBuckets added in v0.2.0

func (q *Query) ListBuckets() []string

ListBuckets returns a list of all bucket names in the database

func (*Query) ListBucketsWithPrefix added in v0.2.0

func (q *Query) ListBucketsWithPrefix(prefix string) []string

ListBucketsWithPrefix returns bucket names that start with the given prefix

type Store

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

func New

func New(passphrase []byte, path string) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Command

func (s *Store) Command(f func(c Command) error) error

func (*Store) Query

func (s *Store) Query(f func(q Query) error) error

Jump to

Keyboard shortcuts

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