corruptabledb

package
v1.10.19-options-befor... Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: BSD-3-Clause Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

CorruptableDB is a wrapper around Database it prevents any future calls in case of a corruption occurs

func New

func New(db database.Database) *Database

New returns a new prefixed database

func (*Database) Close

func (db *Database) Close() error

func (*Database) Compact

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

func (*Database) Delete

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

Delete removes the key from the database

func (*Database) Get

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

Get returns the value the key maps to in the database

func (*Database) Has

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

Has returns if the key is set in the database

func (*Database) HealthCheck added in v1.7.13

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

func (*Database) NewBatch

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

func (*Database) NewIterator added in v1.10.9

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

func (*Database) NewIteratorWithPrefix added in v1.10.9

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

func (*Database) NewIteratorWithStart added in v1.10.9

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

func (*Database) NewIteratorWithStartAndPrefix added in v1.10.9

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

func (*Database) Put

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

Put sets the value of the provided key to the provided value

Jump to

Keyboard shortcuts

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