Documentation ¶
Index ¶
- Constants
- Variables
- func TTLmsToExpireAt(ttlms int64) (int64, bool)
- type CtxKey
- type OnAccept
- type OnClosed
- type RespCmdConn
- type RespCmdService
- func (s *RespCmdService) AddRespCmdConn(c driver.IRespConn)
- func (s *RespCmdService) Close() (err error)
- func (s *RespCmdService) CloseAllRespCmdConnect()
- func (s *RespCmdService) DelRespCmdConn(c driver.IRespConn)
- func (s *RespCmdService) InfoCmd(conn redcon.Conn, cmd redcon.Command)
- func (s *RespCmdService) InitRespConn(ctx context.Context, dbIdx int) driver.IRespConn
- func (s *RespCmdService) Name() driver.RespServiceName
- func (s *RespCmdService) OnAccept(conn redcon.Conn) bool
- func (s *RespCmdService) OnClosed(conn redcon.Conn, err error)
- func (s *RespCmdService) PublishCmd(conn redcon.Conn, cmd redcon.Command)
- func (s *RespCmdService) QuitCmd(conn redcon.Conn, cmd redcon.Command)
- func (s *RespCmdService) RegisterRespCmdConnHandle()
- func (s *RespCmdService) RespCmdConnectNum() int
- func (s *RespCmdService) SetOnAccept(onAccept OnAccept)
- func (s *RespCmdService) SetOnClosed(onClosed OnClosed)
- func (s *RespCmdService) SetRegisteredCmdHandles(handles map[string]driver.CmdHandle)
- func (s *RespCmdService) SetSrvInfo(info driver.ISrvInfo)
- func (s *RespCmdService) SetStorager(store driver.IStorager)
- func (s *RespCmdService) Start(ctx context.Context) (err error)
- func (s *RespCmdService) SubscribeCmd(conn redcon.Conn, cmd redcon.Command)
- type SrvInfo
- func (m *SrvInfo) DumpBytes(name driver.DumpSrvInfoName) []byte
- func (m *SrvInfo) DumpGCStats(w io.Writer)
- func (m *SrvInfo) DumpKeySpace(w io.Writer)
- func (m *SrvInfo) DumpKeySpaceNoStats(w io.Writer)
- func (m *SrvInfo) DumpMemory(w io.Writer)
- func (m *SrvInfo) DumpPairs(w io.Writer, pairs ...driver.InfoPair)
- func (m *SrvInfo) DumpServer(w io.Writer)
- func (m *SrvInfo) DumpStorageStats(w io.Writer)
Constants ¶
View Source
const ( PONG = redcon.SimpleString("PONG") OK = redcon.SimpleString("OK") NOKEY = redcon.SimpleString("NOKEY") )
View Source
const ( GB uint64 = 1024 * 1024 * 1024 MB uint64 = 1024 * 1024 KB uint64 = 1024 )
Variables ¶
View Source
var ( ErrNoops = errors.New(":)") ErrNoInitRespConn = errors.New("not init resp conn") ErrNotAuthenticated = errors.New("ERR not authenticated") ErrAuthenticationFailure = errors.New("ERR authentication failure") ErrCmdParams = errors.New("ERR wrong number of arguments") ErrValue = errors.New("ERR value is not an integer or out of range") ErrSyntax = errors.New("ERR syntax error") ErrProtocalVer = errors.New("ERR Protocol version is not an integer or out of range") ErrUnsupportVer = errors.New("NOPROTO unsupported protocol version") ErrNOPwd = errors.New("ERR Client sent AUTH, but no password is set") ErrInvalidPwd = errors.New("ERR invalid password") )
View Source
var (
Delims = []byte("\r\n")
)
Functions ¶
func TTLmsToExpireAt ¶
Types ¶
type RespCmdConn ¶
type RespCmdConn struct { *driver.RespConnBase redcon.Conn // contains filtered or unexported fields }
func (*RespCmdConn) Close ¶
func (c *RespCmdConn) Close() error
func (*RespCmdConn) Closed ¶
func (c *RespCmdConn) Closed() bool
func (*RespCmdConn) GetRemoteAddr ¶
func (c *RespCmdConn) GetRemoteAddr() string
func (*RespCmdConn) SetRedConn ¶
func (c *RespCmdConn) SetRedConn(redConn redcon.Conn)
type RespCmdService ¶
type RespCmdService struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts *config.RespCmdServiceOptions) (srv *RespCmdService)
func (*RespCmdService) AddRespCmdConn ¶
func (s *RespCmdService) AddRespCmdConn(c driver.IRespConn)
func (*RespCmdService) Close ¶
func (s *RespCmdService) Close() (err error)
func (*RespCmdService) CloseAllRespCmdConnect ¶
func (s *RespCmdService) CloseAllRespCmdConnect()
func (*RespCmdService) DelRespCmdConn ¶
func (s *RespCmdService) DelRespCmdConn(c driver.IRespConn)
func (*RespCmdService) InfoCmd ¶
func (s *RespCmdService) InfoCmd(conn redcon.Conn, cmd redcon.Command)
InfoCmd srv info to dump
func (*RespCmdService) InitRespConn ¶
func (*RespCmdService) Name ¶
func (s *RespCmdService) Name() driver.RespServiceName
func (*RespCmdService) PublishCmd ¶
func (s *RespCmdService) PublishCmd(conn redcon.Conn, cmd redcon.Command)
PublishCmd pub to all pub/sub subscribers and return the number of messages that were sent.
func (*RespCmdService) QuitCmd ¶
func (s *RespCmdService) QuitCmd(conn redcon.Conn, cmd redcon.Command)
QuitCmd connect is closed by srv
func (*RespCmdService) RegisterRespCmdConnHandle ¶
func (s *RespCmdService) RegisterRespCmdConnHandle()
func (*RespCmdService) RespCmdConnectNum ¶
func (s *RespCmdService) RespCmdConnectNum() int
func (*RespCmdService) SetOnAccept ¶
func (s *RespCmdService) SetOnAccept(onAccept OnAccept)
func (*RespCmdService) SetOnClosed ¶
func (s *RespCmdService) SetOnClosed(onClosed OnClosed)
func (*RespCmdService) SetRegisteredCmdHandles ¶
func (s *RespCmdService) SetRegisteredCmdHandles(handles map[string]driver.CmdHandle)
func (*RespCmdService) SetSrvInfo ¶
func (s *RespCmdService) SetSrvInfo(info driver.ISrvInfo)
func (*RespCmdService) SetStorager ¶
func (s *RespCmdService) SetStorager(store driver.IStorager)
func (*RespCmdService) SubscribeCmd ¶
func (s *RespCmdService) SubscribeCmd(conn redcon.Conn, cmd redcon.Command)
Subscribe sub from a pub/sub channel. The `Psubscribe` and `Subscribe` operations will detach the connection from the event handler and manage all network I/O for this connection in the background.
type SrvInfo ¶
type SrvInfo struct {
// contains filtered or unexported fields
}
func NewSrvInfo ¶
func NewSrvInfo(srv *RespCmdService) (srvInfo *SrvInfo)
func (*SrvInfo) DumpGCStats ¶
func (*SrvInfo) DumpKeySpace ¶
# Keyspace db0:keys=1,expires=0,avg_ttl=0
func (*SrvInfo) DumpKeySpaceNoStats ¶
func (*SrvInfo) DumpMemory ¶
func (*SrvInfo) DumpServer ¶
func (*SrvInfo) DumpStorageStats ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.