prefixdb

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: BSD-3-Clause Imports: 4 Imported by: ? modules, 0 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

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

NewNested returns a new prefixed database without attempting to compress prefixes.

func (*Database) Close

func (db *Database) Close() error

func (*Database) Compact

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

func (*Database) Delete

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

Assumes that it is OK for the argument to db.db.Delete to be modified after db.db.Delete returns. [key] may be modified after this method returns.

func (*Database) Get

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

Assumes that it is OK for the argument to db.db.Get to be modified after db.db.Get returns. [key] may be modified after this method returns.

func (*Database) Has

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

Assumes that it is OK for the argument to db.db.Has to be modified after db.db.Has returns [key] may be modified after this method returns.

func (*Database) NewBatch

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

func (*Database) NewIterator

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

func (*Database) NewIteratorWithPrefix

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

func (*Database) NewIteratorWithStart

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

func (*Database) NewIteratorWithStartAndPrefix

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

Assumes it is safe to modify the arguments to db.db.NewIteratorWithStartAndPrefix after it returns. It is safe to modify [start] and [prefix] after this method returns.

func (*Database) Put

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

Assumes that it is OK for the argument to db.db.Put to be modified after db.db.Put returns. [key] can be modified after this method returns. [value] should not be modified.

func (*Database) Stat

func (db *Database) Stat(stat string) (string, error)

Jump to

Keyboard shortcuts

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