fallible

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fallible

type Fallible struct {
	Underlying kvdb.KeyValueStore
	// contains filtered or unexported fields
}

Fallible is a kvdb.KeyValueStore wrapper around any kvdb.KeyValueStore. It falls when write counter is full for test purpose.

func Wrap

func Wrap(db kvdb.KeyValueStore) *Fallible

Wrap returns a wrapped kvdb.KeyValueStore with counter 0. Set it manually.

func (*Fallible) Close

func (f *Fallible) Close() error

Close closes database.

func (*Fallible) Compact

func (f *Fallible) Compact(start []byte, limit []byte) error

Compact flattens the underlying data store for the given key range. In essence, deleted and overwritten versions are discarded, and the data is rearranged to reduce the cost of operations needed to access them.

A nil start is treated as a key before all keys in the data store; a nil limit is treated as a key after all keys in the data store. If both is nil then it will compact entire data store.

func (*Fallible) Delete

func (f *Fallible) Delete(key []byte) error

Delete removes the key from the key-value data store.

func (*Fallible) Drop

func (f *Fallible) Drop()

Drop drops database.

func (*Fallible) Get

func (f *Fallible) Get(key []byte) ([]byte, error)

Get retrieves the given key if it's present in the key-value data store.

func (*Fallible) GetWriteCount

func (f *Fallible) GetWriteCount() int

GetWriteCount to left.

func (*Fallible) Has

func (f *Fallible) Has(key []byte) (bool, error)

Has retrieves if a key is present in the key-value data store.

func (*Fallible) NewBatch

func (f *Fallible) NewBatch() ethdb.Batch

NewBatch creates a write-only database that buffers changes to its host db until a final write is called.

func (*Fallible) NewIterator

func (f *Fallible) NewIterator(prefix []byte, start []byte) ethdb.Iterator

NewIterator creates a binary-alphabetical iterator over a subset of database content with a particular key prefix, starting at a particular initial key (or after, if it does not exist).

func (*Fallible) Put

func (f *Fallible) Put(key []byte, value []byte) error

Put inserts the given value into the key-value data store.

func (*Fallible) SetWriteCount

func (f *Fallible) SetWriteCount(n int)

SetWriteCount to n.

func (*Fallible) Stat

func (f *Fallible) Stat(property string) (string, error)

Stat returns a particular internal stat of the database.

Jump to

Keyboard shortcuts

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