Versions in this module Expand all Collapse all v1 v1.1.21 Jul 5, 2021 Changes in this version + const ENDN + const ENDR + const IteratorPageSize + const ListASC + const ListDESC + const ListKeyOnly + const ListSeek + const ListWithKey + const NotFound + const OK + const PooledSize + const ReadBufSize + const ReadTimeOut + const WriteTimeOut + var ErrIterReleased = errors.New("ErrIterReleased") + var ErrNotFoundInDb = types.ErrNotFound + var FormatString = "%v\nthe trace error is\n%s" + var HashKeyLen = 24 + func GetKey(key []byte, version int64) ([]byte, error) + func GetKeyPerfix(key []byte) []byte + func MustWrite(batch Batch) + func ToNum(bs []byte) int + type BaseDB struct + func (db *BaseDB) Begin() + func (db *BaseDB) BeginTx() (TxKV, error) + func (db *BaseDB) Commit() error + func (db *BaseDB) CompactRange(start, limit []byte) error + func (db *BaseDB) GetCache() *lru.ARCCache + func (db *BaseDB) Rollback() + func (db *BaseDB) SetCacheSize(size int) + type Batch interface + Delete func(key []byte) + Reset func() + Set func(key, value []byte) + UpdateWriteSync func(sync bool) + ValueLen func() int + ValueSize func() int + Write func() error + type DB interface + BeginTx func() (TxKV, error) + Close func() + CompactRange func(start, limit []byte) error + Delete func([]byte) error + DeleteSync func([]byte) error + GetCache func() *lru.ARCCache + NewBatch func(sync bool) Batch + Print func() + SetCacheSize func(size int) + SetSync func([]byte, []byte) error + Stats func() map[string]string + func NewDB(name string, backend string, dir string, cache int32) DB + type GoBadgerDB struct + func NewGoBadgerDB(name string, dir string, cache int) (*GoBadgerDB, error) + func (db *GoBadgerDB) Close() + func (db *GoBadgerDB) DB() *badger.DB + func (db *GoBadgerDB) Delete(key []byte) error + func (db *GoBadgerDB) DeleteSync(key []byte) error + func (db *GoBadgerDB) Get(key []byte) ([]byte, error) + func (db *GoBadgerDB) Iterator(start, end []byte, reverse bool) Iterator + func (db *GoBadgerDB) NewBatch(sync bool) Batch + func (db *GoBadgerDB) Print() + func (db *GoBadgerDB) Set(key []byte, value []byte) error + func (db *GoBadgerDB) SetSync(key []byte, value []byte) error + func (db *GoBadgerDB) Stats() map[string]string + type GoBadgerDBBatch struct + func (mBatch *GoBadgerDBBatch) Delete(key []byte) + func (mBatch *GoBadgerDBBatch) Reset() + func (mBatch *GoBadgerDBBatch) Set(key, value []byte) + func (mBatch *GoBadgerDBBatch) UpdateWriteSync(sync bool) + func (mBatch *GoBadgerDBBatch) ValueLen() int + func (mBatch *GoBadgerDBBatch) ValueSize() int + func (mBatch *GoBadgerDBBatch) Write() error + type GoLevelDB struct + func NewGoLevelDB(name string, dir string, cache int) (*GoLevelDB, error) + func (db *GoLevelDB) BeginTx() (TxKV, error) + func (db *GoLevelDB) Close() + func (db *GoLevelDB) CompactRange(start, limit []byte) error + func (db *GoLevelDB) DB() *leveldb.DB + func (db *GoLevelDB) Delete(key []byte) error + func (db *GoLevelDB) DeleteSync(key []byte) error + func (db *GoLevelDB) Get(key []byte) ([]byte, error) + func (db *GoLevelDB) Iterator(start []byte, end []byte, reverse bool) Iterator + func (db *GoLevelDB) NewBatch(sync bool) Batch + func (db *GoLevelDB) Print() + func (db *GoLevelDB) Set(key []byte, value []byte) error + func (db *GoLevelDB) SetSync(key []byte, value []byte) error + func (db *GoLevelDB) Stats() map[string]string + type GoMemDB struct + func NewGoMemDB(name string, dir string, cache int) (*GoMemDB, error) + func (db *GoMemDB) Close() + func (db *GoMemDB) DB() *memdb.DB + func (db *GoMemDB) Delete(key []byte) error + func (db *GoMemDB) DeleteSync(key []byte) error + func (db *GoMemDB) Get(key []byte) ([]byte, error) + func (db *GoMemDB) Iterator(start []byte, end []byte, reverse bool) Iterator + func (db *GoMemDB) NewBatch(sync bool) Batch + func (db *GoMemDB) Print() + func (db *GoMemDB) Set(key []byte, value []byte) error + func (db *GoMemDB) SetSync(key []byte, value []byte) error + func (db *GoMemDB) Stats() map[string]string + type GoSSDB struct + func NewGoSSDB(name string, dir string, cache int) (*GoSSDB, error) + func (db *GoSSDB) Close() + func (db *GoSSDB) Delete(key []byte) error + func (db *GoSSDB) DeleteSync(key []byte) error + func (db *GoSSDB) Get(key []byte) ([]byte, error) + func (db *GoSSDB) Iterator(itbeg []byte, itend []byte, reverse bool) Iterator + func (db *GoSSDB) NewBatch(sync bool) Batch + func (db *GoSSDB) Print() + func (db *GoSSDB) Set(key []byte, value []byte) error + func (db *GoSSDB) SetSync(key []byte, value []byte) error + func (db *GoSSDB) Stats() map[string]string + type Iterator interface + Close func() + Error func() error + IsReverse func() bool + Key func() []byte + Prefix func() []byte + Valid func() bool + Value func() []byte + ValueCopy func() []byte + func NewMergedIterator(iters []Iterator) Iterator + type IteratorDB interface + Iterator func(start []byte, end []byte, reserver bool) Iterator + func NewMergedIteratorDB(iters []IteratorDB) IteratorDB + type IteratorSeeker interface + Next func() bool + Rewind func() bool + Seek func(key []byte) bool + type KV interface + Begin func() + Commit func() error + Get func(key []byte) ([]byte, error) + Rollback func() + Set func(key []byte, value []byte) (err error) + type KVDB interface + func NewKVDB(db DB) KVDB + func NewLocalDB(maindb DB, readOnly bool) KVDB + type KVDBList struct + func (l *KVDBList) List(prefix, key []byte, count, direction int32) ([][]byte, error) + func (l *KVDBList) PrefixCount(prefix []byte) int64 + type ListHelper struct + func NewListHelper(db IteratorDB) *ListHelper + func (db *ListHelper) IteratorCallback(start []byte, end []byte, count int32, direction int32, ...) + func (db *ListHelper) IteratorScan(prefix []byte, key []byte, count int32, direction int32) [][]byte + func (db *ListHelper) IteratorScanFromFirst(prefix []byte, count int32, direction int32) (values [][]byte) + func (db *ListHelper) IteratorScanFromLast(prefix []byte, count int32, direction int32) (values [][]byte) + func (db *ListHelper) List(prefix, key []byte, count, direction int32) [][]byte + func (db *ListHelper) PrefixCount(prefix []byte) (count int64) + func (db *ListHelper) PrefixScan(prefix []byte) [][]byte + type Lister interface + List func(prefix, key []byte, count, direction int32) ([][]byte, error) + PrefixCount func(prefix []byte) int64 + type LocalDB struct + func (l *LocalDB) Begin() + func (l *LocalDB) Commit() error + func (l *LocalDB) Get(key []byte) ([]byte, error) + func (l *LocalDB) List(prefix, key []byte, count, direction int32) ([][]byte, error) + func (l *LocalDB) PrefixCount(prefix []byte) (count int64) + func (l *LocalDB) Rollback() + func (l *LocalDB) Set(key []byte, value []byte) error + type MVCC interface + AddMVCC func(kvs []*types.KeyValue, hash []byte, prevHash []byte, version int64) ([]*types.KeyValue, error) + DelMVCC func(hash []byte, version int64, strict bool) ([]*types.KeyValue, error) + DelV func(key []byte, version int64) error + DelVersion func(hash []byte) error + GetMaxVersion func() (int64, error) + GetV func(key []byte, version int64) ([]byte, error) + GetVersion func(hash []byte) (int64, error) + GetVersionHash func(version int64) ([]byte, error) + SetV func(key []byte, value []byte, version int64) error + SetVersion func(hash []byte, version int64) error + Trash func(version int64) error + type MVCCHelper struct + func NewMVCC(db DB) *MVCCHelper + func (m *MVCCHelper) DelV(key []byte, version int64) error + func (m *MVCCHelper) DelVersion(hash []byte) error + func (m *MVCCHelper) PrintAll() + func (m *MVCCHelper) SetVersion(hash []byte, version int64) error + func (m *MVCCHelper) Trash(version int64) error + type MVCCIter struct + func NewMVCCIter(db DB) *MVCCIter + func (m *MVCCIter) AddMVCC(kvs []*types.KeyValue, hash []byte, prevHash []byte, version int64) ([]*types.KeyValue, error) + func (m *MVCCIter) DelMVCC(hash []byte, version int64, strict bool) ([]*types.KeyValue, error) + func (m *MVCCIter) Iterator(start, end []byte, reserver bool) Iterator + type MVCCKV interface + DelVersionKV func([]byte, int64) ([]*types.KeyValue, error) + GetDelKV func(key []byte, version int64) (*types.KeyValue, error) + GetSaveKV func(key []byte, value []byte, version int64) (*types.KeyValue, error) + SetVersionKV func(hash []byte, version int64) ([]*types.KeyValue, error) + type PegasusBatch struct + func (db *PegasusBatch) Delete(key []byte) + func (db *PegasusBatch) Reset() + func (db *PegasusBatch) Set(key, value []byte) + func (db *PegasusBatch) UpdateWriteSync(sync bool) + func (db *PegasusBatch) ValueLen() int + func (db *PegasusBatch) ValueSize() int + func (db *PegasusBatch) Write() error + type PegasusDB struct + func NewPegasusDB(name string, dir string, cache int) (*PegasusDB, error) + func (db *PegasusDB) Close() + func (db *PegasusDB) Delete(key []byte) error + func (db *PegasusDB) DeleteSync(key []byte) error + func (db *PegasusDB) Get(key []byte) ([]byte, error) + func (db *PegasusDB) Iterator(begin []byte, end []byte, reverse bool) Iterator + func (db *PegasusDB) NewBatch(sync bool) Batch + func (db *PegasusDB) Print() + func (db *PegasusDB) Set(key []byte, value []byte) error + func (db *PegasusDB) SetSync(key []byte, value []byte) error + func (db *PegasusDB) Stats() map[string]string + type PegasusIt struct + func (dbit *PegasusIt) Close() + func (dbit *PegasusIt) Error() error + func (dbit *PegasusIt) Key() []byte + func (dbit *PegasusIt) Next() bool + func (dbit *PegasusIt) Rewind() bool + func (dbit *PegasusIt) Seek(key []byte) bool + func (dbit *PegasusIt) Valid() bool + func (dbit *PegasusIt) Value() []byte + func (dbit *PegasusIt) ValueCopy() []byte + func (it *PegasusIt) IsReverse() bool + func (it *PegasusIt) Prefix() []byte + type RoundInt struct + type SDBClient struct + func Connect(ip string, port int) (*SDBClient, error) + func (c *SDBClient) Close() error + func (c *SDBClient) Del(key string) error + func (c *SDBClient) Do(args ...interface{}) ([]string, error) + func (c *SDBClient) Get(key string) (*Value, error) + func (c *SDBClient) Keys(keyStart, keyEnd string, limit int64) ([]string, error) + func (c *SDBClient) MultiDel(key ...string) (err error) + func (c *SDBClient) MultiGet(key ...string) (vals []*Value, err error) + func (c *SDBClient) MultiSet(kvs map[string][]byte) (err error) + func (c *SDBClient) Rkeys(keyStart, keyEnd string, limit int64) ([]string, error) + func (c *SDBClient) Set(key string, val []byte) (err error) + type SDBPool struct + func NewSDBPool(nodes []*SsdbNode) (pool *SDBPool, err error) + type SimpleMVCC struct + func NewSimpleMVCC(db KVDB) *SimpleMVCC + func (m *SimpleMVCC) AddMVCC(kvs []*types.KeyValue, hash []byte, prevHash []byte, version int64) ([]*types.KeyValue, error) + func (m *SimpleMVCC) DelMVCC(hash []byte, version int64, strict bool) ([]*types.KeyValue, error) + func (m *SimpleMVCC) DelVersionKV(hash []byte, version int64) ([]*types.KeyValue, error) + func (m *SimpleMVCC) GetDelKV(key []byte, version int64) (*types.KeyValue, error) + func (m *SimpleMVCC) GetDelKVList(version int64) ([]*types.KeyValue, error) + func (m *SimpleMVCC) GetMaxVersion() (int64, error) + func (m *SimpleMVCC) GetSaveKV(key []byte, value []byte, version int64) (*types.KeyValue, error) + func (m *SimpleMVCC) GetV(key []byte, version int64) ([]byte, error) + func (m *SimpleMVCC) GetVersion(hash []byte) (int64, error) + func (m *SimpleMVCC) GetVersionHash(version int64) ([]byte, error) + func (m *SimpleMVCC) SetV(key []byte, value []byte, version int64) error + func (m *SimpleMVCC) SetVersionKV(hash []byte, version int64) ([]*types.KeyValue, error) + type SsdbBench struct + func (bench *SsdbBench) String() string + type SsdbNode struct + type TxKV interface + type Value struct + func (v *Value) Bytes() []byte + func (v *Value) String() string