memdb

package
v0.0.0-...-78e8a51 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage provides in-memory storage backed by go-memdb.

func New

func New() (*Storage, error)

New creates a new in-memory storage.

func (*Storage) ApplyBatch

func (s *Storage) ApplyBatch(ctx context.Context, items []kv.KeyValue) error

ApplyBatch applies a batch of set and delete operations in a single transaction. For each item: nil Value means delete, non-nil means set.

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, key []byte) error

Delete removes a key.

func (*Storage) Get

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

Get retrieves a value by key.

func (*Storage) Range

Range iterates over keys in the given range.

func (*Storage) Set

func (s *Storage) Set(ctx context.Context, key []byte, value []byte) error

Set stores a key-value pair.

Jump to

Keyboard shortcuts

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