Versions in this module Expand all Collapse all v1 v1.1.1 Oct 13, 2016 Changes in this version + var ErrBadRespArrayLen = errors.New("bad resp array len") + var ErrBadRespBytesLen = errors.New("bad resp bytes len") + var ErrBadRespCRLFEnd = errors.New("bad resp CRLF end") + func AsBulkBytes(r Resp, err error) ([]byte, error) + func AsError(r Resp, err error) (string, error) + func AsInt(r Resp, err error) (int64, error) + func AsString(r Resp, err error) (string, error) + func Encode(w *bufio.Writer, r Resp, flush bool) error + func EncodeToBytes(r Resp) ([]byte, error) + func EncodeToString(r Resp) (string, error) + func MustEncode(w *bufio.Writer, r Resp) + func MustEncodeToBytes(r Resp) []byte + func MustHandlerTable(o interface{}) map[string]HandlerFunc + func NewHandlerTable(o interface{}) (map[string]HandlerFunc, error) + func ParseArgs(resp Resp) (cmd string, args [][]byte, err error) + type Array struct + Value []Resp + func NewArray() *Array + func (r *Array) Append(a Resp) + func (r *Array) AppendBulkBytes(b []byte) + func (r *Array) AppendError(err error) + func (r *Array) AppendInt(n int64) + func (r *Array) AppendString(s string) + type BulkBytes struct + Value []byte + func NewBulkBytes(p []byte) *BulkBytes + type Error struct + Value string + func NewError(err error) *Error + type HandlerFunc func(arg0 interface{}, args ...[]byte) (Resp, error) + type HandlerTable map[string]HandlerFunc + type Int struct + Value int64 + func NewInt(n int64) *Int + type Resp interface + func AsArray(r Resp, err error) ([]Resp, error) + func Decode(r *bufio.Reader) (Resp, error) + func DecodeFromBytes(p []byte) (Resp, error) + func MustDecode(r *bufio.Reader) Resp + func MustDecodeFromBytes(p []byte) Resp + func NewCommand(cmd string, args ...interface{}) Resp + type Server struct + func MustServer(o interface{}) *Server + func NewServer(o interface{}) (*Server, error) + func NewServerWithTable(t HandlerTable) (*Server, error) + func (s *Server) Dispatch(arg0 interface{}, resp Resp) (Resp, error) + type String struct + Value string + func NewString(s string) *String