Help us shape the future of Go! Take the 2026 Go Developer Survey

versiondb

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: 3 Imported by: 44

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 wraps a database to allow version management.

func New

func New(baseDB db.Database) *Database

New returns a new versioned database.

func (*Database) Close

func (db *Database) Close() error

Close implements the db.Database interface.

func (*Database) Compact

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

Compact implements the db.Database interface.

func (*Database) Current added in v1.1.1

func (db *Database) Current() db.Database

Current returns the current version database.

func (*Database) Delete

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

Delete implements the db.Database interface.

func (*Database) Get

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

Get implements the db.Database interface.

func (*Database) Has

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

Has implements the db.Database interface.

func (*Database) HealthCheck

func (db *Database) HealthCheck() error

HealthCheck implements the db.Database interface.

func (*Database) NewBatch

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

NewBatch implements the db.Database interface.

func (*Database) NewIterator

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

NewIterator implements the db.Database interface.

func (*Database) NewIteratorWithPrefix

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

NewIteratorWithPrefix implements the db.Database interface.

func (*Database) NewIteratorWithStart

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

NewIteratorWithStart implements the db.Database interface.

func (*Database) NewIteratorWithStartAndPrefix

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

NewIteratorWithStartAndPrefix implements the db.Database interface.

func (*Database) NewVersion added in v1.1.1

func (db *Database) NewVersion(versionID string) error

NewVersion creates a new version with the given ID.

func (*Database) Put

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

Put implements the db.Database interface.

func (*Database) SetDatabase

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

SetDatabase sets the underlying database for the current version.

func (*Database) SetVersion added in v1.1.1

func (db *Database) SetVersion(versionID string) error

SetVersion sets the current version to the specified ID.

Jump to

Keyboard shortcuts

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