Versions in this module Expand all Collapse all v1 v1.0.2 Dec 22, 2020 v1.0.1 Dec 22, 2020 Changes in this version + var ErrClosed = errors.New("leveldb: closed") + var ErrIterReleased = errors.New("leveldb: iterator released") + var ErrNotFound = errors.ErrNotFound + var ErrReadOnly = errors.New("leveldb: read-only mode") + var ErrSnapshotReleased = errors.New("leveldb: snapshot released") + type Batch struct + func MakeBatch(n int) *Batch + func (b *Batch) Delete(key []byte) + func (b *Batch) Dump() []byte + func (b *Batch) Len() int + func (b *Batch) Load(data []byte) error + func (b *Batch) Put(key, value []byte) + func (b *Batch) Replay(r BatchReplay) error + func (b *Batch) Reset() + type BatchReplay interface + Delete func(key []byte) + Put func(key, value []byte) + type DB struct + func Open(stor storage.Storage, o *opt.Options) (db *DB, err error) + func OpenFile(path string, o *opt.Options) (db *DB, err error) + func Recover(stor storage.Storage, o *opt.Options) (db *DB, err error) + func RecoverFile(path string, o *opt.Options) (db *DB, err error) + func (db *DB) Close() error + func (db *DB) CompactRange(r util.Range) error + func (db *DB) Delete(key []byte, wo *opt.WriteOptions) error + func (db *DB) Get(key []byte, ro *opt.ReadOptions) (value []byte, err error) + func (db *DB) GetProperty(name string) (value string, err error) + func (db *DB) GetSnapshot() (*Snapshot, error) + func (db *DB) Has(key []byte, ro *opt.ReadOptions) (ret bool, err error) + func (db *DB) NewIterator(slice *util.Range, ro *opt.ReadOptions) iterator.Iterator + func (db *DB) OpenTransaction() (*Transaction, error) + func (db *DB) Put(key, value []byte, wo *opt.WriteOptions) error + func (db *DB) SetReadOnly() error + func (db *DB) SizeOf(ranges []util.Range) (Sizes, error) + func (db *DB) Stats(s *DBStats) error + func (db *DB) Write(batch *Batch, wo *opt.WriteOptions) error + type DBStats struct + AliveIterators int32 + AliveSnapshots int32 + BlockCacheSize int + IORead uint64 + IOWrite uint64 + Level0Comp uint32 + LevelDurations []time.Duration + LevelRead Sizes + LevelSizes Sizes + LevelTablesCounts []int + LevelWrite Sizes + MemComp uint32 + NonLevel0Comp uint32 + OpenedTablesCount int + SeekComp uint32 + WriteDelayCount int32 + WriteDelayDuration time.Duration + WritePaused bool + type ErrBatchCorrupted struct + Reason string + func (e *ErrBatchCorrupted) Error() string + type ErrInternalKeyCorrupted struct + Ikey []byte + Reason string + func (e *ErrInternalKeyCorrupted) Error() string + type ErrManifestCorrupted struct + Field string + Reason string + func (e *ErrManifestCorrupted) Error() string + type Reader interface + Get func(key []byte, ro *opt.ReadOptions) (value []byte, err error) + NewIterator func(slice *util.Range, ro *opt.ReadOptions) iterator.Iterator + type Sizes []int64 + func (sizes Sizes) Sum() int64 + type Snapshot struct + func (snap *Snapshot) Get(key []byte, ro *opt.ReadOptions) (value []byte, err error) + func (snap *Snapshot) Has(key []byte, ro *opt.ReadOptions) (ret bool, err error) + func (snap *Snapshot) NewIterator(slice *util.Range, ro *opt.ReadOptions) iterator.Iterator + func (snap *Snapshot) Release() + func (snap *Snapshot) String() string + type Transaction struct + func (tr *Transaction) Commit() error + func (tr *Transaction) Delete(key []byte, wo *opt.WriteOptions) error + func (tr *Transaction) Discard() + func (tr *Transaction) Get(key []byte, ro *opt.ReadOptions) ([]byte, error) + func (tr *Transaction) Has(key []byte, ro *opt.ReadOptions) (bool, error) + func (tr *Transaction) NewIterator(slice *util.Range, ro *opt.ReadOptions) iterator.Iterator + func (tr *Transaction) Put(key, value []byte, wo *opt.WriteOptions) error + func (tr *Transaction) Write(b *Batch, wo *opt.WriteOptions) error