Documentation ¶
Index ¶
- Constants
- Variables
- func Btoi64(b []byte) (int64, error)
- func Encode(w io.Writer, r *Message) error
- func EncodeToBytes(r *Message) ([]byte, error)
- type Decoder
- type Encoder
- type Message
- func Decode(r io.Reader) (*Message, error)
- func DecodeFromBytes(p []byte) (*Message, error)
- func DecodeMultiBulkFromBytes(p []byte) ([]*Message, error)
- func NewArray(array []*Message) *Message
- func NewBulkBytes(value []byte) *Message
- func NewError(value []byte) *Message
- func NewErrorf(format string, args ...interface{}) *Message
- func NewInt(value []byte) *Message
- func NewString(value []byte) *Message
- type MsgType
Constants ¶
View Source
const ( MaxBulkBytesLen = 1024 * 1024 * 512 MaxArrayLen = 1024 * 1024 )
Variables ¶
View Source
var ( ErrBadCRLFEnd = errors.New("bad CRLF end") ErrBadArrayLen = errors.New("bad array len") ErrBadArrayLenTooLong = errors.New("bad array len, too long") ErrBadBulkBytesLen = errors.New("bad bulk bytes len") ErrBadBulkBytesLenTooLong = errors.New("bad bulk bytes len, too long") ErrBadMultiBulkLen = errors.New("bad multi-bulk len") ErrBadMultiBulkContent = errors.New("bad multi-bulk content, should be bulkbytes") ErrFailedDecoder = errors.New("use of failed decoder") )
View Source
var ErrFailedEncoder = errors.New("use of failed encoder")
Functions ¶
func EncodeToBytes ¶
Types ¶
type Decoder ¶
type Decoder struct { Err error // contains filtered or unexported fields }
func NewDecoder ¶
func NewDecoderBuffer ¶
func (*Decoder) DecodeMultiBulk ¶
type Encoder ¶
type Encoder struct { Err error // contains filtered or unexported fields }
func NewEncoder ¶
func NewEncoderBuffer ¶
func (*Encoder) EncodeMultiBulk ¶
type Message ¶
func DecodeFromBytes ¶
func NewBulkBytes ¶
func (*Message) IsBulkBytes ¶
Click to show internal directories.
Click to hide internal directories.