Documentation ¶
Index ¶
- func Bool(reply interface{}, err error) (bool, error)
- func ByteSlices(reply interface{}, err error) ([][]byte, error)
- func Bytes(reply interface{}, err error) ([]byte, error)
- func Float64(reply interface{}, err error) (float64, error)
- func Float64s(reply interface{}, err error) ([]float64, error)
- func Int(reply interface{}, err error) (int, error)
- func Int64(reply interface{}, err error) (int64, error)
- func Int64Map(result interface{}, err error) (map[string]int64, error)
- func Int64s(reply interface{}, err error) ([]int64, error)
- func IntMap(result interface{}, err error) (map[string]int, error)
- func Ints(reply interface{}, err error) ([]int, error)
- func Positions(result interface{}, err error) ([]*[2]float64, error)
- func String(reply interface{}, err error) (string, error)
- func StringMap(result interface{}, err error) (map[string]string, error)
- func Strings(reply interface{}, err error) ([]string, error)
- func Struct(result interface{}, err error, v ...interface{}) error
- func Uint64(reply interface{}, err error) (uint64, error)
- func Values(reply interface{}, err error) ([]interface{}, error)
- type Client
- type ClientOptions
- type ContextConn
- type DummyContextConn
- func (dcc DummyContextConn) Close() error
- func (dcc DummyContextConn) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
- func (dcc DummyContextConn) Err() error
- func (dcc DummyContextConn) Flush(ctx context.Context) error
- func (dcc DummyContextConn) Receive(ctx context.Context) (reply interface{}, err error)
- func (dcc DummyContextConn) Send(ctx context.Context, commandName string, args ...interface{}) error
- type FacadeProxy
- func (fp *FacadeProxy) Close() error
- func (fp *FacadeProxy) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
- func (fp *FacadeProxy) Err() (err error)
- func (fp *FacadeProxy) Flush(ctx context.Context) (err error)
- func (fp *FacadeProxy) NextProxy(conn interface{})
- func (fp *FacadeProxy) ProxyName() string
- func (fp *FacadeProxy) Receive(ctx context.Context) (reply interface{}, err error)
- func (fp *FacadeProxy) Send(ctx context.Context, commandName string, args ...interface{}) (err error)
- type FacadeProxyOption
- type FacadeProxyOptions
- type MonitorProxy
- func (mp *MonitorProxy) Close() error
- func (mp *MonitorProxy) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
- func (mp *MonitorProxy) Err() (err error)
- func (mp *MonitorProxy) Flush(ctx context.Context) (err error)
- func (mp *MonitorProxy) NextProxy(conn interface{})
- func (mp *MonitorProxy) ProxyName() string
- func (mp *MonitorProxy) Receive(ctx context.Context) (reply interface{}, err error)
- func (mp *MonitorProxy) Send(ctx context.Context, commandName string, args ...interface{}) (err error)
- type MonitorProxyOption
- type MonitorProxyOptions
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteSlices ¶
refer redis.ByteSlices.
Types ¶
type Client ¶ added in v0.0.5
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetCtxRedisConn ¶ added in v0.0.5
func (c *Client) GetCtxRedisConn() ContextConn
Recommended.
func (*Client) GetRedisConn ¶ added in v0.0.5
type ClientOptions ¶ added in v0.0.5
type ClientOptions struct{}
func (ClientOptions) WithConf ¶ added in v0.0.5
func (ClientOptions) WithConf(conf config.Config) Option
func (ClientOptions) WithLogger ¶ added in v0.0.5
func (ClientOptions) WithLogger(logger elog.Logger) Option
func (ClientOptions) WithProxy ¶ added in v0.0.5
func (ClientOptions) WithProxy(proxyConn ...func() interface{}) Option
func (ClientOptions) WithStateTicker ¶ added in v0.0.5
func (ClientOptions) WithStateTicker(stateTicker time.Duration) Option
type ContextConn ¶
type ContextConn interface { // Close closes the connection. Close() error // Err returns a non-nil value when the connection is not usable. Err() error // Do sends a command to the server and returns the received reply. Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error) // Send writes the command to the client's output buffer. Send(ctx context.Context, commandName string, args ...interface{}) error // Flush flushes the output buffer to the Redis server. Flush(ctx context.Context) error // Receive receives a single reply from the Redis server Receive(ctx context.Context) (reply interface{}, err error) }
CtxConn redefine redis.Conn, Implemented by *redis.Conn..
type DummyContextConn ¶ added in v0.1.2
type DummyContextConn struct{}
func (DummyContextConn) Close ¶ added in v0.1.2
func (dcc DummyContextConn) Close() error
func (DummyContextConn) Do ¶ added in v0.1.2
func (dcc DummyContextConn) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
func (DummyContextConn) Err ¶ added in v0.1.2
func (dcc DummyContextConn) Err() error
func (DummyContextConn) Flush ¶ added in v0.1.2
func (dcc DummyContextConn) Flush(ctx context.Context) error
type FacadeProxy ¶
type FacadeProxy struct {
// contains filtered or unexported fields
}
FacadeProxy implement ContextConn interface, but nextConn is redis.Conn.
func NewFacadeProxy ¶
func NewFacadeProxy(options ...FacadeProxyOption) *FacadeProxy
func (*FacadeProxy) Close ¶
func (fp *FacadeProxy) Close() error
func (*FacadeProxy) Do ¶
func (fp *FacadeProxy) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
func (*FacadeProxy) Err ¶
func (fp *FacadeProxy) Err() (err error)
func (*FacadeProxy) NextProxy ¶
func (fp *FacadeProxy) NextProxy(conn interface{})
Implement Proxy interface.
func (*FacadeProxy) ProxyName ¶
func (fp *FacadeProxy) ProxyName() string
Implement Proxy interface.
type FacadeProxyOption ¶
type FacadeProxyOption func(c *FacadeProxy)
type FacadeProxyOptions ¶
type FacadeProxyOptions struct{}
type MonitorProxy ¶ added in v0.0.9
type MonitorProxy struct {
// contains filtered or unexported fields
}
func NewMonitorProxy ¶
func NewMonitorProxy(options ...MonitorProxyOption) *MonitorProxy
func (*MonitorProxy) Close ¶ added in v0.0.9
func (mp *MonitorProxy) Close() error
func (*MonitorProxy) Do ¶ added in v0.0.9
func (mp *MonitorProxy) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
func (*MonitorProxy) Err ¶ added in v0.0.9
func (mp *MonitorProxy) Err() (err error)
func (*MonitorProxy) Flush ¶ added in v0.0.9
func (mp *MonitorProxy) Flush(ctx context.Context) (err error)
func (*MonitorProxy) NextProxy ¶ added in v0.0.9
func (mp *MonitorProxy) NextProxy(conn interface{})
Implement Proxy interface.
func (*MonitorProxy) ProxyName ¶ added in v0.0.9
func (mp *MonitorProxy) ProxyName() string
Implement Proxy interface.
type MonitorProxyOption ¶
type MonitorProxyOption func(c *MonitorProxy)
type MonitorProxyOptions ¶
type MonitorProxyOptions struct{}
func (MonitorProxyOptions) WithConf ¶
func (MonitorProxyOptions) WithConf(conf config.Config) MonitorProxyOption
func (MonitorProxyOptions) WithLogger ¶
func (MonitorProxyOptions) WithLogger(logger log.Logger) MonitorProxyOption
func (MonitorProxyOptions) WithTracer ¶
func (MonitorProxyOptions) WithTracer(tracer opentracing2.Tracer) MonitorProxyOption
Click to show internal directories.
Click to hide internal directories.