Documentation
¶
Index ¶
Constants ¶
View Source
const MaxSlotNum = models.DEFAULT_SLOT_NUM
slot数量最大值
Variables ¶
View Source
var ( ErrBadRespType = errors.New("bad resp type for command") ErrBadOpStrLen = errors.New("bad command length, too short or too long") )
View Source
var ErrFailedRequest = errors.New("discard failed request")
View Source
var ErrRespIsRequired = errors.New("resp is required")
View Source
var ErrSlotIsNotReady = errors.New("slot is not ready, may be offline")
Functions ¶
Types ¶
type BackendConn ¶
type BackendConn struct {
// contains filtered or unexported fields
}
和后端redis的连接
func (*BackendConn) Addr ¶
func (bc *BackendConn) Addr() string
type FlushPolicy ¶
type FlushPolicy struct {
*redis.Encoder // 相当于 writer
MaxBuffered int
MaxInterval int64
// contains filtered or unexported fields
}
刷新策略
type OpStats ¶
type OpStats struct {
// contains filtered or unexported fields
}
操作统计信息
func (*OpStats) MarshalJSON ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
type Session ¶
type Session struct {
*redis.Conn // 和redis客户端之间的连接
Ops int64
LastOpUnix int64
CreateUnix int64
// contains filtered or unexported fields
}
与redis客户端会话
func NewSessionSize ¶
返回一个redis-client的连接对象
func (*Session) Serve ¶
func (s *Session) Serve(d Dispatcher, maxPipeline int)
针对一个redis-client连接的处理函数
type SharedBackendConn ¶
type SharedBackendConn struct {
// contains filtered or unexported fields
}
连接复用对象
func NewSharedBackendConn ¶
func NewSharedBackendConn(addr, auth string) *SharedBackendConn
创建连接复用对象
func (*SharedBackendConn) Close ¶
func (s *SharedBackendConn) Close() bool
func (*SharedBackendConn) IncrRefcnt ¶
func (s *SharedBackendConn) IncrRefcnt()
Click to show internal directories.
Click to hide internal directories.