Documentation ¶
Index ¶
- Variables
- func AsBulkBytes(r Resp, err error) ([]byte, error)
- func AsError(r Resp, err error) ([]byte, error)
- func AsInt(r Resp, err error) (int64, error)
- func AsString(r Resp, err error) ([]byte, 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
- type BulkBytes
- type ClusterRedis
- func (cc *ClusterRedis) Addresses() []string
- func (cc *ClusterRedis) BufioReader() *bufio.Reader
- func (cc *ClusterRedis) BufioWriter() *bufio.Writer
- func (cc *ClusterRedis) Close() error
- func (cc *ClusterRedis) Do(cmd string, args ...interface{}) (interface{}, error)
- func (cc *ClusterRedis) DoWithStringReply(cmd string, args ...interface{}) (string, error)
- func (cc *ClusterRedis) Err() error
- func (cc *ClusterRedis) Flush() error
- func (cc *ClusterRedis) IterateNodes(result func(string, interface{}, error), cmd string, args ...interface{})
- func (cc *ClusterRedis) NewBatcher() common.CmdBatcher
- func (cc *ClusterRedis) Receive() (interface{}, error)
- func (cr *ClusterRedis) ReceiveBool() (bool, error)
- func (cc *ClusterRedis) ReceiveString() (string, error)
- func (cr *ClusterRedis) RedisType() config.RedisType
- func (cc *ClusterRedis) Send(cmd string, args ...interface{}) error
- func (cc *ClusterRedis) SendAndFlush(cmd string, args ...interface{}) error
- func (cc *ClusterRedis) SetBufioReader(rd *bufio.Reader)
- type Decoder
- type Error
- type HandlerFunc
- type HandlerTable
- type Int
- type Redis
- type Resp
- func AsArray(r Resp, err error) ([]Resp, error)
- func ChangeArgsToResp(cmd []byte, args [][]byte) (resp Resp)
- 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 MustDecodeOpt(d *Decoder) (Resp, int64, error)
- func NewCommand(cmd string, args ...interface{}) Resp
- type String
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRespCRLFEnd = errors.Errorf("bad resp CRLF end") ErrBadRespBytesLen = errors.Errorf("bad resp bytes len") ErrBadRespArrayLen = errors.Errorf("bad resp array len") )
View Source
var ( ErrNil = errors.New("nil returned") ErrWrongType = errors.New("wrong type") )
View Source
var (
RecvChanSize = 4096
)
Functions ¶
func EncodeToBytes ¶
func EncodeToString ¶
func MustEncode ¶
func MustEncodeToBytes ¶
func MustHandlerTable ¶
func MustHandlerTable(o interface{}) map[string]HandlerFunc
func NewHandlerTable ¶
func NewHandlerTable(o interface{}) (map[string]HandlerFunc, error)
Types ¶
type ClusterRedis ¶
type ClusterRedis struct {
// contains filtered or unexported fields
}
func (*ClusterRedis) Addresses ¶
func (cc *ClusterRedis) Addresses() []string
func (*ClusterRedis) BufioReader ¶
func (cc *ClusterRedis) BufioReader() *bufio.Reader
func (*ClusterRedis) BufioWriter ¶
func (cc *ClusterRedis) BufioWriter() *bufio.Writer
func (*ClusterRedis) Close ¶
func (cc *ClusterRedis) Close() error
func (*ClusterRedis) Do ¶
func (cc *ClusterRedis) Do(cmd string, args ...interface{}) (interface{}, error)
func (*ClusterRedis) DoWithStringReply ¶
func (cc *ClusterRedis) DoWithStringReply(cmd string, args ...interface{}) (string, error)
func (*ClusterRedis) Err ¶
func (cc *ClusterRedis) Err() error
func (*ClusterRedis) Flush ¶
func (cc *ClusterRedis) Flush() error
send batcher and put the return into recvChan
func (*ClusterRedis) IterateNodes ¶
func (cc *ClusterRedis) IterateNodes(result func(string, interface{}, error), cmd string, args ...interface{})
func (*ClusterRedis) NewBatcher ¶
func (cc *ClusterRedis) NewBatcher() common.CmdBatcher
func (*ClusterRedis) Receive ¶
func (cc *ClusterRedis) Receive() (interface{}, error)
func (*ClusterRedis) ReceiveBool ¶
func (cr *ClusterRedis) ReceiveBool() (bool, error)
func (*ClusterRedis) ReceiveString ¶
func (cc *ClusterRedis) ReceiveString() (string, error)
func (*ClusterRedis) RedisType ¶
func (cr *ClusterRedis) RedisType() config.RedisType
func (*ClusterRedis) Send ¶
func (cc *ClusterRedis) Send(cmd string, args ...interface{}) error
@TODO multi/exec : if slots are crossing, doesn't return error
func (*ClusterRedis) SendAndFlush ¶
func (cc *ClusterRedis) SendAndFlush(cmd string, args ...interface{}) error
func (*ClusterRedis) SetBufioReader ¶
func (cc *ClusterRedis) SetBufioReader(rd *bufio.Reader)
type HandlerFunc ¶
type HandlerTable ¶
type HandlerTable map[string]HandlerFunc
type Redis ¶
type Redis interface { Close() error Do(string, ...interface{}) (interface{}, error) Send(string, ...interface{}) error SendAndFlush(string, ...interface{}) error Receive() (interface{}, error) ReceiveString() (string, error) ReceiveBool() (bool, error) BufioReader() *bufio.Reader BufioWriter() *bufio.Writer Flush() error RedisType() config.RedisType Addresses() []string NewBatcher() common.CmdBatcher // for cluster IterateNodes(result func(string, interface{}, error), cmd string, args ...interface{}) }
Redis interface
func NewRedisCluster ¶
func NewRedisCluster(cfg config.RedisConfig) (Redis, error)
type Resp ¶
type Resp interface { }
func ChangeArgsToResp ¶
func DecodeFromBytes ¶
func MustDecode ¶
func MustDecodeFromBytes ¶
func MustDecodeOpt ¶
return the response and current reading offset
func NewCommand ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.