redis

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 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 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 Client added in v0.0.5

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

func NewClient added in v0.0.5

func NewClient(options ...Option) *Client

func (*Client) Close added in v0.0.5

func (c *Client) Close() error

func (*Client) GetCtxRedisConn added in v0.0.5

func (c *Client) GetCtxRedisConn() ContextConn

Recommended.

func (*Client) GetRedisConn added in v0.0.5

func (c *Client) GetRedisConn() redis.Conn

func (*Client) Ping added in v0.0.5

func (c *Client) Ping() error

func (*Client) Stats added in v0.0.5

func (c *Client) Stats()

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

func (DummyContextConn) Receive added in v0.1.2

func (dcc DummyContextConn) Receive(ctx context.Context) (reply interface{}, err error)

func (DummyContextConn) Send added in v0.1.2

func (dcc DummyContextConn) Send(ctx context.Context, commandName string,
	args ...interface{}) 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) Flush

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

func (*FacadeProxy) Receive

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

func (*FacadeProxy) Send

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

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.

func (*MonitorProxy) Receive added in v0.0.9

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

func (*MonitorProxy) Send added in v0.0.9

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

type MonitorProxyOption

type MonitorProxyOption func(c *MonitorProxy)

type MonitorProxyOptions

type MonitorProxyOptions struct{}

func (MonitorProxyOptions) WithConf

func (MonitorProxyOptions) WithLogger

func (MonitorProxyOptions) WithLogger(logger log.Logger) MonitorProxyOption

func (MonitorProxyOptions) WithTracer

type Option

type Option func(c *Client)

Jump to

Keyboard shortcuts

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