Documentation ¶
Index ¶
- Variables
- func Close() (err error)
- func Decr(ctx context.Context, key string) bool
- func Del(ctx context.Context, key string) int64
- func DelWithErr(ctx context.Context, key string) (int64, error)
- func Exists(ctx context.Context, key string) bool
- func ExistsWithErr(ctx context.Context, key string) (bool, error)
- func Expire(ctx context.Context, key string, expiration time.Duration) (res bool, err error)
- func GeoAdd(ctx context.Context, key string, location *redis.GeoLocation) (res int64, err error)
- func GeoRadius(ctx context.Context, key string, longitude, latitude float64, ...) (res []redis.GeoLocation, err error)
- func Get(ctx context.Context, key string) string
- func GetRaw(ctx context.Context, key string) (bts []byte, err error)
- func HDel(ctx context.Context, key string, field ...string) bool
- func HGet(ctx context.Context, key string, fields string) (string, error)
- func HGetAll(ctx context.Context, key string) map[string]string
- func HIncrBy(ctx context.Context, key string, field string, incr int)
- func HKeys(ctx context.Context, key string) []string
- func HLen(ctx context.Context, key string) int64
- func HMGet(ctx context.Context, key string, fileds []string) []string
- func HMGetMap(ctx context.Context, key string, fields []string) map[string]string
- func HMSet(ctx context.Context, key string, hash map[string]interface{}, ...) bool
- func HSet(ctx context.Context, key string, field string, value interface{}) bool
- func Incr(ctx context.Context, key string) bool
- func IncrBy(ctx context.Context, key string, increment int64) (int64, error)
- func IncrWithErr(ctx context.Context, key string) (int64, error)
- func Init(ctx context.Context, option *Options) (err error)
- func LIndex(ctx context.Context, key string, idx int64) (string, error)
- func LLen(ctx context.Context, key string) int64
- func LLenWithErr(ctx context.Context, key string) (int64, error)
- func LPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func LRange(ctx context.Context, key string, start, stop int64) (res []string, err error)
- func LRem(ctx context.Context, key string, count int64, value interface{}) int64
- func LTrim(ctx context.Context, key string, start, stop int64) (string, error)
- func MGet(ctx context.Context, keys ...string) ([]string, error)
- func MGets(ctx context.Context, keys []string) (ret []interface{}, err error)
- func RPop(ctx context.Context, key string) (string, error)
- func RPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func SAdd(ctx context.Context, key string, member ...interface{}) (int64, error)
- func SIsMember(ctx context.Context, key string, member interface{}) (bool, error)
- func SMembers(ctx context.Context, key string) ([]string, error)
- func Set(ctx context.Context, key string, value interface{}, expire time.Duration) bool
- func SetNx(ctx context.Context, key string, value interface{}, expiration time.Duration) bool
- func SetNxWithErr(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
- func SetWithErr(ctx context.Context, key string, value interface{}, expire time.Duration) error
- func Type(ctx context.Context, key string) (string, error)
- func ZAdd(ctx context.Context, key string, members ...*redis.Z) (int64, error)
- func ZCount(ctx context.Context, key string, min, max string) (int64, error)
- func ZRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func ZRem(ctx context.Context, key string, members ...interface{}) (res int64, err error)
- func ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (res int64, err error)
- func ZRevRange(ctx context.Context, key string, start, stop int64) ([]string, error)
- func ZRevRangeByScore(ctx context.Context, key string, opt *redis.ZRangeBy) (res []string, err error)
- func ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *redis.ZRangeBy) (res []redis.Z, err error)
- func ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]redis.Z, error)
- func ZRevRank(ctx context.Context, key string, member string) (int64, error)
- func ZScore(ctx context.Context, key string, member string) (float64, error)
- type Cluster
- type Option
- func Addr(addr string) Option
- func ClusterAddrs(clusterAddrs string) Option
- func Db(db int) Option
- func Master(master string) Option
- func MaxRetries(maxRetries int) Option
- func MinIdleConns(minIdleConns int) Option
- func Mode(mode string) Option
- func Network(network string) Option
- func Password(password string) Option
- func PoolSize(poolSize int) Option
- func SentinelAddrs(sentinelAddrs string) Option
- type Options
- type Pool
- type Sentinel
- type Single
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Client *r.Client ClusterClient *r.ClusterClient )
Functions ¶
func Close ¶
func Close() (err error)
Close closes the client, releasing any open resources.
It is rare to Close a Client, as the Client is meant to be long-lived and shared between many goroutines.
func ExistsWithErr ¶
ExistsWithErr ...
func GeoRadius ¶
func GeoRadius(ctx context.Context, key string, longitude, latitude float64, query *redis.GeoRadiusQuery) (res []redis.GeoLocation, err error)
GeoRadius 根据经纬度查询列表
func SetNxWithErr ¶
func SetNxWithErr(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
SetNxWithErr 设置redis的string 如果键已存在
func SetWithErr ¶
SetWithErr ...
func ZRemRangeByRank ¶
ZRemRangeByRank 移除有序集合中给定的排名区间的所有成员
func ZRevRangeByScore ¶
func ZRevRangeByScore(ctx context.Context, key string, opt *redis.ZRangeBy) (res []string, err error)
ZRevRangeByScore ...
func ZRevRangeByScoreWithScores ¶
func ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *redis.ZRangeBy) (res []redis.Z, err error)
ZRevRangeByScoreWithScores ...
func ZRevRangeWithScores ¶
ZRevRangeWithScores ...
Types ¶
type Cluster ¶
type Cluster struct { ClusterAddrs string `json:"metric"` // contains filtered or unexported fields }
type Option ¶
type Option func(*Options)
func ClusterAddrs ¶
func MaxRetries ¶
func MinIdleConns ¶
func SentinelAddrs ¶
type Options ¶
type Options struct { Mode string `json:"mode"` //single,sentinel,cluster Password string `json:"password"` DB int `json:"db"` Timeout int `json:"timeout"` MaxRetries int `json:"maxRetries"` Single Single `json:"single"` Sentinel Sentinel `json:"sentinel"` Cluster Cluster `json:"cluster"` Pool Pool `json:"pool"` }
func NewOptions ¶
Click to show internal directories.
Click to hide internal directories.