Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProtocol = errors.New("invalid request")
ErrProtocol is the general error for unexpected input
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { Ctx interface{} // anything goes, server won't touch this // contains filtered or unexported fields }
Peer is a client connected to the server
func (*Peer) Close ¶
func (c *Peer) Close()
Close the client connection after the current command is done.
func (*Peer) Flush ¶
func (c *Peer) Flush()
Flush the write buffer. Called automatically after every redis command
func (*Peer) WriteInline ¶
WriteInline writes a redis inline string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a simple redis server
func (*Server) ClientsLen ¶
ClientsLen gives the number of connected clients right now
func (*Server) Close ¶
func (s *Server) Close()
Close a server started with NewServer. It will wait until all clients are closed.
func (*Server) Register ¶
Register a command. It can't have been registered before. Safe to call on a running server.
func (*Server) TotalCommands ¶
TotalCommands is total (known) commands since this the server started
func (*Server) TotalConnections ¶
TotalConnections give the number of clients connected since the server started, including the currently connected ones