Documentation ¶
Index ¶
- func DefaultDialOpts() []redis.DialOption
- type Client
- func (c *Client) Bool(fn ExecuteFunc) (bool, error)
- func (c *Client) ByteSlices(fn ExecuteFunc) ([][]byte, error)
- func (c *Client) Bytes(fn ExecuteFunc) ([]byte, error)
- func (c *Client) Close() error
- func (c *Client) Execute(fn ExecuteFunc) (res interface{}, err error)
- func (c *Client) Float64(fn ExecuteFunc) (float64, error)
- func (c *Client) Float64s(fn ExecuteFunc) ([]float64, error)
- func (c *Client) Int(fn ExecuteFunc) (int, error)
- func (c *Client) Int64(fn ExecuteFunc) (int64, error)
- func (c *Client) Int64Map(fn ExecuteFunc) (map[string]int64, error)
- func (c *Client) Int64s(fn ExecuteFunc) ([]int64, error)
- func (c *Client) IntMap(fn ExecuteFunc) (map[string]int, error)
- func (c *Client) Ints(fn ExecuteFunc) ([]int, error)
- func (c *Client) Mode() string
- func (c *Client) MustExec(fun ExecuteFunc) interface{}
- func (c *Client) Positions(fn ExecuteFunc) ([]*[2]float64, error)
- func (c *Client) String(fn ExecuteFunc) (string, error)
- func (c *Client) StringMap(fn ExecuteFunc) (map[string]string, error)
- func (c *Client) Strings(fn ExecuteFunc) ([]string, error)
- func (c *Client) Subscribe(fn SubscribeFunc) error
- func (c *Client) Uint64(fn ExecuteFunc) (uint64, error)
- func (c *Client) Values(fn ExecuteFunc) ([]interface{}, error)
- type ExecuteFunc
- type ModeInterface
- type PoolOption
- func DefaultPoolOpts() []PoolOption
- func IdleTimeout(value time.Duration) PoolOption
- func MaxActive(value int) PoolOption
- func MaxConnLifetime(value time.Duration) PoolOption
- func MaxIdle(value int) PoolOption
- func TestOnBorrow(value func(c redis.Conn, t time.Time) (err error)) PoolOption
- func Wait(value bool) PoolOption
- type SubscribeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(mode ModeInterface) *Client
func (*Client) ByteSlices ¶
func (c *Client) ByteSlices(fn ExecuteFunc) ([][]byte, error)
func (*Client) Execute ¶
func (c *Client) Execute(fn ExecuteFunc) (res interface{}, err error)
func (*Client) Mode ¶
Mode 当前客户端使用模式 alone 单机或者代理入口模式 cluster Redis-Cluster集群模式 sentinel Redis-Sentinel哨兵模式
func (*Client) MustExec ¶ added in v2.0.3
func (c *Client) MustExec(fun ExecuteFunc) interface{}
func (*Client) Subscribe ¶
func (c *Client) Subscribe(fn SubscribeFunc) error
func (*Client) Values ¶
func (c *Client) Values(fn ExecuteFunc) ([]interface{}, error)
type ExecuteFunc ¶
ExecuteFunc 普通回调函数
type ModeInterface ¶
type PoolOption ¶
PoolOption 连接池配置函数
func MaxConnLifetime ¶
func MaxConnLifetime(value time.Duration) PoolOption
MaxConnLifetime 连接生命周期, 超过后关闭连接
func TestOnBorrow ¶
TestOnBorrow 健康检查, 检测连接是否可用
Click to show internal directories.
Click to hide internal directories.