Versions in this module Expand all Collapse all v1 v1.0.0 Aug 4, 2023 Changes in this version + const DBInfo + const LastBlockInfo + func BytesPrefixRange(prefix, start []byte) *util.Range + type Batch interface + Replay func(w KeyValueWriter) error + Reset func() + ValueSize func() int + type BatchWithID struct + B BatchWriter + ID int32 + type BatchWriter interface + Dump func() []byte + Load func(data []byte) error + Write func() error + type Batcher interface + NewBatch func() Batch + NewBatchWithSize func(size int) Batch + type Compacter interface + Compact func(start []byte, limit []byte) error + type DB interface + type DBPool struct + func NewDBPool() *DBPool + func (p *DBPool) Close() + func (p *DBPool) GetBlockInfo() (header *pb.BlockInfo, err error) + func (p *DBPool) GetDB(id int32) (db DB, err error) + func (p *DBPool) GetDBID(path string) (id int32, err error) + func (p *DBPool) GetDBInfo() (info *pb.DBInfoList, err error) + func (p *DBPool) Marshal(batchs []BatchWithID) (batchItems []*pb.Data, err error) + func (p *DBPool) Open(dbInfo *pb.DBInfo, cacheSize int) (err error) + func (p *DBPool) Register(id int32, path string, dbType string, db DB, isMetaDB bool) + func (p *DBPool) WriteBatchItems(items []*pb.Data) (err error) + func (p *DBPool) WriteBatchs(batchs []BatchWithID) (err error) + func (p *DBPool) WriteBlockInfo(header *pb.BlockInfo) (err error) + type Iteratee interface + NewIterator func(prefix []byte, start []byte) Iterator + NewIteratorWithRange func(start []byte, limit []byte) (Iterator, error) + type Iterator interface + Error func() error + Key func() []byte + Next func() bool + Release func() + Value func() []byte + type KeyValueReader interface + Get func(key []byte) ([]byte, error) + Has func(key []byte) (bool, error) + type KeyValueStater interface + Stat func(property string) (string, error) + Stats func() (map[string]string, error) + type KeyValueWriter interface + Delete func(key []byte) error + Put func(key []byte, value []byte) error + type LBatch struct + Batch *leveldb.Batch + DB *LDB + func (l *LBatch) Delete(key []byte) error + func (l *LBatch) Dump() []byte + func (l *LBatch) Load(data []byte) error + func (l *LBatch) Put(key, value []byte) error + func (l *LBatch) Replay(w KeyValueWriter) error + func (l *LBatch) Reset() + func (l *LBatch) ValueSize() int + func (l *LBatch) Write() error + type LDB struct + DB *leveldb.DB + Id int32 + func NewLDB(path string, cacheSize int) (*LDB, error) + func (l *LDB) Close() error + func (l *LDB) Compact(start, limit []byte) error + func (l *LDB) Delete(key []byte) error + func (l *LDB) Get(key []byte) ([]byte, error) + func (l *LDB) Has(key []byte) (bool, error) + func (l *LDB) NewBatch() Batch + func (l *LDB) NewBatchWithSize(size int) Batch + func (l *LDB) NewIterator(prefix []byte, start []byte) Iterator + func (l *LDB) NewIteratorWithRange(start, limit []byte) (Iterator, error) + func (l *LDB) NewSnapshot() (Snapshot, error) + func (l *LDB) Put(key, value []byte) error + func (l *LDB) Stat(property string) (string, error) + func (l *LDB) Stats() (map[string]string, error) + type LIterator struct + func (iter *LIterator) Error() error + func (iter *LIterator) Key() []byte + func (iter *LIterator) Next() bool + func (iter *LIterator) Release() + func (iter *LIterator) Value() []byte + type LSnapshot struct + func (snap *LSnapshot) Get(key []byte) ([]byte, error) + func (snap *LSnapshot) Has(key []byte) (bool, error) + func (snap *LSnapshot) Release() + type Replayer struct + Failure error + Writer KeyValueWriter + func (r *Replayer) Delete(key []byte) + func (r *Replayer) Put(key, value []byte) + type Snapshot interface + Release func() + type Snapshotter interface + NewSnapshot func() (Snapshot, error)