Versions in this module Expand all Collapse all v1 v1.9.7 Sep 23, 2024 v1.9.6 Sep 20, 2024 Changes in this version type Client + func (c *Client) Info() (string, error) + func (c *Client) ListKeys(page uint64, pattern string, pageSize int64) ([]string, int64, error) type GoRedisStandaloneOps + func (ops *GoRedisStandaloneOps) Info() (string, error) + func (ops *GoRedisStandaloneOps) ListKeys(page uint64, pattern string, pageSize int64) ([]string, int, error) type IClient + Info func() (string, error) + ListKeys func(page uint64, pattern string, pageSize int64) ([]string, int64, error) type Ops + Info func() (string, error) + ListKeys func(page uint64, pattern string, pageSize int64) ([]string, int64, error) v1.9.5 Aug 5, 2024 v1.9.4 Jul 30, 2024 v1.9.3 Jul 26, 2024 v1.9.2 Jul 23, 2024 v1.9.1 Jul 23, 2024 v1.9.0 Jul 23, 2024 v1.8.9 Jul 19, 2024 v1.8.8 Jul 19, 2024 v1.8.7 Jul 19, 2024 Changes in this version + const ASC + const DESC + const FT + const KM + const LockPrefix + const LockValue + const M + const MI + const WITHCOORD + const WITHDIST + const WITHHASH + var DefaultSerializer = JsonSerializer + func GetBucketId(key []byte, bit int) []byte + func GetSort(sort GeoEnum) string + type Client struct + func (c *Client) Close() error + func (c *Client) Delete(key string) bool + func (c *Client) GetExpire(key string) (time.Duration, error) + func (c *Client) GetGeoOps() Geo + func (c *Client) GetHashOps() Hash + func (c *Client) GetKVOps() KV + func (c *Client) GetListOps() List + func (c *Client) GetLockOps() Lock + func (c *Client) GetSetOps() Set + func (c *Client) GetZSetOps() ZSet + func (c *Client) HasKey(key string) bool + func (c *Client) Ping() (string, error) + func (c *Client) RandomKey() (string, error) + func (c *Client) SetExpire(key string, expiration time.Duration) (bool, error) + func (c *Client) SetSerializer(serializer ISerializer) + type Geo struct + func (geo *Geo) GeoAdd(key string, longitude float64, latitude float64, member string) int64 + func (geo *Geo) GeoAddArr(key string, geoPosition []GeoPosition) int64 + func (geo *Geo) GeoDist(key string, member1, member2 string, unit GeoUnit) (error, GeoDistInfo) + func (geo *Geo) GeoPos(key string, member string) (err error, geoRes GeoPosition) + func (geo *Geo) GeoPosArr(key string, members []string) (err error, geoRes []GeoPosition) + func (geo *Geo) GeoRadius(key string, query GeoRadiusQuery) (error, []GeoPosition) + func (geo *Geo) GeoRadiusByMember(key string, query GeoRadiusByMemberQuery) (error, []GeoPosition) + type GeoDistInfo struct + Dist float64 + Unit GeoUnit + type GeoEnum string + type GeoPosition struct + Dist float64 + GeoHash int64 + Latitude float64 + Longitude float64 + Member string + Unit GeoUnit + type GeoRadiusByMemberQuery struct + Count int + Member string + Radius float64 + Sort GeoEnum + Store string + StoreDist string + Unit GeoUnit + WithCoord bool + WithDist bool + WithGeoHash bool + type GeoRadiusQuery struct + Count int + Latitude float64 + Longitude float64 + Radius float64 + Sort GeoEnum + Store string + StoreDist string + Unit GeoUnit + WithCoord bool + WithDist bool + WithGeoHash bool + type GeoUnit string + type GoRedisClusterOps struct + func NewClusterOps(options *Options) *GoRedisClusterOps + type GoRedisStandaloneOps struct + func NewStandaloneOps(options *Options) *GoRedisStandaloneOps + func (ops *GoRedisStandaloneOps) Append(key string, value string) (int64, error) + func (ops *GoRedisStandaloneOps) Close() error + func (ops *GoRedisStandaloneOps) DeleteKey(keys ...string) (int64, error) + func (ops *GoRedisStandaloneOps) Exists(key string) (bool, error) + func (ops *GoRedisStandaloneOps) GeoAddArr(key string, geoLocation ...GeoPosition) int64 + func (ops *GoRedisStandaloneOps) GeoDist(key string, member1, member2 string, unit GeoUnit) (error, GeoDistInfo) + func (ops *GoRedisStandaloneOps) GeoPos(key string, members ...string) (error, []GeoPosition) + func (ops *GoRedisStandaloneOps) GeoRadius(key string, query GeoRadiusQuery) (error, []GeoPosition) + func (ops *GoRedisStandaloneOps) GeoRadiusByMember(key string, member string, query GeoRadiusByMemberQuery) (error, []GeoPosition) + func (ops *GoRedisStandaloneOps) Get(key string) (string, error) + func (ops *GoRedisStandaloneOps) GetRange(key string, start int64, end int64) (string, error) + func (ops *GoRedisStandaloneOps) GetValue(key string) ([]byte, error) + func (ops *GoRedisStandaloneOps) HDel(key string, fields ...string) (int64, error) + func (ops *GoRedisStandaloneOps) HExists(key string, field string) (bool, error) + func (ops *GoRedisStandaloneOps) HGet(key string, field string) (string, error) + func (ops *GoRedisStandaloneOps) HGetAll(key string) (map[string]string, error) + func (ops *GoRedisStandaloneOps) HGetFloat64(key string, field string) (float64, error) + func (ops *GoRedisStandaloneOps) HGetInt64(key string, field string) (int64, error) + func (ops *GoRedisStandaloneOps) HIncrBy(key string, field string, increment int64) (int64, error) + func (ops *GoRedisStandaloneOps) HKeys(key string) ([]string, error) + func (ops *GoRedisStandaloneOps) HLen(key string) (int64, error) + func (ops *GoRedisStandaloneOps) HMGet(key string, fields ...string) ([]interface{}, error) + func (ops *GoRedisStandaloneOps) HSet(key string, field string, value interface{}) (int64, error) + func (ops *GoRedisStandaloneOps) HSetNX(key string, field string, value interface{}) (bool, error) + func (ops *GoRedisStandaloneOps) HVals(key string) ([]string, error) + func (ops *GoRedisStandaloneOps) IncrBy(key string, step int64) (int64, error) + func (ops *GoRedisStandaloneOps) LIndex(key string, index int64) (string, error) + func (ops *GoRedisStandaloneOps) LPop(key string) (string, error) + func (ops *GoRedisStandaloneOps) LPush(key string, values ...interface{}) (int64, error) + func (ops *GoRedisStandaloneOps) LRange(key string, start int64, end int64) ([]string, error) + func (ops *GoRedisStandaloneOps) LRemove(key string, count int64, value interface{}) (int64, error) + func (ops *GoRedisStandaloneOps) LSet(key string, index int64, value interface{}) error + func (ops *GoRedisStandaloneOps) LSize(key string) (int64, error) + func (ops *GoRedisStandaloneOps) LTrim(key string, start int64, end int64) error + func (ops *GoRedisStandaloneOps) MultiGet(key ...string) ([]interface{}, error) + func (ops *GoRedisStandaloneOps) MultiSet(values ...interface{}) error + func (ops *GoRedisStandaloneOps) Ping() (string, error) + func (ops *GoRedisStandaloneOps) RPop(key string) (string, error) + func (ops *GoRedisStandaloneOps) RPush(key string, values ...interface{}) (int64, error) + func (ops *GoRedisStandaloneOps) RandomKey() (string, error) + func (ops *GoRedisStandaloneOps) SAdd(key string, members ...interface{}) (int64, error) + func (ops *GoRedisStandaloneOps) SCard(key string) (int64, error) + func (ops *GoRedisStandaloneOps) SDiff(keys ...string) ([]string, error) + func (ops *GoRedisStandaloneOps) SInter(keys ...string) ([]string, error) + func (ops *GoRedisStandaloneOps) SInterStore(destination string, keys ...string) (int64, error) + func (ops *GoRedisStandaloneOps) SIsMember(key string, member interface{}) (bool, error) + func (ops *GoRedisStandaloneOps) SMembers(key string) ([]string, error) + func (ops *GoRedisStandaloneOps) SMove(source string, destination string, member interface{}) (bool, error) + func (ops *GoRedisStandaloneOps) SPop(key string) (string, error) + func (ops *GoRedisStandaloneOps) SRandMembers(key string, count int64) ([]string, error) + func (ops *GoRedisStandaloneOps) SRem(key string, members ...interface{}) (int64, error) + func (ops *GoRedisStandaloneOps) SUnion(keys ...string) ([]string, error) + func (ops *GoRedisStandaloneOps) SUnionStore(destination string, keys ...string) (int64, error) + func (ops *GoRedisStandaloneOps) Set(key string, value string, expiration time.Duration) error + func (ops *GoRedisStandaloneOps) SetExpire(key string, expiration time.Duration) (bool, error) + func (ops *GoRedisStandaloneOps) SetNX(key string, value interface{}) (bool, error) + func (ops *GoRedisStandaloneOps) SetValue(key string, value interface{}, expiration time.Duration) error + func (ops *GoRedisStandaloneOps) StrLen(key string) (int64, error) + func (ops *GoRedisStandaloneOps) TTL(key string) (time.Duration, error) + func (ops *GoRedisStandaloneOps) ZAdd(key string, member ZMember) int64 + func (ops *GoRedisStandaloneOps) ZCard(key string) int64 + func (ops *GoRedisStandaloneOps) ZCount(key, min, max string) int64 + func (ops *GoRedisStandaloneOps) ZIncrby(key string, incr float64, member string) float64 + func (ops *GoRedisStandaloneOps) ZInterStore(destination string, store []ZStore, arg ZStoreEnum) int64 + func (ops *GoRedisStandaloneOps) ZLexCount(key, min, max string) int64 + func (ops *GoRedisStandaloneOps) ZRange(key string, start, stop int64) []string + func (ops *GoRedisStandaloneOps) ZRangeByLex(key, min, max string, offset int64, count int64) []string + func (ops *GoRedisStandaloneOps) ZRangeByScore(key, min, max string, offset int64, count int64) []string + func (ops *GoRedisStandaloneOps) ZRank(key, member string) int64 + func (ops *GoRedisStandaloneOps) ZRem(key string, member ...string) int64 + func (ops *GoRedisStandaloneOps) ZRemRangeByLex(key, min, max string) int64 + func (ops *GoRedisStandaloneOps) ZRemRangeByRank(key string, start, stop int64) int64 + func (ops *GoRedisStandaloneOps) ZRevRange(key string, start, stop int64) []string + func (ops *GoRedisStandaloneOps) ZRevRangeWithScores(key string, start, stop int64) ([]ZMember, error) + func (ops *GoRedisStandaloneOps) ZRevRank(key, member string) int64 + func (ops *GoRedisStandaloneOps) ZScore(key, member string) float64 + type Hash struct + func (h Hash) Delete(key string, hashKey string) error + func (h Hash) Exists(key string, hashKey string) bool + func (h Hash) Get(key string, hashKey string, value interface{}) error + func (h Hash) GetEntries(key string) (map[string]string, error) + func (h Hash) GetHashKeys(key string) ([]string, error) + func (h Hash) GetString(key string, hashKey string) (string, error) + func (h Hash) Increment(key string, hashKey string, delta int64) int64 + func (h Hash) MultiGet(key string, hashKeys ...string) ([]interface{}, error) + func (h Hash) Put(key string, hashKey string, value interface{}) error + func (h Hash) PutIfAbsent(key string, hashKey string, value interface{}) (bool, error) + func (h Hash) Size(key string) int64 + type IClient interface + Close func() error + Delete func(key string) bool + GetExpire func(key string) (time.Duration, error) + GetGeoOps func() Geo + GetHashOps func() Hash + GetKVOps func() KV + GetListOps func() List + GetLockOps func() Lock + GetSetOps func() Set + GetZSetOps func() ZSet + HasKey func(key string) bool + Ping func() (string, error) + RandomKey func() (string, error) + SetExpire func(key string, expiration time.Duration) (bool, error) + SetSerializer func(ISerializer) + func NewClient(options *Options) IClient + type ISerializer interface + Deserialization func(byt []byte, ptr interface{}) (err error) + Serialization func(value interface{}) ([]byte, error) + type JsonSerializer struct + func (serializer JsonSerializer) Deserialization(byt []byte, ptr interface{}) (err error) + func (serializer JsonSerializer) Serialization(value interface{}) ([]byte, error) + type KV struct + func (kv KV) Append(key string, value string) int64 + func (kv KV) Get(key string, ptr interface{}) error + func (kv KV) GetAndSet(key string, value string) (string, error) + func (kv KV) GetString(key string) (string, error) + func (kv KV) Increment(key string, delta int64) (int64, error) + func (kv KV) MultiGet(keys ...string) ([]interface{}, error) + func (kv KV) MultiSet(values ...interface{}) error + func (kv KV) Set(key string, value interface{}, duration time.Duration) error + func (kv KV) SetIfAbsent(key string, value interface{}) (bool, error) + func (kv KV) SetString(key string, value string, duration time.Duration) error + type List struct + func (ls List) AddElements(key string, values ...interface{}) error + func (ls List) Clear(key string) (bool, error) + func (ls List) GetElement(key string, index int64, elem interface{}) error + func (ls List) GetElements(key string, startIndex int64, endIndex int64, elements interface{}) + func (ls List) Index(key string, index int64) (string, error) + func (ls List) LeftPop(key string) (string, error) + func (ls List) LeftPush(key string, value ...interface{}) (int64, error) + func (ls List) Range(key string, start int64, end int64) ([]string, error) + func (ls List) Remove(key string, count int64, value interface{}) (int64, error) + func (ls List) RightPop(key string) (string, error) + func (ls List) RightPush(key string, values ...interface{}) (int64, error) + func (ls List) Set(key string, index int64, value interface{}) error + func (ls List) Size(key string) (int64, error) + func (ls List) Trim(key string, start int64, end int64) error + type Lock struct + func (lock *Lock) DisposeLock(key string) (error, bool) + func (lock *Lock) GetDLock(key string, waitSecond int) (error, bool) + type Ops interface + Append func(key string, value string) (int64, error) + Close func() error + DeleteKey func(keys ...string) (int64, error) + Exists func(key string) (bool, error) + GeoAddArr func(key string, geoLocation ...GeoPosition) int64 + GeoDist func(key string, member1, member2 string, unit GeoUnit) (error, GeoDistInfo) + GeoPos func(key string, members ...string) (error, []GeoPosition) + GeoRadius func(key string, query GeoRadiusQuery) (error, []GeoPosition) + GeoRadiusByMember func(key string, member string, query GeoRadiusByMemberQuery) (error, []GeoPosition) + Get func(key string) (string, error) + GetRange func(key string, start int64, end int64) (string, error) + GetValue func(key string) ([]byte, error) + HDel func(key string, fields ...string) (int64, error) + HExists func(key string, field string) (bool, error) + HGet func(key string, field string) (string, error) + HGetAll func(key string) (map[string]string, error) + HIncrBy func(key string, field string, increment int64) (int64, error) + HKeys func(key string) ([]string, error) + HLen func(key string) (int64, error) + HMGet func(key string, fields ...string) ([]interface{}, error) + HSet func(key string, field string, value interface{}) (int64, error) + HSetNX func(key string, field string, value interface{}) (bool, error) + HVals func(key string) ([]string, error) + IncrBy func(key string, step int64) (int64, error) + LIndex func(key string, index int64) (string, error) + LPop func(key string) (string, error) + LPush func(key string, values ...interface{}) (int64, error) + LRange func(key string, start int64, end int64) ([]string, error) + LRemove func(key string, count int64, value interface{}) (int64, error) + LSet func(key string, index int64, value interface{}) error + LSize func(key string) (int64, error) + LTrim func(key string, start int64, end int64) error + MultiGet func(key ...string) ([]interface{}, error) + MultiSet func(values ...interface{}) error + Ping func() (string, error) + RPop func(key string) (string, error) + RPush func(key string, values ...interface{}) (int64, error) + RandomKey func() (string, error) + SAdd func(key string, members ...interface{}) (int64, error) + SCard func(key string) (int64, error) + SDiff func(keys ...string) ([]string, error) + SInter func(keys ...string) ([]string, error) + SInterStore func(destination string, keys ...string) (int64, error) + SIsMember func(key string, member interface{}) (bool, error) + SMembers func(key string) ([]string, error) + SMove func(source string, destination string, member interface{}) (bool, error) + SPop func(key string) (string, error) + SRandMembers func(key string, count int64) ([]string, error) + SRem func(key string, members ...interface{}) (int64, error) + SUnion func(keys ...string) ([]string, error) + SUnionStore func(destination string, keys ...string) (int64, error) + Set func(key string, value string, expiration time.Duration) error + SetExpire func(key string, expiration time.Duration) (bool, error) + SetNX func(key string, value interface{}) (bool, error) + SetValue func(key string, value interface{}, expiration time.Duration) error + StrLen func(key string) (int64, error) + TTL func(key string) (time.Duration, error) + ZAdd func(key string, member ZMember) int64 + ZCard func(key string) int64 + ZCount func(key, min, max string) int64 + ZIncrby func(key string, incr float64, member string) float64 + ZInterStore func(destination string, store []ZStore, arg ZStoreEnum) int64 + ZLexCount func(key, min, max string) int64 + ZRange func(key string, start, stop int64) []string + ZRangeByLex func(key, min, max string, offset int64, count int64) []string + ZRangeByScore func(key, min, max string, offset int64, count int64) []string + ZRank func(key, member string) int64 + ZRem func(key string, member ...string) int64 + ZRemRangeByLex func(key, min, max string) int64 + ZRemRangeByRank func(key string, start, stop int64) int64 + ZRevRange func(key string, start, stop int64) []string + ZRevRangeWithScores func(key string, start, stop int64) ([]ZMember, error) + ZRevRank func(key, member string) int64 + ZScore func(key, member string) float64 + type Options struct + Addr string + Addrs []string + DB int + Password string + type Set struct + func (set Set) Add(key string, members ...interface{}) (int64, error) + func (set Set) Difference(keys ...string) ([]string, error) + func (set Set) Intersect(keys ...string) ([]string, error) + func (set Set) IntersectAndStore(destination string, keys ...string) (int64, error) + func (set Set) IsMember(key string, member interface{}) (bool, error) + func (set Set) Members(key string) ([]string, error) + func (set Set) Move(source string, destination string, member interface{}) (bool, error) + func (set Set) Pop(key string) (string, error) + func (set Set) RandMembers(key string, count int64) ([]string, error) + func (set Set) Remove(key string, members ...interface{}) (int64, error) + func (set Set) Size(key string) (int64, error) + func (set Set) Union(keys ...string) ([]string, error) + func (set Set) UnionAndStore(destination string, keys ...string) (int64, error) + type ZMember struct + Member string + Score float64 + type ZSet struct + func (zSet *ZSet) ZAdd(key string, member ZMember) int64 + func (zSet *ZSet) ZCard(key string) int64 + func (zSet *ZSet) ZCount(key string, min, max float64) int64 + func (zSet *ZSet) ZIncrby(key string, incr float64, member string) float64 + func (zSet *ZSet) ZInterStore(destination string, store []ZStore, arg ZStoreEnum) int64 + func (zSet *ZSet) ZLexCount(key, min, max string) int64 + func (zSet *ZSet) ZRange(key string, start, stop int64) []string + func (zSet *ZSet) ZRangeByLex(key, min, max string, offset int64, count int64) []string + func (zSet *ZSet) ZRangeByScore(key, min, max string, offset int64, count int64) []string + func (zSet *ZSet) ZRank(key, member string) int64 + func (zSet *ZSet) ZRem(key string, member ...string) int64 + func (zSet *ZSet) ZRemRangeByLex(key, min, max string) int64 + func (zSet *ZSet) ZRemRangeByRank(key string, start, stop int64) int64 + func (zSet *ZSet) ZRevRange(key string, start, stop int64) []string + func (zSet *ZSet) ZRevRangeWithScores(key string, start, stop int64) ([]ZMember, error) + func (zSet *ZSet) ZRevRank(key, member string) int64 + func (zSet *ZSet) ZScore(key, member string) float64 + type ZStore struct + Key string + Weight float64 + type ZStoreEnum string + const MAX + const MIN + const SUM