versiondb

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0 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 implements the Database interface by living on top of another database, writing changes to the underlying database only when commit is called.

func New

func New(db database.Database) *Database

New returns a new prefixed database

func (*Database) Abort

func (db *Database) Abort()

Abort all changes to the underlying database

func (*Database) Close

func (db *Database) Close() error

Close implements the database.Database interface

func (*Database) Commit

func (db *Database) Commit() error

Commit writes all the operations of this database to the underlying database

func (*Database) CommitBatch

func (db *Database) CommitBatch() (database.Batch, error)

CommitBatch returns a batch that contains all uncommitted puts/deletes. Calling Write() on the returned batch causes the puts/deletes to be written to the underlying database. The returned batch should be written before future calls to this DB unless the batch will never be written.

func (*Database) Compact

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

Compact implements the database.Database interface

func (*Database) Delete

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

Delete implements the database.Database interface

func (*Database) Get

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

Get implements the database.Database interface

func (*Database) GetDatabase

func (db *Database) GetDatabase() database.Database

GetDatabase returns the underlying database

func (*Database) Has

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

Has implements the database.Database interface

func (*Database) NewBatch

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

NewBatch implements the database.Database interface

func (*Database) NewIterator

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

NewIterator implements the database.Database interface

func (*Database) NewIteratorWithPrefix

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

NewIteratorWithPrefix implements the database.Database interface

func (*Database) NewIteratorWithStart

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

NewIteratorWithStart implements the database.Database interface

func (*Database) NewIteratorWithStartAndPrefix

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

NewIteratorWithStartAndPrefix implements the database.Database interface

func (*Database) Put

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

Put implements the database.Database interface

func (*Database) SetDatabase

func (db *Database) SetDatabase(newDB database.Database) error

SetDatabase changes the underlying database to the specified database

func (*Database) Stat

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

Stat implements the database.Database interface

Jump to

Keyboard shortcuts

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