Versions in this module Expand all Collapse all v1 v1.1.1 Mar 26, 2024 Changes in this version + var ErrProtocol = errors.New("invalid request") + func ParseReply(rd *bufio.Reader) (interface{}, error) + type Cmd func(c *Peer, cmd string, args []string) + type DisconnectHandler func(c *Peer) + type Hook func(*Peer, string, ...string) bool + type Peer struct + ClientName string + Ctx interface{} + Resp3 bool + func NewPeer(w *bufio.Writer) *Peer + func (c *Peer) Block(f func(*Writer)) + func (c *Peer) Close() + func (c *Peer) Closed() bool + func (c *Peer) Flush() + func (c *Peer) OnDisconnect(f func()) + func (c *Peer) WriteBulk(s string) + func (c *Peer) WriteError(e string) + func (c *Peer) WriteFloat(n float64) + func (c *Peer) WriteInline(s string) + func (c *Peer) WriteInt(n int) + func (c *Peer) WriteLen(n int) + func (c *Peer) WriteMapLen(n int) + func (c *Peer) WriteNull() + func (c *Peer) WriteOK() + func (c *Peer) WritePushLen(n int) + func (c *Peer) WriteRaw(s string) + func (c *Peer) WriteSetLen(n int) + func (c *Peer) WriteStrings(strs []string) + type Server struct + func NewServer(addr string) (*Server, error) + func NewServerTLS(addr string, cfg *tls.Config) (*Server, error) + func (s *Server) Addr() *net.TCPAddr + func (s *Server) ClientsLen() int + func (s *Server) Close() + func (s *Server) Dispatch(c *Peer, args []string) + func (s *Server) Register(cmd string, f Cmd) error + func (s *Server) ServeConn(conn net.Conn) + func (s *Server) SetPreHook(h Hook) + func (s *Server) TotalCommands() int + func (s *Server) TotalConnections() int + type Simple string + type Writer struct + func (w *Writer) Flush() + func (w *Writer) WriteBulk(s string) + func (w *Writer) WriteError(e string) + func (w *Writer) WriteFloat(n float64) + func (w *Writer) WriteInline(s string) + func (w *Writer) WriteInt(n int) + func (w *Writer) WriteLen(n int) + func (w *Writer) WriteMapLen(n int) + func (w *Writer) WriteNull() + func (w *Writer) WritePushLen(n int) + func (w *Writer) WriteRaw(s string) + func (w *Writer) WriteSetLen(n int) + func (w *Writer) WriteStrings(strs []string)