pebble

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDiscardedTransaction = errors.New("discarded transaction")
	ErrReadOnlyTransaction  = errors.New("read-only transaction")
)

Functions

func New

func New(path string) (db.KeyValueStore, error)

New opens a new database at the given path with default options

func NewBatch added in v0.12.3

func NewBatch(dbBatch *pebble.Batch, db *DB, listener db.EventListener) *batch

func NewSnapshot added in v0.12.3

func NewSnapshot(db *pebble.DB, listener db.EventListener) *snapshot

func NewWithOptions added in v0.12.0

func NewWithOptions(path string, cacheSizeMB uint, maxOpenFiles int, colouredLogger bool) (db.KeyValueStore, error)

Types

type DB

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

func (*DB) Close

func (d *DB) Close() error

func (*DB) Delete added in v0.14.4

func (d *DB) Delete(key []byte) error

func (*DB) DeleteRange added in v0.14.4

func (d *DB) DeleteRange(start, end []byte) error

func (*DB) Get added in v0.14.4

func (d *DB) Get(key []byte, cb func(value []byte) error) error

func (*DB) Has added in v0.14.4

func (d *DB) Has(key []byte) (bool, error)

func (*DB) Impl

func (d *DB) Impl() any

func (*DB) NewBatch added in v0.14.4

func (d *DB) NewBatch() db.Batch

func (*DB) NewBatchWithSize added in v0.14.4

func (d *DB) NewBatchWithSize(size int) db.Batch

func (*DB) NewIndexedBatch added in v0.14.4

func (d *DB) NewIndexedBatch() db.IndexedBatch

func (*DB) NewIndexedBatchWithSize added in v0.14.4

func (d *DB) NewIndexedBatchWithSize(size int) db.IndexedBatch

func (*DB) NewIterator added in v0.14.4

func (d *DB) NewIterator(prefix []byte, withUpperBound bool) (db.Iterator, error)

func (*DB) NewSnapshot added in v0.14.4

func (d *DB) NewSnapshot() db.Snapshot

func (*DB) Put added in v0.14.4

func (d *DB) Put(key, val []byte) error

func (*DB) Update

func (d *DB) Update(fn func(w db.IndexedBatch) error) error

func (*DB) View

func (d *DB) View(fn func(r db.Snapshot) error) error

func (*DB) WithListener added in v0.7.0

func (d *DB) WithListener(listener db.EventListener) db.KeyValueStore

type Item added in v0.12.1

type Item struct {
	Count uint
	Size  utils.DataSize
}

func CalculatePrefixSize added in v0.12.0

func CalculatePrefixSize(ctx context.Context, pDB *DB, prefix []byte, withUpperBound bool) (*Item, error)

Jump to

Keyboard shortcuts

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