Documentation ¶
Index ¶
- func Auth(c common.Connection, redisArgs [][]byte) protocol.Reply
- func BGRewriteAOF(engine *Engine) protocol.Reply
- func DiscardMulti(c common.Connection) protocol.Reply
- func EnqueueCmd(c common.Connection, redisCommand [][]byte) protocol.Reply
- func ExecMulti(db *DB, conn common.Connection, args [][]byte) protocol.Reply
- func GetRelatedKeys(redisCommand [][]byte) ([]string, []string)
- func Ping(redisArgs [][]byte) protocol.Reply
- func StartMulti(c common.Connection) protocol.Reply
- func UnWatch(db *DB, conn common.Connection) protocol.Reply
- func Watch(db *DB, conn common.Connection, args [][]byte) protocol.Reply
- type CmdLine
- type DB
- func (db *DB) Exec(c common.Connection, redisCommand [][]byte) protocol.Reply
- func (db *DB) ExpireAt(key string, expireTime time.Time)
- func (db *DB) ExpireTime(key string) int64
- func (db *DB) GetEntity(key string) (*payload.DataEntity, bool)
- func (db *DB) GetUndoLog(cmdLine [][]byte) []CmdLine
- func (db *DB) GetVersion(key string) int64
- func (db *DB) IsExpire(key string) bool
- func (db *DB) IsPersist(key string) bool
- func (db *DB) PExpireTime(key string) int64
- func (db *DB) PTTL(key string) int64
- func (db *DB) Persist(key string)
- func (db *DB) PutEntity(key string, entity *payload.DataEntity) int
- func (db *DB) PutIfAbsent(key string, entity *payload.DataEntity) int
- func (db *DB) PutIfExist(key string, entity *payload.DataEntity) int
- func (db *DB) RWLock(readKeys, writeKeys []string)
- func (db *DB) RWUnLock(readKeys, writeKeys []string)
- func (db *DB) Remove(key string)
- func (db *DB) Removes(keys ...string) int64
- func (db *DB) SetIndex(index int)
- func (db *DB) TTL(key string) int64
- type Engine
- func (e *Engine) Close()
- func (e *Engine) Exec(c common.Connection, redisCommand [][]byte) (result protocol.Reply)
- func (e *Engine) ExecWithLock(dbIndex int, redisCommand [][]byte) protocol.Reply
- func (e *Engine) ForEach(dbIndex int, ...)
- func (e *Engine) GetUndoLogs(dbIndex int, redisCommand [][]byte) []CmdLine
- func (e *Engine) RWLocks(dbIndex int, readKeys, writeKeys []string)
- func (e *Engine) RWUnLocks(dbIndex int, readKeys, writeKeys []string)
- type ExecFunc
- type KeysFunc
- type UndoFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnqueueCmd ¶
func EnqueueCmd(c common.Connection, redisCommand [][]byte) protocol.Reply
入队:保证命令在格式正确&& 存在的情况下入队
func GetRelatedKeys ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) GetEntity ¶
func (db *DB) GetEntity(key string) (*payload.DataEntity, bool)
************* Data Access ************** 获取内存中的数据
func (*DB) GetVersion ¶
************** Version **************
func (*DB) PutEntity ¶
func (db *DB) PutEntity(key string, entity *payload.DataEntity) int
保存数据到内存中 (插入 or 更新)
func (*DB) PutIfAbsent ¶
func (db *DB) PutIfAbsent(key string, entity *payload.DataEntity) int
保存数据到内存中 (插入 )
func (*DB) PutIfExist ¶
func (db *DB) PutIfExist(key string, entity *payload.DataEntity) int
保存数据到内存中 (更新)
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
存储引擎,负责数据的CRUD
func (*Engine) ExecWithLock ¶
func (*Engine) ForEach ¶
func (e *Engine) ForEach(dbIndex int, cb func(key string, data *payload.DataEntity, expiration *time.Time) bool)
遍历引擎的所有数据
func (*Engine) GetUndoLogs ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.