Documentation ¶
Index ¶
- Variables
- type Batch
- type BoltDB
- func (d *BoltDB) Close() error
- func (d *BoltDB) Compact(start []byte, limit []byte, opts *ethdb.Option) error
- func (d *BoltDB) Delete(key []byte, opts *ethdb.Option) error
- func (d *BoltDB) Get(key []byte, opts *ethdb.Option) ([]byte, error)
- func (d *BoltDB) Has(key []byte, opts *ethdb.Option) (bool, error)
- func (d *BoltDB) NewBatch() ethdb.Batch
- func (d *BoltDB) NewIterator(prefix []byte, start []byte, opts *ethdb.Option) ethdb.Iterator
- func (d *BoltDB) Path() string
- func (d *BoltDB) Put(key []byte, value []byte, opts *ethdb.Option) error
- func (d *BoltDB) Stat(property string, opts *ethdb.Option) (string, error)
- type Iter
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("Not Found") ErrEOF = errors.New("End of file") )
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
func (*BoltDB) 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 (*BoltDB) NewBatch ¶
NewBatch creates a write-only database that buffers changes to its host db until a final write is called.
func (*BoltDB) 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).
Note: This method assumes that the prefix is NOT part of the start, so there's no need for the caller to prepend the prefix to the start
type Iter ¶
type Iter struct {
// contains filtered or unexported fields
}
func (*Iter) Error ¶
Error returns any accumulated error. Exhausting all the key/value pairs is not considered to be an error.
func (*Iter) Key ¶
Key returns the key of the current key/value pair, or nil if done. The caller should not modify the contents of the returned slice, and its contents may change on the next call to Next.
func (*Iter) Next ¶
Next moves the iterator to the next key/value pair. It returns whether the iterator is exhausted.