Documentation ¶
Index ¶
- Variables
- func Concurrency(fns []Fn, maxIdle int64) error
- func GetRedisStats() []*redisStat
- type Fn
- type HashStore
- type HashZSetStore
- type KVHashStore
- type KVStore
- type ListStore
- type Redis
- func (r *Redis) BLPop(key string, timeout int) (interface{}, error)
- func (r *Redis) BRPop(key string, timeout int) (interface{}, error)
- func (r *Redis) BRPopLPush(srcKey string, destKey string, timeout int) (interface{}, error)
- func (r *Redis) Bool(reply interface{}, err error) (bool, error)
- func (r *Redis) Bytes(reply interface{}, err error) ([]byte, error)
- func (r *Redis) Del(keys ...string) (int64, error)
- func (r *Redis) Eval(luaScript string, numberKeys int, keysArgs ...interface{}) (interface{}, error)
- func (r *Redis) EvalSha(sha1 string, numberKeys int, keysArgs ...interface{}) (interface{}, error)
- func (r *Redis) Exists(key string) (bool, error)
- func (r *Redis) Expire(key string, duration int64) (int64, error)
- func (r *Redis) ExpireAt(key string, timestamp int64) (int64, error)
- func (r *Redis) Float64(reply interface{}, err error) (float64, error)
- func (r *Redis) GeoAdd(key string, longitude, latitude float64, name string) error
- func (r *Redis) GeoPos(key string, member string) (*redis.GeoPos, error)
- func (r *Redis) GeoRadius(key string, longitude, latitude float64, radius float64, count int) ([]redis.GeoLocation, error)
- func (r *Redis) GeoRadiusByMember(key string, member string, radius float64, count int) ([]redis.GeoLocation, error)
- func (r *Redis) Get(key string) (interface{}, error)
- func (r *Redis) GetBit(key string, offset int64) (int64, error)
- func (r *Redis) GetSet(key string, value interface{}) (interface{}, error)
- func (r *Redis) HClear(key string) error
- func (r *Redis) HDel(key string, fields ...string) (int64, error)
- func (r *Redis) HExpire(key string, duration int64) error
- func (r *Redis) HGet(key string, field string) (interface{}, error)
- func (r *Redis) HGetAll(key string) (map[string]interface{}, error)
- func (r *Redis) HIncrBy(key, field string, delta int64) (int64, error)
- func (r *Redis) HKeys(key string) ([]string, error)
- func (r *Redis) HLen(key string) (int64, error)
- func (r *Redis) HMGet(key string, fields ...string) (interface{}, error)
- func (r *Redis) HMSet(key string, kvs ...interface{}) error
- func (r *Redis) HSet(key string, field string, val interface{}) error
- func (r *Redis) HVals(key string) ([]interface{}, error)
- func (r *Redis) Incr(key string) (int64, error)
- func (r *Redis) IncrBy(key string, delta int64) (int64, error)
- func (r *Redis) Int(reply interface{}, err error) (int, error)
- func (r *Redis) Int64(reply interface{}, err error) (int64, error)
- func (r *Redis) LLen(key string) (int64, error)
- func (r *Redis) LPop(key string) (interface{}, error)
- func (r *Redis) LPush(key string, value ...interface{}) error
- func (r *Redis) LRange(key string, start, stop int64) (interface{}, error)
- func (r *Redis) LRem(key string, count int, value interface{}) (int, error)
- func (r *Redis) LSet(key string, index int, value interface{}) error
- func (r *Redis) MGet(keys ...string) ([]interface{}, error)
- func (r *Redis) MSet(kvs map[string]interface{}) error
- func (r *Redis) MSetNX(kvs map[string]interface{}) (bool, error)
- func (r *Redis) RPop(key string) (interface{}, error)
- func (r *Redis) RPopLPush(srcKey string, destKey string) (interface{}, error)
- func (r *Redis) RPush(key string, value ...interface{}) error
- func (r *Redis) SAdd(key string, members ...interface{}) (int64, error)
- func (r *Redis) SIsMember(key string, member interface{}) (bool, error)
- func (r *Redis) SMembers(key string) ([]string, error)
- func (r *Redis) SPop(key string) ([]byte, error)
- func (r *Redis) SRem(key string, members ...interface{}) (int64, error)
- func (r *Redis) ScriptLoad(luaScript string) (interface{}, error)
- func (r *Redis) Set(key string, value interface{}) error
- func (r *Redis) SetBit(key string, offset uint32, value int) (int, error)
- func (r *Redis) SetEx(key string, value interface{}, timeout int64) error
- func (r *Redis) SetMaxActive(maxActive int)
- func (r *Redis) SetMaxIdle(maxIdle int)
- func (r *Redis) SetNx(key string, value interface{}) (int64, error)
- func (r *Redis) SetNxEx(key string, value interface{}, timeout int64) error
- func (r *Redis) String(reply interface{}, err error) (string, error)
- func (r *Redis) Strings(reply interface{}, err error) ([]string, error)
- func (r *Redis) TTl(key string) (int64, error)
- func (r *Redis) Uint64(reply interface{}, err error) (uint64, error)
- func (r *Redis) Values(reply interface{}, err error) ([]interface{}, error)
- func (r *Redis) ZAdd(key string, kvs ...interface{}) (int64, error)
- func (r *Redis) ZClear(key string) error
- func (r *Redis) ZExpire(key string, duration int64) error
- func (r *Redis) ZRange(key string, min, max int64, withScores bool) (interface{}, error)
- func (r *Redis) ZRangeByScoreWithScore(key string, min, max int64) (map[string]int64, error)
- func (r *Redis) ZRem(key string, members ...string) (int64, error)
- func (r *Redis) ZScore(key string, member string) (float64, error)
- type RedisStore
- func (r *RedisStore) BLPop(key string, timeout int) (interface{}, error)
- func (r *RedisStore) BRPop(key string, timeout int) (interface{}, error)
- func (r *RedisStore) BRPopLPush(srcKey string, destKey string, timeout int) (interface{}, error)
- func (r *RedisStore) Bool(reply interface{}, err error) (bool, error)
- func (r *RedisStore) Bytes(reply interface{}, err error) ([]byte, error)
- func (r *RedisStore) Del(keys ...string) (int64, error)
- func (r *RedisStore) Eval(luaScript string, numberKeys int, keysArgs ...interface{}) (interface{}, error)
- func (r *RedisStore) EvalSha(sha1 string, numberKeys int, keysArgs ...interface{}) (interface{}, error)
- func (r *RedisStore) Exists(key string) (bool, error)
- func (r *RedisStore) Expire(key string, duration int64) (int64, error)
- func (r *RedisStore) ExpireAt(key string, timestamp int64) (int64, error)
- func (r *RedisStore) Float64(reply interface{}, err error) (float64, error)
- func (r *RedisStore) Get(key string) (interface{}, error)
- func (r *RedisStore) GetBit(key string, offset int64) (int64, error)
- func (r *RedisStore) GetPool() *redis.Pool
- func (r *RedisStore) GetSet(key string, value interface{}) (interface{}, error)
- func (r *RedisStore) HClear(key string) error
- func (r *RedisStore) HDel(key string, fields ...string) (int64, error)
- func (r *RedisStore) HExpire(key string, duration int64) error
- func (r *RedisStore) HGet(key string, field string) (interface{}, error)
- func (r *RedisStore) HGetAll(key string) (map[string]interface{}, error)
- func (r *RedisStore) HIncrBy(key, field string, delta int64) (int64, error)
- func (r *RedisStore) HKeys(key string) ([]string, error)
- func (r *RedisStore) HLen(key string) (int64, error)
- func (r *RedisStore) HMGet(key string, fields ...string) (interface{}, error)
- func (r *RedisStore) HMSet(key string, kvs ...interface{}) error
- func (r *RedisStore) HSet(key string, field string, val interface{}) error
- func (r *RedisStore) HVals(key string) ([]interface{}, error)
- func (r *RedisStore) Incr(key string) (int64, error)
- func (r *RedisStore) IncrBy(key string, delta int64) (int64, error)
- func (r *RedisStore) Int(reply interface{}, err error) (int, error)
- func (r *RedisStore) Int64(reply interface{}, err error) (int64, error)
- func (r *RedisStore) LLen(key string) (int64, error)
- func (r *RedisStore) LPop(key string) (interface{}, error)
- func (r *RedisStore) LPush(key string, value ...interface{}) error
- func (r *RedisStore) LRange(key string, start, stop int64) (interface{}, error)
- func (r *RedisStore) LRem(key string, count int, value interface{}) (int, error)
- func (r *RedisStore) LSet(key string, index int, value interface{}) error
- func (r *RedisStore) MGet(keys ...string) ([]interface{}, error)
- func (r *RedisStore) MSet(kvs map[string]interface{}) error
- func (r *RedisStore) MSetNX(kvs map[string]interface{}) (bool, error)
- func (r *RedisStore) RPop(key string) (interface{}, error)
- func (r *RedisStore) RPopLPush(srcKey string, destKey string) (interface{}, error)
- func (r *RedisStore) RPush(key string, value ...interface{}) error
- func (r *RedisStore) SAdd(key string, members ...interface{}) (int64, error)
- func (r *RedisStore) SIsMember(key string, member interface{}) (bool, error)
- func (r *RedisStore) SMembers(key string) ([]string, error)
- func (r *RedisStore) SPop(key string) ([]byte, error)
- func (r *RedisStore) SRem(key string, members ...interface{}) (int64, error)
- func (r *RedisStore) ScriptLoad(luaScript string) (interface{}, error)
- func (r *RedisStore) Set(key string, value interface{}) error
- func (r *RedisStore) SetBit(key string, offset uint32, value int) (int, error)
- func (r *RedisStore) SetEx(key string, value interface{}, timeout int64) error
- func (r *RedisStore) SetMaxActive(maxActive int)
- func (r *RedisStore) SetMaxIdle(maxIdle int)
- func (r *RedisStore) SetNx(key string, value interface{}) (int64, error)
- func (r *RedisStore) SetNxEx(key string, value interface{}, timeout int64) error
- func (r *RedisStore) String(reply interface{}, err error) (string, error)
- func (r *RedisStore) Strings(reply interface{}, err error) ([]string, error)
- func (r *RedisStore) TTl(key string) (int64, error)
- func (r *RedisStore) Uint64(reply interface{}, err error) (uint64, error)
- func (r *RedisStore) Values(reply interface{}, err error) ([]interface{}, error)
- func (r *RedisStore) ZAdd(key string, kvs ...interface{}) (int64, error)
- func (r *RedisStore) ZClear(key string) error
- func (r *RedisStore) ZExpire(key string, duration int64) error
- func (r *RedisStore) ZRange(key string, min, max int64, withScores bool) (interface{}, error)
- func (r *RedisStore) ZRangeByScoreWithScore(key string, min, max int64) (map[string]int64, error)
- func (r *RedisStore) ZRem(key string, members ...string) (int64, error)
- type Reply
- type SetStore
- type Store
- type ZSetStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnectionFailed = errors.New("store connect fail.")
View Source
var ErrErrPoolExhausted = errors.New("connection poll exhausted.")
View Source
var ErrExecuteFailed = errors.New("store Execute Command fail.")
View Source
var ErrNegativeInt = errors.New("redis cluster: unexpected value for Uint64")
View Source
var ErrNil = errors.New("nil return")
View Source
var ErrWrongArgsNum = errors.New("args num error")
View Source
var ErrWrongType = errors.New("wrong type")
Functions ¶
func Concurrency ¶
func GetRedisStats ¶
func GetRedisStats() []*redisStat
Types ¶
type HashZSetStore ¶
type HashZSetStore interface { Reply // contains filtered or unexported methods }
type KVHashStore ¶
type KVHashStore interface { Reply // contains filtered or unexported methods }
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func (*Redis) BRPopLPush ¶
为确保srcKey跟destKey映射到同一个slot,srcKey和destKey需要加上hash tag,如:{test}
func (*Redis) GeoRadius ¶
func (r *Redis) GeoRadius(key string, longitude, latitude float64, radius float64, count int) ([]redis.GeoLocation, error)
查询某个地理位置指定半径以内的地点
func (*Redis) GeoRadiusByMember ¶
func (r *Redis) GeoRadiusByMember(key string, member string, radius float64, count int) ([]redis.GeoLocation, error)
查询某个用户指定半径以内的地点
func (*Redis) ScriptLoad ¶
func (*Redis) SetMaxActive ¶
func (*Redis) SetMaxIdle ¶
func (*Redis) ZRangeByScoreWithScore ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func NewRedisStore ¶
func NewRedisStore(host string, port int, db int) (*RedisStore, error)
func NewRedisStoreWithoutTimeout ¶
func NewRedisStoreWithoutTimeout(host string, port int, db int) (*RedisStore, error)
func (*RedisStore) BRPopLPush ¶
func (r *RedisStore) BRPopLPush(srcKey string, destKey string, timeout int) (interface{}, error)
func (*RedisStore) Eval ¶
func (r *RedisStore) Eval(luaScript string, numberKeys int, keysArgs ...interface{}) (interface{}, error)
func (*RedisStore) EvalSha ¶
func (r *RedisStore) EvalSha(sha1 string, numberKeys int, keysArgs ...interface{}) (interface{}, error)
func (*RedisStore) ExpireAt ¶
func (r *RedisStore) ExpireAt(key string, timestamp int64) (int64, error)
func (*RedisStore) Float64 ¶
func (r *RedisStore) Float64(reply interface{}, err error) (float64, error)
func (*RedisStore) Get ¶
func (r *RedisStore) Get(key string) (interface{}, error)
func (*RedisStore) GetPool ¶
func (r *RedisStore) GetPool() *redis.Pool
func (*RedisStore) GetSet ¶
func (r *RedisStore) GetSet(key string, value interface{}) (interface{}, error)
func (*RedisStore) HClear ¶
func (r *RedisStore) HClear(key string) error
func (*RedisStore) HGetAll ¶
func (r *RedisStore) HGetAll(key string) (map[string]interface{}, error)
func (*RedisStore) HIncrBy ¶
func (r *RedisStore) HIncrBy(key, field string, delta int64) (int64, error)
func (*RedisStore) HMGet ¶
func (r *RedisStore) HMGet(key string, fields ...string) (interface{}, error)
func (*RedisStore) HMSet ¶
func (r *RedisStore) HMSet(key string, kvs ...interface{}) error
func (*RedisStore) HSet ¶
func (r *RedisStore) HSet(key string, field string, val interface{}) error
func (*RedisStore) HVals ¶
func (r *RedisStore) HVals(key string) ([]interface{}, error)
func (*RedisStore) LPop ¶
func (r *RedisStore) LPop(key string) (interface{}, error)
func (*RedisStore) LPush ¶
func (r *RedisStore) LPush(key string, value ...interface{}) error
func (*RedisStore) LRange ¶
func (r *RedisStore) LRange(key string, start, stop int64) (interface{}, error)
func (*RedisStore) LRem ¶
func (r *RedisStore) LRem(key string, count int, value interface{}) (int, error)
func (*RedisStore) MGet ¶
func (r *RedisStore) MGet(keys ...string) ([]interface{}, error)
func (*RedisStore) MSet ¶
func (r *RedisStore) MSet(kvs map[string]interface{}) error
func (*RedisStore) RPop ¶
func (r *RedisStore) RPop(key string) (interface{}, error)
func (*RedisStore) RPopLPush ¶
func (r *RedisStore) RPopLPush(srcKey string, destKey string) (interface{}, error)
func (*RedisStore) RPush ¶
func (r *RedisStore) RPush(key string, value ...interface{}) error
func (*RedisStore) SAdd ¶
func (r *RedisStore) SAdd(key string, members ...interface{}) (int64, error)
func (*RedisStore) SIsMember ¶
func (r *RedisStore) SIsMember(key string, member interface{}) (bool, error)
func (*RedisStore) SRem ¶
func (r *RedisStore) SRem(key string, members ...interface{}) (int64, error)
func (*RedisStore) ScriptLoad ¶
func (r *RedisStore) ScriptLoad(luaScript string) (interface{}, error)
func (*RedisStore) Set ¶
func (r *RedisStore) Set(key string, value interface{}) error
func (*RedisStore) SetEx ¶
func (r *RedisStore) SetEx(key string, value interface{}, timeout int64) error
func (*RedisStore) SetMaxActive ¶
func (r *RedisStore) SetMaxActive(maxActive int)
func (*RedisStore) SetMaxIdle ¶
func (r *RedisStore) SetMaxIdle(maxIdle int)
func (*RedisStore) SetNxEx ¶
func (r *RedisStore) SetNxEx(key string, value interface{}, timeout int64) error
nil表示成功,ErrNil表示数据库内已经存在这个key,其他表示数据库发生错误
func (*RedisStore) String ¶
func (r *RedisStore) String(reply interface{}, err error) (string, error)
func (*RedisStore) Strings ¶
func (r *RedisStore) Strings(reply interface{}, err error) ([]string, error)
func (*RedisStore) Uint64 ¶
func (r *RedisStore) Uint64(reply interface{}, err error) (uint64, error)
func (*RedisStore) Values ¶
func (r *RedisStore) Values(reply interface{}, err error) ([]interface{}, error)
func (*RedisStore) ZClear ¶
func (r *RedisStore) ZClear(key string) error
func (*RedisStore) ZRange ¶
func (r *RedisStore) ZRange(key string, min, max int64, withScores bool) (interface{}, error)
func (*RedisStore) ZRangeByScoreWithScore ¶
type Reply ¶
type Reply interface { Int(interface{}, error) (int, error) Int64(interface{}, error) (int64, error) Uint64(interface{}, error) (uint64, error) Float64(interface{}, error) (float64, error) Bool(interface{}, error) (bool, error) Bytes(interface{}, error) ([]byte, error) String(interface{}, error) (string, error) Strings(interface{}, error) ([]string, error) Values(interface{}, error) ([]interface{}, error) }
Click to show internal directories.
Click to hide internal directories.