pebble

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDiscardedTransaction = errors.New("discarded txn")

Functions

func New

func New(path string, cache uint, maxOpenFiles int, logger pebble.Logger) (db.DB, error)

New opens a new database at the given path

func NewMem

func NewMem() (db.DB, error)

NewMem opens a new in-memory database

func NewMemTest

func NewMemTest(t *testing.T) db.DB

NewMemTest opens a new in-memory database, panics on error

Types

type DB

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

func (*DB) Close

func (d *DB) Close() error

Close : see io.Closer.Close

func (*DB) Impl

func (d *DB) Impl() any

Impl : see db.DB.Impl

func (*DB) NewTransaction

func (d *DB) NewTransaction(update bool) (db.Transaction, error)

NewTransaction : see db.DB.NewTransaction

func (*DB) Update

func (d *DB) Update(fn func(txn db.Transaction) error) error

Update : see db.DB.Update

func (*DB) View

func (d *DB) View(fn func(txn db.Transaction) error) error

View : see db.DB.View

func (*DB) WithListener added in v0.7.0

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

WithListener registers an EventListener

type Transaction

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

func (*Transaction) Commit

func (t *Transaction) Commit() error

Commit : see db.Transaction.Commit

func (*Transaction) Delete

func (t *Transaction) Delete(key []byte) error

Delete : see db.Transaction.Delete

func (*Transaction) Discard

func (t *Transaction) Discard() error

Discard : see db.Transaction.Discard

func (*Transaction) Get

func (t *Transaction) Get(key []byte, cb func([]byte) error) error

Get : see db.Transaction.Get

func (*Transaction) Impl

func (t *Transaction) Impl() any

Impl : see db.Transaction.Impl

func (*Transaction) NewIterator

func (t *Transaction) NewIterator() (db.Iterator, error)

NewIterator : see db.Transaction.NewIterator

func (*Transaction) Set

func (t *Transaction) Set(key, val []byte) error

Set : see db.Transaction.Set

Jump to

Keyboard shortcuts

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