redis

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPingClosed = errs.New("ping interface has been closed")
	ErrBadPong    = errs.New("pong response payload is bad")
)

errors

View Source
var (
	ErrBadAssert  = errs.New("bad assert for redis")
	ErrBadCount   = errs.New("bad count number")
	ErrBadRequest = errs.New("bad request")
)

errors

View Source
var (
	// ErrNodeConnClosed err node conn closed.
	ErrNodeConnClosed = errs.New("redis node conn closed")
)

Functions

func NewNodeConn

func NewNodeConn(cluster, addr string, dialTimeout, readTimeout, writeTimeout time.Duration) (nc proto.NodeConn)

NewNodeConn create the node conn from proxy to redis

func NewPinger added in v1.3.2

func NewPinger(conn *libnet.Conn) proto.Pinger

NewPinger new pinger.

func NewProxyConn

func NewProxyConn(conn *libnet.Conn) proto.ProxyConn

NewProxyConn creates new redis Encoder and Decoder.

Types

type NodeConn added in v1.4.0

type NodeConn = nodeConn

NodeConn is export type by nodeConn for redis-cluster.

func (*NodeConn) Bw added in v1.4.0

func (nc *NodeConn) Bw() *bufio.Writer

Bw return bufio.Writer.

type ProxyConn added in v1.4.0

type ProxyConn = proxyConn

ProxyConn is export for redis cluster.

func (*ProxyConn) Bw added in v1.4.0

func (pc *ProxyConn) Bw() *bufio.Writer

Bw return proxyConn Writer.

type RESP added in v1.4.0

type RESP = resp

RESP is resp export type.

func (*RESP) Array added in v1.4.0

func (r *RESP) Array() []*RESP

Array return resp array.

func (*RESP) Data added in v1.4.0

func (r *RESP) Data() []byte

Data return resp data.

func (*RESP) Decode added in v1.4.0

func (r *RESP) Decode(br *bufio.Reader) (err error)

Decode decode by Reader.

func (*RESP) Encode added in v1.4.0

func (r *RESP) Encode(w *bufio.Writer) (err error)

Encode encode into Writer.

func (*RESP) Type added in v1.4.0

func (r *RESP) Type() byte

Type return resp type.

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request is the type of a complete redis command

func (*Request) Cmd

func (r *Request) Cmd() []byte

Cmd get the cmd

func (*Request) CmdString

func (r *Request) CmdString() string

CmdString get the cmd

func (*Request) IsCtl added in v1.4.0

func (r *Request) IsCtl() bool

IsCtl is control command.

func (*Request) IsSupport added in v1.4.0

func (r *Request) IsSupport() bool

IsSupport check command support.

func (*Request) Key

func (r *Request) Key() []byte

Key impl the proto.protoRequest and get the Key of redis

func (*Request) Put

func (r *Request) Put()

Put the resource back to pool

func (*Request) RESP added in v1.4.0

func (r *Request) RESP() *RESP

RESP return request resp.

func (*Request) Reply added in v1.4.0

func (r *Request) Reply() *RESP

Reply return request reply.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL