Documentation ¶
Index ¶
- type Client
- func (c *Client) Close() (err error)
- func (c *Client) Decr(key string) bool
- func (c *Client) Del(key string) int64
- func (c *Client) DelWithErr(key string) (int64, error)
- func (c *Client) Exists(key string) bool
- func (c *Client) ExistsWithErr(key string) (bool, error)
- func (c *Client) Expire(key string, expiration time.Duration) (bool, error)
- func (c *Client) GeoAdd(key string, location *redis.GeoLocation) (int64, error)
- func (c *Client) GeoRadius(key string, longitude, latitude float64, query *redis.GeoRadiusQuery) ([]redis.GeoLocation, error)
- func (c *Client) Get(key string) string
- func (c *Client) GetRaw(key string) ([]byte, error)
- func (c *Client) HDel(key string, field ...string) bool
- func (c *Client) HGet(key string, fields string) (string, error)
- func (c *Client) HGetAll(key string) map[string]string
- func (c *Client) HIncrBy(key string, field string, incr int)
- func (c *Client) HKeys(key string) []string
- func (c *Client) HLen(key string) int64
- func (c *Client) HMGet(key string, fileds []string) []string
- func (c *Client) HMGetMap(key string, fields []string) map[string]string
- func (c *Client) HMSet(key string, hash map[string]interface{}, expire time.Duration) bool
- func (c *Client) HSet(key string, field string, value interface{}) bool
- func (c *Client) Incr(key string) bool
- func (c *Client) IncrBy(key string, increment int64) (int64, error)
- func (c *Client) IncrWithErr(key string) (int64, error)
- func (c *Client) LIndex(key string, idx int64) (string, error)
- func (c *Client) LLen(key string) int64
- func (c *Client) LLenWithErr(key string) (int64, error)
- func (c *Client) LPush(key string, values ...interface{}) (int64, error)
- func (c *Client) LRange(key string, start, stop int64) ([]string, error)
- func (c *Client) LRem(key string, count int64, value interface{}) int64
- func (c *Client) LTrim(key string, start, stop int64) (string, error)
- func (c *Client) MGet(keys ...string) ([]string, error)
- func (c *Client) MGets(keys []string) ([]interface{}, error)
- func (c *Client) RPop(key string) (string, error)
- func (c *Client) RPush(key string, values ...interface{}) (int64, error)
- func (c *Client) SAdd(key string, member ...interface{}) (int64, error)
- func (c *Client) SIsMember(key string, member interface{}) (bool, error)
- func (c *Client) SMembers(key string) ([]string, error)
- func (c *Client) Set(key string, value interface{}, expire time.Duration) bool
- func (c *Client) SetNx(key string, value interface{}, expiration time.Duration) bool
- func (c *Client) SetNxWithErr(key string, value interface{}, expiration time.Duration) (bool, error)
- func (c *Client) SetWithErr(key string, value interface{}, expire time.Duration) error
- func (c *Client) Type(key string) (string, error)
- func (c *Client) WithContext(ctx context.Context) *Client
- func (c *Client) ZAdd(key string, members ...redis.Z) (int64, error)
- func (c *Client) ZCard(key string) (int64, error)
- func (c *Client) ZCount(key string, min, max string) (int64, error)
- func (c *Client) ZRange(key string, start, stop int64) ([]string, error)
- func (c *Client) ZRem(key string, members ...interface{}) (int64, error)
- func (c *Client) ZRemRangeByRank(key string, start, stop int64) (int64, error)
- func (c *Client) ZRevRange(key string, start, stop int64) ([]string, error)
- func (c *Client) ZRevRangeByScore(key string, opt redis.ZRangeBy) ([]string, error)
- func (c *Client) ZRevRangeByScoreWithScores(key string, opt redis.ZRangeBy) ([]redis.Z, error)
- func (c *Client) ZRevRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
- func (c *Client) ZRevRank(key string, member string) (int64, error)
- func (c *Client) ZScore(key string, member string) (float64, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GeoRadius ¶
func (c *Client) GeoRadius(key string, longitude, latitude float64, query *redis.GeoRadiusQuery) ([]redis.GeoLocation, error)
func (*Client) SetNxWithErr ¶
func (*Client) SetWithErr ¶
func (*Client) ZRemRangeByRank ¶
func (*Client) ZRevRangeByScore ¶
func (*Client) ZRevRangeByScoreWithScores ¶
func (*Client) ZRevRangeWithScores ¶
type Config ¶
type Config struct { Address string `json:"address" yaml:"address"` //redis地址 DB int `json:"db" yaml:"db"` //redis逻辑数据库 PoolSize int `json:"poolSize" yaml:"poolSize"` //redis连接池 MaxRetries int `json:"maxRetries" yaml:"maxRetries" ` //redis最大重试数目 MinIdleConns int `json:"minIdleConns" yaml:"minIdleConns"` //最小空闲数 Password string `json:"password" yaml:"password"` //密码 DialTimeout time.Duration `json:"dialTimeout" yaml:"dialTimeout"` //连接超时 单位:秒 IdleTimeout time.Duration `json:"idleTimeout" yaml:"idleTimeout"` //空闲超时 单位:秒 ReadTimeout time.Duration `json:"readTimeout" yaml:"readTimeout"` //读取超时 单位:秒 WriteTimeout time.Duration `json:"writeTimeout" yaml:"writeTimeout"` //写超时 单位:秒 Debug bool `json:"debug" yaml:"debug"` //是否打印调试日志 DisableMetric bool `json:"disableMetric" yaml:"disableMetric"` //是否进行监控 DisableTrace bool `json:"disableTrace" yaml:"disableTrace"` //是否进行链路追踪 SlowThreshold time.Duration `json:"slowThreshold" yaml:"slowThreshold"` //慢日志阈值 单位:毫秒 }
func DefaultConfig ¶
func DefaultConfig() Config
Click to show internal directories.
Click to hide internal directories.