Documentation
¶
Index ¶
- type CodisPool
- type Pool
- func (p *Pool) BLPop(timeoutMS int, keys ...interface{}) ([]string, error)
- func (p *Pool) BRPop(timeoutSeconds int, keys ...interface{}) ([]string, error)
- func (p *Pool) BRPopLPush(source, dest string, timeoutSeconds int) (string, error)
- func (p *Pool) BitCount(key string, queryOpt ...interface{}) (int, error)
- func (p *Pool) BitOp(op, dest string, keys ...string) (int, error)
- func (p *Pool) BitPos(key string, bit int, pos ...int) (int, error)
- func (p *Pool) Close()
- func (p *Pool) Decr(key string) (int, error)
- func (p *Pool) DecrBy(key string, value int) (int, error)
- func (p *Pool) Del(keys ...string) (int, error)
- func (p *Pool) Do(command string, args ...interface{}) (interface{}, error)
- func (p *Pool) Exists(keys ...string) (int, error)
- func (p *Pool) Expire(key string, seconds int) (bool, error)
- func (p *Pool) GeoAdd(key string, geoLocationAndKey ...interface{}) (int, error)
- func (p *Pool) GeoDist(key string, member1, member2, unit string) (float64, error)
- func (p *Pool) GeoHash(key string, members ...string) ([]string, error)
- func (p *Pool) GeoPos(key string, members ...string) ([]string, error)
- func (p *Pool) GeoRadius(key string, longitude, latitude float64, radius int, unit string) ([]string, error)
- func (p *Pool) GeoRadiusByMember(key, member string, queryOpt ...interface{}) ([]string, error)
- func (p *Pool) GeoRadiusWithCoord(key string, longitude float64, latitude float64, radius int, unit string, ...) ([][]string, error)
- func (p *Pool) GeoRadiusWithDist(key string, longitude float64, latitude float64, radius int, unit string, ...) ([][]string, error)
- func (p *Pool) Get(key string) (string, error)
- func (p *Pool) GetBit(key string, offset int) (int, error)
- func (p *Pool) HDel(key string, fields ...string) (int, error)
- func (p *Pool) HExists(key, field string) (bool, error)
- func (p *Pool) HGet(key, field string) (string, error)
- func (p *Pool) HGetAll(key string) (map[string]string, error)
- func (p *Pool) HIncrBy(key, field string, incr int) (int, error)
- func (p *Pool) HIncrByFloat(key, field string, incr float64) (float64, error)
- func (p *Pool) HKeys(key string) ([]string, error)
- func (p *Pool) HLen(key string) (int, error)
- func (p *Pool) HMGet(key string, fields ...string) ([]string, error)
- func (p *Pool) HMSet(key string, fields map[string]interface{}) (string, error)
- func (p *Pool) HSet(key, field string, value interface{}) (bool, error)
- func (p *Pool) HSetNX(key, field string, value interface{}) (string, error)
- func (p *Pool) HVals(key string) ([]string, error)
- func (p *Pool) Incr(key string) (int, error)
- func (p *Pool) IncrBy(key string, value int) (int, error)
- func (p *Pool) LIndex(key string, index int) (string, error)
- func (p *Pool) LInsert(key, op string, pivot, value interface{}) (int, error)
- func (p *Pool) LInsertAfter(key string, pivot, value interface{}) (int, error)
- func (p *Pool) LInsertBefore(key string, pivot, value interface{}) (int, error)
- func (p *Pool) LLen(key string) (int, error)
- func (p *Pool) LPop(key string) (string, error)
- func (p *Pool) LPush(key string, values ...interface{}) (int, error)
- func (p *Pool) LPushX(key string, value interface{}) (int, error)
- func (p *Pool) LRange(key string, start, stop int) ([]string, error)
- func (p *Pool) LRem(key string, count int, value interface{}) (int, error)
- func (p *Pool) LSet(key string, index int, value interface{}) (string, error)
- func (p *Pool) LTrim(key string, start, stop int64) (string, error)
- func (p *Pool) MGet(keys ...interface{}) ([]string, error)
- func (p *Pool) MSet(pairs map[string]interface{}) (status string, err error)
- func (p *Pool) RPop(key string) (string, error)
- func (p *Pool) RPopLPush(source, dest string) (string, error)
- func (p *Pool) RPush(key string, values ...interface{}) (int, error)
- func (p *Pool) RPushX(key string, value interface{}) (int, error)
- func (p *Pool) SAdd(key string, members ...interface{}) (int, error)
- func (p *Pool) SCard(key string) (int, error)
- func (p *Pool) SDiff(keys ...interface{}) ([]string, error)
- func (p *Pool) SDiffStore(dest string, keys ...string) (int, error)
- func (p *Pool) SInter(keys ...interface{}) ([]string, error)
- func (p *Pool) SInterStore(dest string, keys ...string) (int, error)
- func (p *Pool) SIsMember(key string, member interface{}) (bool, error)
- func (p *Pool) SMembers(key string) ([]string, error)
- func (p *Pool) SMove(source, dest string, member interface{}) (bool, error)
- func (p *Pool) SPop(key string) (string, error)
- func (p *Pool) SPopN(key string, count int) ([]string, error)
- func (p *Pool) SRandMember(key string) (string, error)
- func (p *Pool) SRandMemberN(key string, count int) ([]string, error)
- func (p *Pool) SRem(key string, members ...interface{}) (int, error)
- func (p *Pool) SUnion(keys ...interface{}) ([]string, error)
- func (p *Pool) SUnionStore(dest string, keys ...string) (int, error)
- func (p *Pool) Set(key, value string) (string, error)
- func (p *Pool) SetBit(key string, offset int, bit int) (int, error)
- func (p *Pool) SetEx(key string, expire int, value string) (string, error)
- func (p *Pool) SetNX(key string, value interface{}, seconds int) (string, error)
- func (p *Pool) TTL(key string) (seconds int, err error)
- func (p *Pool) ZAdd(key string, members ...interface{}) (int, error)
- func (p *Pool) ZCard(key string) (int, error)
- func (p *Pool) ZCount(key, min, max string) (int, error)
- func (p *Pool) ZIncr(key string, members ...interface{}) (int, error)
- func (p *Pool) ZIncrBy(key string, increment float64, members ...interface{}) (float64, error)
- func (p *Pool) ZInterStore(dest string, keys ...string) (int, error)
- func (p *Pool) ZLexCount(key, min, max string) (int, error)
- func (p *Pool) ZRange(key string, start, stop int) ([]string, error)
- func (p *Pool) ZRangeByScore(key string, start, stop interface{}) ([]string, error)
- func (p *Pool) ZRangeByScoreWithScores(key string, start, stop interface{}) ([]string, error)
- func (p *Pool) ZRangeWithScores(key string, start, stop int) ([]string, error)
- func (p *Pool) ZRank(key, member string) (int, error)
- func (p *Pool) ZRem(key string, members ...string) (int, error)
- func (p *Pool) ZRemRangeByLex(key, min, max string) (int, error)
- func (p *Pool) ZRemRangeByRank(key string, start, stop int) (int, error)
- func (p *Pool) ZRemRangeByScore(key, min, max interface{}) (int, error)
- func (p *Pool) ZRevRange(key string, start, stop int) ([]string, error)
- func (p *Pool) ZRevRangeByScore(key string, limitOpt ...interface{}) ([]string, error)
- func (p *Pool) ZRevRangeWithScores(key string, start, stop int) ([]string, error)
- func (p *Pool) ZRevRank(key, member string) (int, error)
- func (p *Pool) ZScore(key, member string) (float64, error)
- func (p *Pool) ZUnionStore(dest string, keys ...string) (int, error)
- type PoolInterface
- type Setting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
func InitRedisCluster ¶
func InitRedisPool ¶
InitRedisPool 通过此方法初始化,不需要关注底层是redis cluster还是codis等
func InitRedisSentinel ¶
func (*Pool) BRPopLPush ¶
func (*Pool) GeoAdd ¶
GeoAdd 示例:GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"
func (*Pool) GeoRadius ¶
func (p *Pool) GeoRadius(key string, longitude, latitude float64, radius int, unit string) ([]string, error)
GeoRadius 以给定的经纬度为中心, 返回键包含的位置成员当中, 与中心的距离不超过给定最大距离的所有位置元素 示例:GEORADIUS Sicily 15 37 200 km WITHDIST
func (*Pool) GeoRadiusByMember ¶
GeoRadiusByMember 以给定的成员为中心, 返回键包含的位置元素当中,与中心的距离不超过给定最大距离的所有位置元素 示例:GEORADIUSBYMEMBER Sicily Agrigento 100 km
func (*Pool) GeoRadiusWithCoord ¶
func (*Pool) GeoRadiusWithDist ¶
func (*Pool) HIncrByFloat ¶
func (*Pool) LInsertAfter ¶
func (*Pool) LInsertBefore ¶
func (*Pool) MSet ¶
MSet client.MSet([]interface{}{"test_1", "value1", "test_2", "value2"}...) return "OK", nil
func (*Pool) ZRangeByScore ¶
ZRangeByScore 正常是双闭区间,可以传start = (1, stop= (5 控制为开区间,即 1< score < 5
func (*Pool) ZRangeByScoreWithScores ¶
func (*Pool) ZRangeWithScores ¶
func (*Pool) ZRemRangeByRank ¶
func (*Pool) ZRemRangeByScore ¶
func (*Pool) ZRevRangeByScore ¶
func (*Pool) ZRevRangeWithScores ¶
type PoolInterface ¶
type Setting ¶
type Setting struct { Name string `mapstructure:"name"` // redis类型,包括redis,sentinel,cluster,codis四种 Type string `mapstructure:"type"` Addr []string `mapstructure:"addr"` // 密码 Password string `mapstructure:"passwd"` // 数据库,默认0 Db int `mapstructure:"db"` // 用于codis连接 ZkHost []string `mapstructure:"zk_host"` // 用于codis连接 ZkPath string `mapstructure:"zk_path"` // 最大连接数量 MaxPoolSize int `mapstructure:"max_pool_size"` // 最大空闲连接数量,超过这个数值的空闲连接将会被关闭 MaxIdle int `mapstructure:"max_idle"` // 空闲时间,超过这个时间的空闲连接将会被关闭 IdleTimeout time.Duration `mapstructure:"idle_timeout"` // 连接等待时间 ConnectTimeout time.Duration `mapstructure:"connect_timeout"` // 读写等待时间 DoWithTimeout time.Duration `mapstructure:"do_with_timeout"` }
Click to show internal directories.
Click to hide internal directories.