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 NewMonitorProxy(options ...MonitorProxyOption) *monitorProxy
- func NewSpyProxy(logger log.Logger, name string) *spyProxy
- func NewStubsProxy(logger log.Logger, name string) *stubsProxy
- 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 ExecRedisInfo
- 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 MonitorProxyOption
- type MonitorProxyOptions
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteSlices ¶
refer redis.ByteSlices
func NewMonitorProxy ¶
func NewMonitorProxy(options ...MonitorProxyOption) *monitorProxy
func NewSpyProxy ¶
func NewStubsProxy ¶
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
使用原生redisgo
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 ExecRedisInfo ¶ added in v0.0.5
type ExecRedisInfo struct {
// contains filtered or unexported fields
}
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
type FacadeProxyOption ¶
type FacadeProxyOption func(c *FacadeProxy)
type FacadeProxyOptions ¶
type FacadeProxyOptions struct{}
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.