Documentation ¶
Index ¶
- type Fallible
- func (f *Fallible) Close() error
- func (f *Fallible) Compact(start []byte, limit []byte) error
- func (f *Fallible) Delete(key []byte) error
- func (f *Fallible) Drop()
- func (f *Fallible) Get(key []byte) ([]byte, error)
- func (f *Fallible) GetWriteCount() int
- func (f *Fallible) Has(key []byte) (bool, error)
- func (f *Fallible) NewBatch() ethdb.Batch
- func (f *Fallible) NewIterator(prefix []byte, start []byte) ethdb.Iterator
- func (f *Fallible) Put(key []byte, value []byte) error
- func (f *Fallible) SetWriteCount(n int)
- func (f *Fallible) Stat(property string) (string, error)
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) Compact ¶
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) NewBatch ¶
NewBatch creates a write-only database that buffers changes to its host db until a final write is called.
func (*Fallible) NewIterator ¶
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).