prefixdb

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: BSD-3-Clause Imports: 4 Imported by: 11 modules, 35 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database partitions a database into a sub-database by prefixing all keys with a unique value.

func New

func New(prefix []byte, db database.Database) *Database

New returns a new prefixed database.

func NewNested deprecated

func NewNested(prefix []byte, db database.Database) *Database

Deprecated: Use New instead.

func (*Database) Backup added in v1.5.1

func (p *Database) Backup(w io.Writer, since uint64) (uint64, error)

func (*Database) Close

func (p *Database) Close() error

Close implements the database.Database interface.

func (*Database) Compact

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

Compact implements the database.Database interface.

func (*Database) Delete

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

Delete implements the database.Database interface.

func (*Database) Get

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

Get implements the database.Database interface.

func (*Database) Has

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

Has implements the database.Database interface.

func (*Database) HealthCheck

func (p *Database) HealthCheck(ctx context.Context) (interface{}, error)

HealthCheck implements the database.Database interface.

func (*Database) Load added in v1.5.1

func (p *Database) Load(r io.Reader) error

func (*Database) NewBatch

func (p *Database) NewBatch() database.Batch

NewBatch implements the database.Database interface.

func (*Database) NewIterator

func (p *Database) NewIterator() database.Iterator

NewIterator implements the database.Database interface.

func (*Database) NewIteratorWithPrefix

func (p *Database) NewIteratorWithPrefix(prefix []byte) database.Iterator

NewIteratorWithPrefix implements the database.Database interface.

func (*Database) NewIteratorWithStart

func (p *Database) NewIteratorWithStart(start []byte) database.Iterator

NewIteratorWithStart implements the database.Database interface.

func (*Database) NewIteratorWithStartAndPrefix

func (p *Database) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator

NewIteratorWithStartAndPrefix implements the database.Database interface.

func (*Database) Put

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

Put implements the database.Database interface.

func (*Database) Sync added in v1.2.17

func (p *Database) Sync() error

Sync implements the database.Syncer interface by delegating to the underlying database.

Jump to

Keyboard shortcuts

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