Documentation ¶
Index ¶
- Variables
- func SendBulk(w *bufio.Writer, val []byte) error
- func SendBulkString(w *bufio.Writer, str string) error
- func SendBulkStrings(w *bufio.Writer, strs []string) error
- func SendBulks(w *bufio.Writer, vals [][]byte) error
- func SendError(w *bufio.Writer, msg string) error
- func SendInt(w *bufio.Writer, val int64) error
- func SendObjects(w *bufio.Writer, vals []interface{}) error
- func SendString(w *bufio.Writer, msg string) error
- type Command
- type Parser
- type ProtocolError
- type Writer
- func (w *Writer) Flush() error
- func (w *Writer) Write(data []byte) (int, error)
- func (w *Writer) WriteBulk(val []byte) error
- func (w *Writer) WriteBulkString(s string) error
- func (w *Writer) WriteBulkStrings(bulks []string) error
- func (w *Writer) WriteBulks(bulks ...[]byte) error
- func (w *Writer) WriteBulksSlice(args [][]byte) error
- func (w *Writer) WriteError(s string) error
- func (w *Writer) WriteInt(val int64) error
- func (w *Writer) WriteObjects(objs ...interface{}) error
- func (w *Writer) WriteObjectsSlice(args []interface{}) error
- func (w *Writer) WriteSimpleString(s string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ExpectNumber = &ProtocolError{"Expect Number"} ExpectNewLine = &ProtocolError{"Expect Newline"} ExpectTypeChar = &ProtocolError{"Expect TypeChar"} ErrInvalidNumArg = errors.New("TooManyArg") ErrInvalidBulkSize = errors.New("invalid bulk size") ErrLineTooLong = errors.New("LineTooLong") ReadBufferInitSize = 1 << 16 MaxNumArg = 20 MaxBulkSize = 1 << 16 MaxTelnetLine = 1 << 10 )
Functions ¶
func SendObjects ¶
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ReadCommand ¶
type ProtocolError ¶
type ProtocolError struct {
// contains filtered or unexported fields
}
func (*ProtocolError) Error ¶
func (p *ProtocolError) Error() string
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) WriteBulkString ¶
func (*Writer) WriteBulkStrings ¶
func (*Writer) WriteBulks ¶
func (*Writer) WriteBulksSlice ¶
WriteBulksSlice ...
func (*Writer) WriteError ¶
func (*Writer) WriteObjects ¶
func (*Writer) WriteObjectsSlice ¶
WriteObjectsSlice works like WriteObjects, it useful when args is a slice that can be nil, in that case WriteObjects(nil) will understand as response 1 element array (nil element) see https://github.com/secmask/radishproto/issues/4 for details.
func (*Writer) WriteSimpleString ¶
Click to show internal directories.
Click to hide internal directories.