pebble

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed          = errors.New("db is closed")
	ErrNotFound        = errors.New("key not found")
	ErrBatchDone       = errors.New("batch is already committed or closed")
	ErrIteratorInvalid = errors.New("iterator is not valid")

	ErrInIteratorCreation = "failed to create iterator with error %w"
	ErrIteratorValue      = "iterator value errored with %w"
)

Functions

This section is empty.

Types

type Batch

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

func (*Batch) Close

func (b *Batch) Close() error

func (*Batch) Commit

func (b *Batch) Commit() error

func (*Batch) Delete

func (b *Batch) Delete(key []byte) error

func (*Batch) Put

func (b *Batch) Put(key, value []byte) error

type Iterator

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

func (*Iterator) Close

func (it *Iterator) Close() error

func (*Iterator) Key

func (it *Iterator) Key() []byte

func (*Iterator) Next

func (it *Iterator) Next() bool

func (*Iterator) Valid

func (it *Iterator) Valid() bool

func (*Iterator) Value

func (it *Iterator) Value() ([]byte, error)

type KVStore

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

func NewKVStore

func NewKVStore() (*KVStore, error)

NewKVStore initializes a new in-memory key-value store using Pebble.

func (*KVStore) Close

func (p *KVStore) Close() error

func (*KVStore) Delete

func (p *KVStore) Delete(key []byte) error

func (*KVStore) Get

func (p *KVStore) Get(key []byte) ([]byte, error)

func (*KVStore) NewBatch

func (p *KVStore) NewBatch() db.Batch

func (*KVStore) NewIterator

func (p *KVStore) NewIterator(start, end []byte) (db.Iterator, error)

func (*KVStore) Put

func (p *KVStore) Put(key, value []byte) error

Jump to

Keyboard shortcuts

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