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 ContextConn
- type FacadeProxy
- func (this *FacadeProxy) Close() error
- func (this *FacadeProxy) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
- func (this *FacadeProxy) Err() (err error)
- func (this *FacadeProxy) Flush(ctx context.Context) (err error)
- func (this *FacadeProxy) NextProxy(conn interface{})
- func (this *FacadeProxy) ProxyName() string
- func (this *FacadeProxy) Receive(ctx context.Context) (reply interface{}, err error)
- func (this *FacadeProxy) Send(ctx context.Context, commandName string, args ...interface{}) (err error)
- type FacadeProxyOption
- type FacadeProxyOptions
- type MonitorProxyOption
- type MonitorProxyOptions
- type Option
- type RedisClient
- type RedisClientOptions
- type RedisExecInfo
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 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 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 (this *FacadeProxy) Close() error
func (*FacadeProxy) Do ¶
func (this *FacadeProxy) Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error)
func (*FacadeProxy) Err ¶
func (this *FacadeProxy) Err() (err error)
func (*FacadeProxy) NextProxy ¶
func (this *FacadeProxy) NextProxy(conn interface{})
implement Proxy interface
func (*FacadeProxy) ProxyName ¶
func (this *FacadeProxy) ProxyName() string
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(log log.Logger) MonitorProxyOption
func (MonitorProxyOptions) WithTracer ¶
func (MonitorProxyOptions) WithTracer(tracer opentracing2.Tracer) MonitorProxyOption
type Option ¶
type Option func(c *RedisClient)
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
func NewRedisClient ¶
func NewRedisClient(options ...Option) *RedisClient
func (*RedisClient) Close ¶
func (this *RedisClient) Close()
func (*RedisClient) GetCtxRedisConn ¶
func (this *RedisClient) GetCtxRedisConn() ContextConn
Recommended
func (*RedisClient) Ping ¶
func (this *RedisClient) Ping() error
func (*RedisClient) Stats ¶
func (this *RedisClient) Stats()
type RedisClientOptions ¶
type RedisClientOptions struct{}
func (RedisClientOptions) WithLogger ¶
func (RedisClientOptions) WithLogger(logger elog.Logger) Option
func (RedisClientOptions) WithProxy ¶
func (RedisClientOptions) WithProxy(proxyConn ...func() interface{}) Option
func (RedisClientOptions) WithStateTicker ¶
func (RedisClientOptions) WithStateTicker(stateTicker time.Duration) Option
type RedisExecInfo ¶
type RedisExecInfo struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.