zapdb

package
v1.16.87 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: GPL-3.0, LGPL-3.0, BSD-3-Clause Imports: 4 Imported by: 0

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 zapdb-backed database

Types

type Database

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

Database is a zapdb (badgerdb fork) implementation of ethdb.Database

func (*Database) Ancient

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

func (*Database) AncientBatch

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

func (*Database) AncientBytes

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

func (*Database) AncientDatadir

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

func (*Database) AncientOffSet

func (d *Database) AncientOffSet() uint64

func (*Database) AncientRange

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

func (*Database) AncientSize

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

func (*Database) Ancients

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

func (*Database) Close

func (d *Database) Close() error

Close closes the database

func (*Database) Compact

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

Compact compacts the database

func (*Database) Delete

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

Delete removes key

func (*Database) DeleteRange

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

func (*Database) Get

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

Get retrieves value for key

func (*Database) Has

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

Has checks if key exists

func (*Database) HasAncient

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

func (*Database) MigrateTable

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

func (*Database) ModifyAncients

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

func (*Database) NewBatch

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

NewBatch creates a new batch

func (*Database) NewBatchWithSize

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

NewBatchWithSize creates a new batch with size hint

func (*Database) NewIterator

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

NewIterator creates a new iterator

func (*Database) NewSnapshot

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

func (*Database) Put

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

Put stores value for key

func (*Database) ReadAncients

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

func (*Database) Stat

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

Stat returns database statistics

func (*Database) Sync

func (d *Database) Sync() error

Sync flushes all pending writes to disk

func (*Database) SyncAncient

func (d *Database) SyncAncient() error

func (*Database) SyncKeyValue

func (d *Database) SyncKeyValue() error

func (*Database) Tail

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

func (*Database) TruncateHead

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

func (*Database) TruncateTail

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

type Snapshot

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

Snapshot support

Jump to

Keyboard shortcuts

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