Documentation ¶
Index ¶
- Constants
- Variables
- func BitCount(src *[]byte, start, end int) int
- func BitOp(op string, vals [][]byte) []byte
- func ExecAppend(engine *DBEngine, args [][]byte) parser.RespData
- func ExecBitcount(engine *DBEngine, args [][]byte) parser.RespData
- func ExecBitop(engine *DBEngine, args [][]byte) parser.RespData
- func ExecDecr(engine *DBEngine, args [][]byte) parser.RespData
- func ExecDecrby(engine *DBEngine, args [][]byte) parser.RespData
- func ExecDel(engine *DBEngine, args [][]byte) parser.RespData
- func ExecEcho(engine *DBEngine, args [][]byte) parser.RespData
- func ExecExists(engine *DBEngine, args [][]byte) parser.RespData
- func ExecExpire(engine *DBEngine, args [][]byte) parser.RespData
- func ExecExpireat(engine *DBEngine, args [][]byte) parser.RespData
- func ExecGet(engine *DBEngine, args [][]byte) parser.RespData
- func ExecGetbit(engine *DBEngine, args [][]byte) parser.RespData
- func ExecGetrange(engine *DBEngine, args [][]byte) parser.RespData
- func ExecGetset(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHdel(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHexists(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHget(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHgetall(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHincrby(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHincrbyfloat(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHkeys(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHlen(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHmget(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHmset(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHset(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHsetnx(engine *DBEngine, args [][]byte) parser.RespData
- func ExecHvals(engine *DBEngine, args [][]byte) parser.RespData
- func ExecIncr(engine *DBEngine, args [][]byte) parser.RespData
- func ExecIncrby(engine *DBEngine, args [][]byte) parser.RespData
- func ExecIncrbyfloat(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLindex(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLinsert(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLlen(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLpop(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLpush(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLpushX(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLrange(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLrem(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLset(engine *DBEngine, args [][]byte) parser.RespData
- func ExecLtrim(engine *DBEngine, args [][]byte) parser.RespData
- func ExecMget(engine *DBEngine, args [][]byte) parser.RespData
- func ExecMset(engine *DBEngine, args [][]byte) parser.RespData
- func ExecMsetnx(engine *DBEngine, args [][]byte) parser.RespData
- func ExecPersist(engine *DBEngine, args [][]byte) parser.RespData
- func ExecPing(engine *DBEngine, args [][]byte) parser.RespData
- func ExecRename(engine *DBEngine, args [][]byte) parser.RespData
- func ExecRenamenx(engine *DBEngine, args [][]byte) parser.RespData
- func ExecRpop(engine *DBEngine, args [][]byte) parser.RespData
- func ExecRpopLpush(engine *DBEngine, args [][]byte) parser.RespData
- func ExecRpush(engine *DBEngine, args [][]byte) parser.RespData
- func ExecRpushX(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSadd(engine *DBEngine, args [][]byte) parser.RespData
- func ExecScard(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSdiff(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSdiffstore(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSet(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSetbit(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSetex(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSetnx(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSetrange(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSinter(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSinterstore(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSismember(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSmembers(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSmove(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSpop(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSrandmember(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSrem(engine *DBEngine, args [][]byte) parser.RespData
- func ExecStrlen(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSunion(engine *DBEngine, args [][]byte) parser.RespData
- func ExecSunionStore(engine *DBEngine, args [][]byte) parser.RespData
- func ExecTTL(engine *DBEngine, args [][]byte) parser.RespData
- func ExecType(engine *DBEngine, args [][]byte) parser.RespData
- func ForEachBit(src *[]byte, start, end int, f func(offset int, bitval byte) bool)
- func GetBit(src *[]byte, offset int) int
- func GetCompacity(num int) int
- func Grow(src *[]byte, offset int)
- func Inter(sets []*Set) []string
- func RegisterCmd(cmd string, fun CmdFuc)
- func SetBit(src *[]byte, offset int, bitVal int)
- func Union(sets []*Set) []string
- type CmdFuc
- type ConcurrentMap
- func (conmap *ConcurrentMap) Del(key string)
- func (conmap *ConcurrentMap) DelWithLock(key string) bool
- func (conmap *ConcurrentMap) Get(key string) (any, bool)
- func (conmap *ConcurrentMap) GetWithLock(key string) (any, bool)
- func (conmap *ConcurrentMap) Set(key string, value any)
- func (conmap *ConcurrentMap) SetWithLock(key string, value any)
- type DBEngine
- type HashTable
- func (ht *HashTable) ALL() []string
- func (ht *HashTable) Exist(key string) bool
- func (ht *HashTable) Get(key string) string
- func (ht *HashTable) Keys() []string
- func (ht *HashTable) Len() int
- func (ht *HashTable) Remove(key string) bool
- func (ht *HashTable) Set(key, value string) bool
- func (ht *HashTable) Values() []string
- type ItemsLock
- func (lock *ItemsLock) Lock(key string)
- func (lock *ItemsLock) Locks(keys []string)
- func (lock *ItemsLock) RLock(key string)
- func (lock *ItemsLock) RLocks(keys []string)
- func (lock *ItemsLock) RUnLock(key string)
- func (lock *ItemsLock) RUnLocks(keys []string)
- func (lock *ItemsLock) RWLocks(rkeys, wkeys []string)
- func (lock *ItemsLock) RWUnLocks(rkeys, wkeys []string)
- func (lock *ItemsLock) UnLock(key string)
- func (lock *ItemsLock) UnLocks(keys []string)
- type QuickList
- func (ql *QuickList) Find(index int) *iterator
- func (ql *QuickList) First() *iterator
- func (ql *QuickList) ForEach(f func(int, any) bool)
- func (ql *QuickList) GetByIndex(index int) []byte
- func (ql *QuickList) Insert(index int, val any)
- func (ql *QuickList) Len() int
- func (ql *QuickList) PushBack(v any)
- func (ql *QuickList) Range(start, stop int) [][]byte
- func (ql *QuickList) RemoveByCount(val []byte, count int) int
- func (ql *QuickList) RemoveByIndex(index int) []byte
- func (ql *QuickList) Set(index int, val any) bool
- type Set
- type Shard
Constants ¶
View Source
const ( NOEXPIRED = iota EXPIRED NOEXIST )
View Source
const ( SETNON = iota SETNX SETXX )
Variables ¶
View Source
var CmdTable = make(map[string]CmdFuc)
View Source
var PAGESIZE = 1024
Functions ¶
func ForEachBit ¶
func RegisterCmd ¶
Types ¶
type ConcurrentMap ¶
type ConcurrentMap struct {
// contains filtered or unexported fields
}
func NewConcurrentMap ¶
func NewConcurrentMap(shardCount int) *ConcurrentMap
func (*ConcurrentMap) Del ¶
func (conmap *ConcurrentMap) Del(key string)
func (*ConcurrentMap) DelWithLock ¶
func (conmap *ConcurrentMap) DelWithLock(key string) bool
func (*ConcurrentMap) GetWithLock ¶
func (conmap *ConcurrentMap) GetWithLock(key string) (any, bool)
func (*ConcurrentMap) Set ¶
func (conmap *ConcurrentMap) Set(key string, value any)
func (*ConcurrentMap) SetWithLock ¶
func (conmap *ConcurrentMap) SetWithLock(key string, value any)
type DBEngine ¶
type DBEngine struct {
// contains filtered or unexported fields
}
func NewDBEngine ¶
func NewDBEngine() *DBEngine
type HashTable ¶
type HashTable struct {
// contains filtered or unexported fields
}
func NewHashTable ¶
func NewHashTable() *HashTable
type ItemsLock ¶
type ItemsLock struct {
// contains filtered or unexported fields
}
func NewItemsLock ¶
type QuickList ¶
type QuickList struct {
// contains filtered or unexported fields
}
使用快速列表,拥有更好的range,find,add效率和紧凑的内存存储
func (*QuickList) GetByIndex ¶
Click to show internal directories.
Click to hide internal directories.