redis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(reply interface{}, err error) (bool, error)

refer redis.Bool

func ByteSlices

func ByteSlices(reply interface{}, err error) ([][]byte, error)

refer redis.ByteSlices

func Bytes

func Bytes(reply interface{}, err error) ([]byte, error)

refer redis.Bytes

func Float64

func Float64(reply interface{}, err error) (float64, error)

refer redis.Float64

func Float64s

func Float64s(reply interface{}, err error) ([]float64, error)

refer redis.Float64s

func Int

func Int(reply interface{}, err error) (int, error)

refer redis.Int

func Int64

func Int64(reply interface{}, err error) (int64, error)

refer redis.Int64

func Int64Map

func Int64Map(result interface{}, err error) (map[string]int64, error)

refer redis.IntMap

func Int64s

func Int64s(reply interface{}, err error) ([]int64, error)

refer redis.Int64s

func IntMap

func IntMap(result interface{}, err error) (map[string]int, error)

refer redis.IntMap

func Ints

func Ints(reply interface{}, err error) ([]int, error)

refer redis.Ints

func NewMonitorProxy

func NewMonitorProxy(options ...MonitorProxyOption) *monitorProxy

func NewSpyProxy

func NewSpyProxy(logger log.Logger, name string) *spyProxy

func NewStubsProxy

func NewStubsProxy(logger log.Logger, name string) *stubsProxy

func Positions

func Positions(result interface{}, err error) ([]*[2]float64, error)

refer redis.Positions

func String

func String(reply interface{}, err error) (string, error)

refer redis.String

func StringMap

func StringMap(result interface{}, err error) (map[string]string, error)

refer redis.StringMap

func Strings

func Strings(reply interface{}, err error) ([]string, error)

refer redis.Strings

func Struct

func Struct(result interface{}, err error, v ...interface{}) error

func Uint64

func Uint64(reply interface{}, err error) (uint64, error)

refer redis.Uint64

func Values

func Values(reply interface{}, err error) ([]interface{}, error)

refer redis.Values

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) Flush

func (this *FacadeProxy) Flush(ctx context.Context) (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

func (*FacadeProxy) Receive

func (this *FacadeProxy) Receive(ctx context.Context) (reply interface{}, err error)

func (*FacadeProxy) Send

func (this *FacadeProxy) Send(ctx context.Context, commandName string, args ...interface{}) (err error)

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) WithLogger

func (MonitorProxyOptions) WithTracer

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) GetRedisConn

func (this *RedisClient) GetRedisConn() redis.Conn

使用原生redisgo

func (*RedisClient) Ping

func (this *RedisClient) Ping() error

func (*RedisClient) Stats

func (this *RedisClient) Stats()

type RedisClientOptions

type RedisClientOptions struct{}

func (RedisClientOptions) WithConf

func (RedisClientOptions) WithConf(conf config.Config) Option

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
}

Jump to

Keyboard shortcuts

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