prefixdb

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: BSD-3-Clause Imports: 2 Imported by: 16

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 db.Database) *Database

New returns a new prefixed database.

func NewNested deprecated

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

Deprecated: Use New instead.

func (*Database) Close

func (p *Database) Close() error

Close implements the db.Database interface.

func (*Database) Compact

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

Compact implements the db.Database interface.

func (*Database) Delete

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

Delete implements the db.Database interface.

func (*Database) Get

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

Get implements the db.Database interface.

func (*Database) Has

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

Has implements the db.Database interface.

func (*Database) HealthCheck

func (p *Database) HealthCheck() error

HealthCheck implements the db.Database interface.

func (*Database) NewBatch

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

NewBatch implements the db.Database interface.

func (*Database) NewIterator

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

NewIterator implements the db.Database interface.

func (*Database) NewIteratorWithPrefix

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

NewIteratorWithPrefix implements the db.Database interface.

func (*Database) NewIteratorWithStart

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

NewIteratorWithStart implements the db.Database interface.

func (*Database) NewIteratorWithStartAndPrefix

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

NewIteratorWithStartAndPrefix implements the db.Database interface.

func (*Database) Put

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

Put implements the db.Database interface.

Jump to

Keyboard shortcuts

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