Documentation
¶
Index ¶
- Constants
- func IsBadConn(err error, allowTimeout bool) bool
- func IsLoadingError(err error) bool
- func IsMovedError(err error) (moved bool, ask bool, addr string)
- func IsReadOnlyError(err error) bool
- func IsRedisError(err error) bool
- func IsRetryableError(err error, retryTimeout bool) bool
- type Client
- func (c *Client) DecrBy(ctx context.Context, key string, by int64) (int64, error)
- func (c *Client) Del(ctx context.Context, keys ...string) error
- func (c *Client) Expire(ctx context.Context, key string, ttl int32) error
- func (c *Client) Get(ctx context.Context, key string) (item *Item, err error)
- func (c *Client) IncrBy(ctx context.Context, key string, by int64) (i int64, err error)
- func (c *Client) MGet(ctx context.Context, keys []string) (items map[string]*Item, err error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) PoolStats() *pool.Stats
- func (c *Client) Set(ctx context.Context, item *Item) error
- func (c *Client) Stats() *pool.Stats
- func (c *Client) TTL(ctx context.Context, key string) (ttl int32, err error)
- func (c *Client) ZAdd(ctx context.Context, item *Item) (added int64, err error)
- func (c *Client) ZCard(ctx context.Context, key string) (card int64, err error)
- func (c *Client) ZCount(ctx context.Context, key, min, max string) (i int64, err error)
- func (c *Client) ZIncrBy(ctx context.Context, key, member string, by float64) error
- func (c *Client) ZRange(ctx context.Context, key string, start, stop int64) (values []*ZSetValue, err error)
- func (c *Client) ZRank(ctx context.Context, key, member string) (rank int64, err error)
- func (c *Client) ZRem(ctx context.Context, keys ...string) error
- func (c *Client) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (i int64, err error)
- func (c *Client) ZRemRangeByScore(ctx context.Context, key, min, max string) (i int64, err error)
- func (c *Client) ZRevRange(ctx context.Context, key string, start, stop int64) (values []*ZSetValue, err error)
- func (c *Client) ZRevRank(ctx context.Context, key, member string) (rank int64, err error)
- func (c *Client) ZScore(ctx context.Context, key, member string) (score float64, err error)
- type Item
- type Options
- type ZSetValue
Constants ¶
View Source
const ( FlagNX = 1 << 0 FlagXX = 1 << 1 FlagCH = 1 << 2 )
View Source
const Nil = protocol.Nil
Variables ¶
This section is empty.
Functions ¶
func IsLoadingError ¶
func IsReadOnlyError ¶
func IsRedisError ¶
func IsRetryableError ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ZRemRangeByRank ¶
func (*Client) ZRemRangeByScore ¶
type Options ¶
type Options struct {
Address string
// 连接池大小
PoolSize int
// 最小空闲连接数
MinIdleConns int
// 一个连接的超时时间
// 防止过多的链接导致Redis崩溃
MaxConnAge time.Duration
// 链接池获取的超时时间
PoolTimeout time.Duration
// 空闲链接的超时时间
IdleTimeout time.Duration
// 超时空闲连接的清理间隔时间
IdleCheckFrequency time.Duration
OnPreCmd func(context.Context, []interface{}) context.Context
OnPostCmd func(context.Context, error)
}
Click to show internal directories.
Click to hide internal directories.