Documentation ¶
Index ¶
- type LevelDB
- func (ldb *LevelDB) Close() error
- func (ldb *LevelDB) Delete(key []byte) error
- func (ldb *LevelDB) Get(key []byte) (value []byte, err error)
- func (ldb *LevelDB) Has(key []byte) (bool, error)
- func (ldb *LevelDB) IsNotFound(err error) bool
- func (ldb *LevelDB) NewBatch() kv.Batch
- func (ldb *LevelDB) NewIterator(r kv.Range) kv.Iterator
- func (ldb *LevelDB) Put(key, value []byte) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LevelDB ¶
type LevelDB struct {
// contains filtered or unexported fields
}
LevelDB wraps level db impls.
func New ¶
New create a persistent level db instance. Create an empty one if not exists, or open if already there.
func (*LevelDB) Get ¶
Get retrieve value for given key. It returns an error if key not found. The error can be checked via IsNotFound.
func (*LevelDB) IsNotFound ¶
IsNotFound to check if the error returned by Get indicates key not found.
func (*LevelDB) NewIterator ¶
NewIterator create a iterator by range.
Click to show internal directories.
Click to hide internal directories.