Versions in this module Expand all Collapse all v1 v1.0.50 Nov 27, 2020 Changes in this version + const ClusterType + const Nil + const NodeType + var ErrEmptyHost = errors.New("empty redis host") + var ErrEmptyKey = errors.New("empty redis key") + var ErrEmptyType = errors.New("empty redis type") + var ErrNilNode = errors.New("nil redis node") + type ClosableNode interface + Close func() + func CreateBlockingNode(r *Redis) (ClosableNode, error) + type FloatCmd = red.FloatCmd + type GeoLocation = red.GeoLocation + type GeoPos = red.GeoPos + type GeoRadiusQuery = red.GeoRadiusQuery + type IntCmd = red.IntCmd + type Map map[string]string + type Pair struct + Key string + Score int64 + type Pipeliner = red.Pipeliner + type Redis struct + Addr string + Pass string + Type string + func NewRedis(redisAddr, redisType string, redisPass ...string) *Redis + func (s *Redis) Blpop(redisNode RedisNode, key string) (string, error) + func (s *Redis) BlpopEx(redisNode RedisNode, key string) (string, bool, error) + func (s *Redis) Del(keys ...string) (val int, err error) + func (s *Redis) Eval(script string, keys []string, args ...interface{}) (val interface{}, err error) + func (s *Redis) Exists(key string) (val bool, err error) + func (s *Redis) Expire(key string, seconds int) error + func (s *Redis) Expireat(key string, expireTime int64) error + func (s *Redis) GeoAdd(key string, geoLocation ...*GeoLocation) (val int64, err error) + func (s *Redis) GeoDist(key string, member1, member2, unit string) (val float64, err error) + func (s *Redis) GeoHash(key string, members ...string) (val []string, err error) + func (s *Redis) GeoPos(key string, members ...string) (val []*GeoPos, err error) + func (s *Redis) GeoRadius(key string, longitude, latitude float64, query *GeoRadiusQuery) (val []GeoLocation, err error) + func (s *Redis) GeoRadiusByMember(key, member string, query *GeoRadiusQuery) (val []GeoLocation, err error) + func (s *Redis) Get(key string) (val string, err error) + func (s *Redis) GetBit(key string, offset int64) (val int, err error) + func (s *Redis) Hdel(key, field string) (val bool, err error) + func (s *Redis) Hexists(key, field string) (val bool, err error) + func (s *Redis) Hget(key, field string) (val string, err error) + func (s *Redis) Hgetall(key string) (val map[string]string, err error) + func (s *Redis) Hincrby(key, field string, increment int) (val int, err error) + func (s *Redis) Hkeys(key string) (val []string, err error) + func (s *Redis) Hlen(key string) (val int, err error) + func (s *Redis) Hmget(key string, fields ...string) (val []string, err error) + func (s *Redis) Hmset(key string, fieldsAndValues map[string]string) error + func (s *Redis) Hset(key, field, value string) error + func (s *Redis) Hsetnx(key, field, value string) (val bool, err error) + func (s *Redis) Hvals(key string) (val []string, err error) + func (s *Redis) Incr(key string) (val int64, err error) + func (s *Redis) Incrby(key string, increment int64) (val int64, err error) + func (s *Redis) Keys(pattern string) (val []string, err error) + func (s *Redis) Llen(key string) (val int, err error) + func (s *Redis) Lpop(key string) (val string, err error) + func (s *Redis) Lpush(key string, values ...interface{}) (val int, err error) + func (s *Redis) Lrange(key string, start int, stop int) (val []string, err error) + func (s *Redis) Lrem(key string, count int, value string) (val int, err error) + func (s *Redis) Mget(keys ...string) (val []string, err error) + func (s *Redis) Persist(key string) (val bool, err error) + func (s *Redis) Pfadd(key string, values ...interface{}) (val bool, err error) + func (s *Redis) Pfcount(key string) (val int64, err error) + func (s *Redis) Pfmerge(dest string, keys ...string) error + func (s *Redis) Ping() (val bool) + func (s *Redis) Pipelined(fn func(Pipeliner) error) (err error) + func (s *Redis) Rpush(key string, values ...interface{}) (val int, err error) + func (s *Redis) Sadd(key string, values ...interface{}) (val int, err error) + func (s *Redis) Scan(cursor uint64, match string, count int64) (keys []string, cur uint64, err error) + func (s *Redis) Scard(key string) (val int64, err error) + func (s *Redis) Sdiff(keys ...string) (val []string, err error) + func (s *Redis) Sdiffstore(destination string, keys ...string) (val int, err error) + func (s *Redis) Set(key string, value string) error + func (s *Redis) SetBit(key string, offset int64, value int) error + func (s *Redis) Setex(key, value string, seconds int) error + func (s *Redis) Setnx(key, value string) (val bool, err error) + func (s *Redis) SetnxEx(key, value string, seconds int) (val bool, err error) + func (s *Redis) Sismember(key string, value interface{}) (val bool, err error) + func (s *Redis) Smembers(key string) (val []string, err error) + func (s *Redis) Spop(key string) (val string, err error) + func (s *Redis) Srandmember(key string, count int) (val []string, err error) + func (s *Redis) Srem(key string, values ...interface{}) (val int, err error) + func (s *Redis) Sscan(key string, cursor uint64, match string, count int64) (keys []string, cur uint64, err error) + func (s *Redis) String() string + func (s *Redis) Sunion(keys ...string) (val []string, err error) + func (s *Redis) Sunionstore(destination string, keys ...string) (val int, err error) + func (s *Redis) Ttl(key string) (val int, err error) + func (s *Redis) ZRevRangeWithScores(key string, start, stop int64) (val []Pair, err error) + func (s *Redis) Zadd(key string, score int64, value string) (val bool, err error) + func (s *Redis) Zadds(key string, ps ...Pair) (val int64, err error) + func (s *Redis) Zcard(key string) (val int, err error) + func (s *Redis) Zcount(key string, start, stop int64) (val int, err error) + func (s *Redis) Zincrby(key string, increment int64, field string) (val int64, err error) + func (s *Redis) Zrange(key string, start, stop int64) (val []string, err error) + func (s *Redis) ZrangeWithScores(key string, start, stop int64) (val []Pair, err error) + func (s *Redis) ZrangebyscoreWithScores(key string, start, stop int64) (val []Pair, err error) + func (s *Redis) ZrangebyscoreWithScoresAndLimit(key string, start, stop int64, page, size int) (val []Pair, err error) + func (s *Redis) Zrank(key, field string) (val int64, err error) + func (s *Redis) Zrem(key string, values ...interface{}) (val int, err error) + func (s *Redis) Zremrangebyrank(key string, start, stop int64) (val int, err error) + func (s *Redis) Zremrangebyscore(key string, start, stop int64) (val int, err error) + func (s *Redis) Zrevrange(key string, start, stop int64) (val []string, err error) + func (s *Redis) ZrevrangebyscoreWithScores(key string, start, stop int64) (val []Pair, err error) + func (s *Redis) ZrevrangebyscoreWithScoresAndLimit(key string, start, stop int64, page, size int) (val []Pair, err error) + func (s *Redis) Zrevrank(key string, field string) (val int64, err error) + func (s *Redis) Zscore(key string, value string) (val int64, err error) + type RedisConf struct + Host string + Pass string + Type string + func (rc RedisConf) NewRedis() *Redis + func (rc RedisConf) Validate() error + type RedisKeyConf struct + Key string + func (rkc RedisKeyConf) Validate() error + type RedisLock struct + func NewRedisLock(store *Redis, key string) *RedisLock + func (rl *RedisLock) Acquire() (bool, error) + func (rl *RedisLock) Release() (bool, error) + func (rl *RedisLock) SetExpire(seconds int) + type RedisNode interface + type ScriptCache struct + func GetScriptCache() *ScriptCache + func (sc *ScriptCache) GetSha(script string) (string, bool) + func (sc *ScriptCache) SetSha(script, sha string) + type Z = red.Z