Versions in this module Expand all Collapse all v0 v0.1.0 Jun 23, 2026 Changes in this version + const DefaultMaxBulkLen + const MaxInlineLen + const MaxMultibulkLen + var ErrNeedMore = errors.New("need more data") + var ReplyEmptyArray = []byte("*0\r\n") + var ReplyEmptyMap3 = []byte("%0\r\n") + var ReplyEmptySet3 = []byte("~0\r\n") + var ReplyFalse3 = []byte("#f\r\n") + var ReplyMaxClients = []byte("-ERR max number of clients reached\r\n") + var ReplyNil2 = []byte("$-1\r\n") + var ReplyNil3 = []byte("_\r\n") + var ReplyNilArray2 = []byte("*-1\r\n") + var ReplyOK = []byte("+OK\r\n") + var ReplyOne = []byte(":1\r\n") + var ReplyPong = []byte("+PONG\r\n") + var ReplyQueued = []byte("+QUEUED\r\n") + var ReplyReset = []byte("+RESET\r\n") + var ReplyTrue3 = []byte("#t\r\n") + var ReplyZero = []byte(":0\r\n") + func FormatDouble(f float64) string + func ParseInline(buf []byte, pos int) ([][]byte, int, error) + func ParseRequest(buf []byte, pos int, maxBulkLen int64) ([][]byte, int, error) + type Encoder struct + func NewEncoder(w Writer, proto int) *Encoder + func (e *Encoder) BeginStreamedBulkString() + func (e *Encoder) EndStreamedBulkString() + func (e *Encoder) Proto() int + func (e *Encoder) SetProto(proto int) + func (e *Encoder) WriteArrayLen(n int) + func (e *Encoder) WriteAttributeLen(n int) + func (e *Encoder) WriteBigNumber(n *big.Int) + func (e *Encoder) WriteBool(b bool) + func (e *Encoder) WriteBulkError(errStr string) + func (e *Encoder) WriteBulkString(data []byte) + func (e *Encoder) WriteBulkStringStr(s string) + func (e *Encoder) WriteChunk(data []byte) + func (e *Encoder) WriteDouble(f float64) + func (e *Encoder) WriteError(errStr string) + func (e *Encoder) WriteInteger(n int64) + func (e *Encoder) WriteMapLen(n int) + func (e *Encoder) WriteNull() + func (e *Encoder) WriteNullArray() + func (e *Encoder) WritePushLen(n int) + func (e *Encoder) WriteRaw(p []byte) + func (e *Encoder) WriteSetLen(n int) + func (e *Encoder) WriteStatus(s string) + func (e *Encoder) WriteVerbatimString(enc string, data []byte) + type ProtocolError struct + Msg string + func ErrProtocol(msg string) ProtocolError + func (e ProtocolError) Error() string + type RESPType int + const TypeArray + const TypeAttribute + const TypeBigNumber + const TypeBool + const TypeBulkError + const TypeBulkString + const TypeDouble + const TypeError + const TypeInteger + const TypeMap + const TypeNull + const TypePush + const TypeSet + const TypeSimpleString + const TypeVerbatim + type RESPValue struct + AttrBody *RESPValue + Attrs [][2]RESPValue + BigInt *big.Int + Bool bool + Elems []RESPValue + Err string + Float float64 + Integer int64 + IsNull bool + Map [][2]RESPValue + Str []byte + Type RESPType + VerbEnc string + func Decode(buf []byte, pos int) (RESPValue, int, error) + type Writer interface + Write func(p []byte) (int, error) + WriteByte func(b byte) error + WriteString func(s string) (int, error)