badgerdb

package
v1.16.64 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: GPL-3.0, BSD-3-Clause Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string, cache int, handles int, namespace string, readonly bool) (ethdb.Database, error)

New creates a new badgerdb database

Types

type Database added in v1.16.28

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

Database is a badgerdb implementation of ethdb.Database

func (*Database) Ancient added in v1.16.28

func (d *Database) Ancient(kind string, number uint64) ([]byte, error)

func (*Database) AncientBatch added in v1.16.39

func (d *Database) AncientBatch() ethdb.AncientWriteOp

func (*Database) AncientBytes added in v1.16.40

func (d *Database) AncientBytes(kind string, id, offset, length uint64) ([]byte, error)

AncientBytes retrieves the value segment of the element specified by the id and value offsets.

func (*Database) AncientDatadir added in v1.16.28

func (d *Database) AncientDatadir() (string, error)

func (*Database) AncientOffSet added in v1.16.28

func (d *Database) AncientOffSet() uint64

func (*Database) AncientRange added in v1.16.28

func (d *Database) AncientRange(kind string, start, count, maxBytes uint64) ([][]byte, error)

func (*Database) AncientSize added in v1.16.28

func (d *Database) AncientSize(kind string) (uint64, error)

func (*Database) Ancients added in v1.16.28

func (d *Database) Ancients() (uint64, error)

func (*Database) Close added in v1.16.28

func (d *Database) Close() error

Close closes the database

func (*Database) Compact added in v1.16.28

func (d *Database) Compact(start []byte, limit []byte) error

Compact compacts the database

func (*Database) Delete added in v1.16.28

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

Delete removes key

func (*Database) DeleteRange added in v1.16.28

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

func (*Database) Get added in v1.16.28

func (d *Database) Get(key []byte) ([]byte, error)

Get retrieves value for key

func (*Database) Has added in v1.16.28

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

Has checks if key exists

func (*Database) HasAncient added in v1.16.28

func (d *Database) HasAncient(kind string, number uint64) (bool, error)

func (*Database) MigrateTable added in v1.16.28

func (d *Database) MigrateTable(s string, f func([]byte) ([]byte, error)) error

func (*Database) ModifyAncients added in v1.16.28

func (d *Database) ModifyAncients(fn func(ethdb.AncientWriteOp) error) (int64, error)

func (*Database) NewBatch added in v1.16.28

func (d *Database) NewBatch() ethdb.Batch

NewBatch creates a new batch

func (*Database) NewBatchWithSize added in v1.16.28

func (d *Database) NewBatchWithSize(size int) ethdb.Batch

NewBatchWithSize creates a new batch with size hint

func (*Database) NewIterator added in v1.16.28

func (d *Database) NewIterator(prefix []byte, start []byte) ethdb.Iterator

NewIterator creates a new iterator

func (*Database) NewSnapshot added in v1.16.28

func (d *Database) NewSnapshot() (Snapshot, error)

func (*Database) Put added in v1.16.28

func (d *Database) Put(key []byte, value []byte) error

Put stores value for key

func (*Database) ReadAncients added in v1.16.28

func (d *Database) ReadAncients(fn func(ethdb.AncientReaderOp) error) error

func (*Database) Stat added in v1.16.28

func (d *Database) Stat() (string, error)

Stat returns database statistics

func (*Database) Sync added in v1.16.28

func (d *Database) Sync() error

func (*Database) SyncAncient added in v1.16.28

func (d *Database) SyncAncient() error

func (*Database) SyncKeyValue added in v1.16.28

func (d *Database) SyncKeyValue() error

func (*Database) Tail added in v1.16.28

func (d *Database) Tail() (uint64, error)

func (*Database) TruncateHead added in v1.16.28

func (d *Database) TruncateHead(n uint64) (uint64, error)

func (*Database) TruncateTail added in v1.16.28

func (d *Database) TruncateTail(n uint64) (uint64, error)

type Snapshot added in v1.16.28

type Snapshot interface {
	Has(key []byte) (bool, error)
	Get(key []byte) ([]byte, error)
	Release()
}

Jump to

Keyboard shortcuts

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