Documentation ¶
Overview ¶
Package redis provides gredis.Adapter implements using go-redis.
Index ¶
- type Conn
- func (c *Conn) Close(ctx context.Context) (err error)
- func (c *Conn) Do(ctx context.Context, command string, args ...interface{}) (reply *gvar.Var, err error)
- func (c *Conn) PSubscribe(ctx context.Context, pattern string, patterns ...string) ([]*gredis.Subscription, error)
- func (c *Conn) Receive(ctx context.Context) (*gvar.Var, error)
- func (c *Conn) ReceiveMessage(ctx context.Context) (*gredis.Message, error)
- func (c *Conn) Subscribe(ctx context.Context, channel string, channels ...string) ([]*gredis.Subscription, error)
- type GroupGeneric
- func (r GroupGeneric) Copy(ctx context.Context, source, destination string, option ...gredis.CopyOption) (int64, error)
- func (r GroupGeneric) DBSize(ctx context.Context) (int64, error)
- func (r GroupGeneric) Del(ctx context.Context, keys ...string) (int64, error)
- func (r GroupGeneric) Exists(ctx context.Context, keys ...string) (int64, error)
- func (r GroupGeneric) Expire(ctx context.Context, key string, seconds int64, option ...gredis.ExpireOption) (int64, error)
- func (r GroupGeneric) ExpireAt(ctx context.Context, key string, time time.Time, option ...gredis.ExpireOption) (int64, error)
- func (r GroupGeneric) ExpireTime(ctx context.Context, key string) (*gvar.Var, error)
- func (r GroupGeneric) FlushAll(ctx context.Context, option ...gredis.FlushOp) error
- func (r GroupGeneric) FlushDB(ctx context.Context, option ...gredis.FlushOp) error
- func (r GroupGeneric) Keys(ctx context.Context, pattern string) ([]string, error)
- func (r GroupGeneric) Move(ctx context.Context, key string, db int) (int64, error)
- func (r GroupGeneric) PExpire(ctx context.Context, key string, milliseconds int64, ...) (int64, error)
- func (r GroupGeneric) PExpireAt(ctx context.Context, key string, time time.Time, option ...gredis.ExpireOption) (int64, error)
- func (r GroupGeneric) PExpireTime(ctx context.Context, key string) (*gvar.Var, error)
- func (r GroupGeneric) PTTL(ctx context.Context, key string) (int64, error)
- func (r GroupGeneric) Persist(ctx context.Context, key string) (int64, error)
- func (r GroupGeneric) RandomKey(ctx context.Context) (string, error)
- func (r GroupGeneric) Rename(ctx context.Context, key, newKey string) error
- func (r GroupGeneric) RenameNX(ctx context.Context, key, newKey string) (int64, error)
- func (r GroupGeneric) TTL(ctx context.Context, key string) (int64, error)
- func (r GroupGeneric) Type(ctx context.Context, key string) (string, error)
- func (r GroupGeneric) Unlink(ctx context.Context, keys ...string) (int64, error)
- type GroupHash
- func (r GroupHash) HDel(ctx context.Context, key string, fields ...string) (int64, error)
- func (r GroupHash) HExists(ctx context.Context, key, field string) (int64, error)
- func (r GroupHash) HGet(ctx context.Context, key, field string) (*gvar.Var, error)
- func (r GroupHash) HGetAll(ctx context.Context, key string) (*gvar.Var, error)
- func (r GroupHash) HIncrBy(ctx context.Context, key, field string, increment int64) (int64, error)
- func (r GroupHash) HIncrByFloat(ctx context.Context, key, field string, increment float64) (float64, error)
- func (r GroupHash) HKeys(ctx context.Context, key string) ([]string, error)
- func (r GroupHash) HLen(ctx context.Context, key string) (int64, error)
- func (r GroupHash) HMGet(ctx context.Context, key string, fields ...string) (gvar.Vars, error)
- func (r GroupHash) HMSet(ctx context.Context, key string, fields map[string]interface{}) error
- func (r GroupHash) HSet(ctx context.Context, key string, fields map[string]interface{}) (int64, error)
- func (r GroupHash) HSetNX(ctx context.Context, key, field string, value interface{}) (int64, error)
- func (r GroupHash) HStrLen(ctx context.Context, key, field string) (int64, error)
- func (r GroupHash) HVals(ctx context.Context, key string) (gvar.Vars, error)
- type GroupList
- func (r GroupList) BLPop(ctx context.Context, timeout int64, keys ...string) (gvar.Vars, error)
- func (r GroupList) BRPop(ctx context.Context, timeout int64, keys ...string) (gvar.Vars, error)
- func (r GroupList) BRPopLPush(ctx context.Context, source, destination string, timeout int64) (*gvar.Var, error)
- func (r GroupList) LIndex(ctx context.Context, key string, index int64) (*gvar.Var, error)
- func (r GroupList) LInsert(ctx context.Context, key string, op gredis.LInsertOp, pivot, value interface{}) (int64, error)
- func (r GroupList) LLen(ctx context.Context, key string) (int64, error)
- func (r GroupList) LPop(ctx context.Context, key string, count ...int) (*gvar.Var, error)
- func (r GroupList) LPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (r GroupList) LPushX(ctx context.Context, key string, element interface{}, elements ...interface{}) (int64, error)
- func (r GroupList) LRange(ctx context.Context, key string, start, stop int64) (gvar.Vars, error)
- func (r GroupList) LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)
- func (r GroupList) LSet(ctx context.Context, key string, index int64, value interface{}) (*gvar.Var, error)
- func (r GroupList) LTrim(ctx context.Context, key string, start, stop int64) error
- func (r GroupList) RPop(ctx context.Context, key string, count ...int) (*gvar.Var, error)
- func (r GroupList) RPopLPush(ctx context.Context, source, destination string) (*gvar.Var, error)
- func (r GroupList) RPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (r GroupList) RPushX(ctx context.Context, key string, value interface{}) (int64, error)
- type GroupPubSub
- func (r GroupPubSub) PSubscribe(ctx context.Context, pattern string, patterns ...string) (gredis.Conn, []*gredis.Subscription, error)
- func (r GroupPubSub) Publish(ctx context.Context, channel string, message interface{}) (int64, error)
- func (r GroupPubSub) Subscribe(ctx context.Context, channel string, channels ...string) (gredis.Conn, []*gredis.Subscription, error)
- type GroupScript
- func (r GroupScript) Eval(ctx context.Context, script string, numKeys int64, keys []string, ...) (*gvar.Var, error)
- func (r GroupScript) EvalSha(ctx context.Context, sha1 string, numKeys int64, keys []string, ...) (*gvar.Var, error)
- func (r GroupScript) ScriptExists(ctx context.Context, sha1 string, sha1s ...string) (map[string]bool, error)
- func (r GroupScript) ScriptFlush(ctx context.Context, option ...gredis.ScriptFlushOption) error
- func (r GroupScript) ScriptKill(ctx context.Context) error
- func (r GroupScript) ScriptLoad(ctx context.Context, script string) (string, error)
- type GroupSet
- func (r GroupSet) SAdd(ctx context.Context, key string, member interface{}, members ...interface{}) (int64, error)
- func (r GroupSet) SCard(ctx context.Context, key string) (int64, error)
- func (r GroupSet) SDiff(ctx context.Context, key string, keys ...string) (gvar.Vars, error)
- func (r GroupSet) SDiffStore(ctx context.Context, destination string, key string, keys ...string) (int64, error)
- func (r GroupSet) SInter(ctx context.Context, key string, keys ...string) (gvar.Vars, error)
- func (r GroupSet) SInterStore(ctx context.Context, destination string, key string, keys ...string) (int64, error)
- func (r GroupSet) SIsMember(ctx context.Context, key string, member interface{}) (int64, error)
- func (r GroupSet) SMIsMember(ctx context.Context, key, member interface{}, members ...interface{}) ([]int, error)
- func (r GroupSet) SMembers(ctx context.Context, key string) (gvar.Vars, error)
- func (r GroupSet) SMove(ctx context.Context, source, destination string, member interface{}) (int64, error)
- func (r GroupSet) SPop(ctx context.Context, key string, count ...int) (*gvar.Var, error)
- func (r GroupSet) SRandMember(ctx context.Context, key string, count ...int) (*gvar.Var, error)
- func (r GroupSet) SRem(ctx context.Context, key string, member interface{}, members ...interface{}) (int64, error)
- func (r GroupSet) SUnion(ctx context.Context, key string, keys ...string) (gvar.Vars, error)
- func (r GroupSet) SUnionStore(ctx context.Context, destination, key string, keys ...string) (int64, error)
- type GroupSortedSet
- func (r GroupSortedSet) ZAdd(ctx context.Context, key string, option *gredis.ZAddOption, ...) (*gvar.Var, error)
- func (r GroupSortedSet) ZCard(ctx context.Context, key string) (int64, error)
- func (r GroupSortedSet) ZCount(ctx context.Context, key string, min, max string) (int64, error)
- func (r GroupSortedSet) ZIncrBy(ctx context.Context, key string, increment float64, member interface{}) (float64, error)
- func (r GroupSortedSet) ZLexCount(ctx context.Context, key, min, max string) (int64, error)
- func (r GroupSortedSet) ZRange(ctx context.Context, key string, start, stop int64, ...) (gvar.Vars, error)
- func (r GroupSortedSet) ZRank(ctx context.Context, key string, member interface{}) (int64, error)
- func (r GroupSortedSet) ZRem(ctx context.Context, key string, member interface{}, members ...interface{}) (int64, error)
- func (r GroupSortedSet) ZRemRangeByLex(ctx context.Context, key string, min, max string) (int64, error)
- func (r GroupSortedSet) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error)
- func (r GroupSortedSet) ZRemRangeByScore(ctx context.Context, key string, min, max string) (int64, error)
- func (r GroupSortedSet) ZRevRange(ctx context.Context, key string, start, stop int64, ...) (*gvar.Var, error)
- func (r GroupSortedSet) ZRevRank(ctx context.Context, key string, member interface{}) (int64, error)
- func (r GroupSortedSet) ZScore(ctx context.Context, key string, member interface{}) (float64, error)
- type GroupString
- func (r GroupString) Append(ctx context.Context, key string, value string) (int64, error)
- func (r GroupString) Decr(ctx context.Context, key string) (int64, error)
- func (r GroupString) DecrBy(ctx context.Context, key string, decrement int64) (int64, error)
- func (r GroupString) Get(ctx context.Context, key string) (*gvar.Var, error)
- func (r GroupString) GetDel(ctx context.Context, key string) (*gvar.Var, error)
- func (r GroupString) GetEX(ctx context.Context, key string, option ...gredis.GetEXOption) (*gvar.Var, error)
- func (r GroupString) GetRange(ctx context.Context, key string, start, end int64) (string, error)
- func (r GroupString) GetSet(ctx context.Context, key string, value interface{}) (*gvar.Var, error)
- func (r GroupString) Incr(ctx context.Context, key string) (int64, error)
- func (r GroupString) IncrBy(ctx context.Context, key string, increment int64) (int64, error)
- func (r GroupString) IncrByFloat(ctx context.Context, key string, increment float64) (float64, error)
- func (r GroupString) MGet(ctx context.Context, keys ...string) (map[string]*gvar.Var, error)
- func (r GroupString) MSet(ctx context.Context, keyValueMap map[string]interface{}) error
- func (r GroupString) MSetNX(ctx context.Context, keyValueMap map[string]interface{}) (bool, error)
- func (r GroupString) Set(ctx context.Context, key string, value interface{}, option ...gredis.SetOption) (*gvar.Var, error)
- func (r GroupString) SetEX(ctx context.Context, key string, value interface{}, ttlInSeconds int64) error
- func (r GroupString) SetNX(ctx context.Context, key string, value interface{}) (bool, error)
- func (r GroupString) SetRange(ctx context.Context, key string, offset int64, value string) (int64, error)
- func (r GroupString) StrLen(ctx context.Context, key string) (int64, error)
- type Redis
- func (r *Redis) Close(ctx context.Context) (err error)
- func (r *Redis) Conn(ctx context.Context) (gredis.Conn, error)
- func (r *Redis) Do(ctx context.Context, command string, args ...interface{}) (*gvar.Var, error)
- func (r *Redis) GroupGeneric() gredis.IGroupGeneric
- func (r *Redis) GroupHash() gredis.IGroupHash
- func (r *Redis) GroupList() gredis.IGroupList
- func (r *Redis) GroupPubSub() gredis.IGroupPubSub
- func (r *Redis) GroupScript() gredis.IGroupScript
- func (r *Redis) GroupSet() gredis.IGroupSet
- func (r *Redis) GroupSortedSet() gredis.IGroupSortedSet
- func (r *Redis) GroupString() gredis.IGroupString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn manages the connection operations.
func (*Conn) Do ¶
func (c *Conn) Do(ctx context.Context, command string, args ...interface{}) (reply *gvar.Var, err error)
Do send a command to the server and returns the received reply. It uses json.Marshal for struct/slice/map type values before committing them to redis.
func (*Conn) PSubscribe ¶
func (c *Conn) PSubscribe(ctx context.Context, pattern string, patterns ...string) ([]*gredis.Subscription, error)
PSubscribe subscribes the client to the given patterns.
Supported glob-style patterns: - h?llo subscribes to hello, hallo and hxllo - h*llo subscribes to hllo and heeeello - h[ae]llo subscribes to hello and hallo, but not hillo
Use \ to escape special characters if you want to match them verbatim.
func (*Conn) ReceiveMessage ¶
ReceiveMessage receives a single message of subscription from the Redis server.
type GroupGeneric ¶
type GroupGeneric struct {
Operation gredis.AdapterOperation
}
GroupGeneric provides generic functions of redis.
func (GroupGeneric) Copy ¶
func (r GroupGeneric) Copy(ctx context.Context, source, destination string, option ...gredis.CopyOption) (int64, error)
Copy copies the value stored at the source key to the destination key.
By default, the destination key is created in the logical database used by the connection. The DB option allows specifying an alternative logical database index for the destination key.
The command returns an error when the destination key already exists.
It returns: - 1 if source was copied. - 0 if source was not copied.
func (GroupGeneric) DBSize ¶
func (r GroupGeneric) DBSize(ctx context.Context) (int64, error)
DBSize return the number of keys in the currently-selected database.
func (GroupGeneric) Del ¶
Del removes the specified keys. a key is ignored if it does not exist.
It returns the number of keys that were removed.
func (GroupGeneric) Exists ¶
Exists returns if key exists. The user should be aware that if the same existing key is mentioned in the arguments multiple times, it will be counted multiple times.
It returns the number of keys that exist from those specified as arguments.
func (GroupGeneric) Expire ¶
func (r GroupGeneric) Expire(ctx context.Context, key string, seconds int64, option ...gredis.ExpireOption) (int64, error)
Expire sets a timeout on key. After the timeout has expired, the key will automatically be deleted.
It returns: - 1 if the timeout was set. - 0 if the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
func (GroupGeneric) ExpireAt ¶
func (r GroupGeneric) ExpireAt(ctx context.Context, key string, time time.Time, option ...gredis.ExpireOption) (int64, error)
ExpireAt has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970). A timestamp in the past will delete the key immediately.
It returns: - 1 if the timeout was set. - 0 if the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
func (GroupGeneric) ExpireTime ¶
ExpireTime returns the absolute time at which the given key will expire.
It returns: - -1 if the key exists but has no associated expiration time. - -2 if the key does not exist.
func (GroupGeneric) FlushAll ¶
FlushAll delete all the keys of all the existing databases, not just the currently selected one. This command never fails. By default, FlushAll will synchronously flush all the databases.
It is possible to use one of the following modifiers to dictate the flushing mode explicitly: ASYNC: flushes the databases asynchronously SYNC: flushes the databases synchronously
Note: an asynchronous FlushAll command only deletes keys that were present at the time the command was invoked. Keys created during an asynchronous flush will be unaffected.
func (GroupGeneric) FlushDB ¶
FlushDB delete all the keys of the currently selected DB. This command never fails.
func (GroupGeneric) Keys ¶
Keys return all keys matching pattern.
While the time complexity for this operation is O(N), the constant times are fairly low. For example, Redis running on an entry level laptop can scan a 1 million key database in 40 milliseconds.
func (GroupGeneric) Move ¶
Move moves key from the currently selected database (see SELECT) to the specified destination database. When key already exists in the destination database, or it does not exist in the source database, it does nothing. It is possible to use MOVE as a locking primitive because of this.
It returns: - 1 if key was moved. - 0 if key was not moved.
func (GroupGeneric) PExpire ¶
func (r GroupGeneric) PExpire(ctx context.Context, key string, milliseconds int64, option ...gredis.ExpireOption) (int64, error)
PExpire works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.
It returns: - 1 if the timeout was set. - 0 if the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
func (GroupGeneric) PExpireAt ¶
func (r GroupGeneric) PExpireAt(ctx context.Context, key string, time time.Time, option ...gredis.ExpireOption) (int64, error)
PExpireAt has the same effect and semantic as ExpireAt, but the Unix time at which the key will expire is specified in milliseconds instead of seconds.
func (GroupGeneric) PExpireTime ¶
PExpireTime returns the expiration time of given `key`.
It returns: - -1 if the key exists but has no associated expiration time. - -2 if the key does not exist.
func (GroupGeneric) PTTL ¶
PTTL like TTL this command returns the remaining time to live of a key that has an expired set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.
In Redis 2.6 or older the command returns -1 if the key does not exist or if the key exist but has no associated expire.
It returns TTL in milliseconds, or a negative value in order to signal an error (see the description above).
https://redis.io/commands/pttl/
func (GroupGeneric) Persist ¶
Persist removes the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).
It returns: - 1 if the timeout was removed. - 0 if key does not exist or does not have an associated timeout.
func (GroupGeneric) RandomKey ¶
func (r GroupGeneric) RandomKey(ctx context.Context) (string, error)
RandomKey return a random key from the currently selected database.
It returns the random key, or nil when the database is empty.
func (GroupGeneric) Rename ¶
func (r GroupGeneric) Rename(ctx context.Context, key, newKey string) error
Rename renames key to newKey. It returns an error when key does not exist. If newKey already exists it is overwritten, when this happens RENAME executes an implicit DEL operation, so if the deleted key contains a very big value it may cause high latency even if RENAME itself is usually a constant-time operation.
In Cluster mode, both key and newKey must be in the same hash slot, meaning that in practice only keys that have the same hashtag can be reliably renamed in cluster.
func (GroupGeneric) RenameNX ¶
RenameNX renames key to newKey if newKey does not yet exist. It returns an error when key does not exist. In Cluster mode, both key and newKey must be in the same hash slot, meaning that in practice only keys that have the same hashtag can be reliably renamed in cluster.
It returns: - 1 if key was renamed to newKey. - 0 if newKey already exists.
func (GroupGeneric) TTL ¶
TTL returns the remaining time to live of a key that has a timeout. This introspection capability allows a Redis client to check how many seconds a given key will continue to be part of the dataset. In Redis 2.6 or older the command returns -1 if the key does not exist or if the key exist but has no associated expire.
Starting with Redis 2.8 the return value in case of error changed:
The command returns -2 if the key does not exist. The command returns -1 if the key exists but has no associated expire. See also the PTTL command that returns the same information with milliseconds resolution (Only available in Redis 2.6 or greater).
It returns TTL in seconds, or a negative value in order to signal an error (see the description above).
func (GroupGeneric) Type ¶
Type returns the string representation of the type of the value stored at key. The different types that can be returned are: string, list, set, zset, hash and stream.
It returns type of key, or none when key does not exist.
func (GroupGeneric) Unlink ¶
Unlink is very similar to DEL: it removes the specified keys. Just like DEL a key is ignored if it does not exist. However, the command performs the actual memory reclaiming in a different thread, so it is not blocking, while DEL is. This is where the command name comes from: the command just unlinks the keys from the keyspace. The actual removal will happen later asynchronously.
It returns the number of keys that were unlinked.
type GroupHash ¶
type GroupHash struct {
Operation gredis.AdapterOperation
}
GroupHash is the redis group object for hash operations.
func (GroupHash) HDel ¶
HDel removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored. If key does not exist, it is treated as an empty hash and this command returns 0.
It returns the number of fields that were removed from the hash, not including specified but non-existing fields.
func (GroupHash) HExists ¶
HExists returns if field is an existing field in the hash stored at key.
It returns: - 1 if the hash contains field. - 0 if the hash does not contain field, or key does not exist.
func (GroupHash) HGet ¶
HGet returns the value associated with field in the hash stored at key.
It returns the value associated with field, or nil when field is not present in the hash or key does not exist.
func (GroupHash) HGetAll ¶
HGetAll returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value, so the length of the reply is twice the size of the hash.
func (GroupHash) HIncrBy ¶
HIncrBy increments the number stored at field in the hash stored at key by increment. If key does not exist, a new key holding a hash is created. If field does not exist the value is set to 0 before the operation is performed.
The range of values supported by HIncrBy is limited to 64-bit signed integers.
func (GroupHash) HIncrByFloat ¶
func (r GroupHash) HIncrByFloat(ctx context.Context, key, field string, increment float64) (float64, error)
HIncrByFloat increments the specified field of a hash stored at key, and representing a floating point number, by the specified increment. If the increment value is negative, the result is to have the hash field value decremented instead of incremented. If the field does not exist, it is set to 0 before performing the operation. An error is returned if one of the following conditions occur:
The field contains a value of the wrong type (not a string). The current field content or the specified increment are not parsable as a double precision floating point number. The exact behavior of this command is identical to the one of the HIncrByFloat command, please refer to the documentation of HIncrByFloat for further information.
It returns the value of field after the increment.
func (GroupHash) HMGet ¶
HMGet return the values associated with the specified fields in the hash stored at key. For every field that does not exist in the hash, a nil value is returned. Because non-existing keys are treated as empty hashes, running HMGet against a non-existing key will return a list of nil values.
func (GroupHash) HMSet ¶
HMSet sets the specified fields to their respective values in the hash stored at key. This command overwrites any specified fields already existing in the hash. If key does not exist, a new key holding a hash is created.
func (GroupHash) HSet ¶
func (r GroupHash) HSet(ctx context.Context, key string, fields map[string]interface{}) (int64, error)
HSet sets field in the hash stored at key to value. If key does not exist, a new key holding a hash is created. If field already exists in the hash, it is overwritten.
It returns the number of fields that were added.
func (GroupHash) HSetNX ¶
HSetNX sets field in the hash stored at key to value, only if field does not yet exist. If key does not exist, a new key holding a hash is created. If field already exists, this operation has no effect.
It returns: - 1 if field is a new field in the hash and value was set. - 0 if field already exists in the hash and no operation was performed.
func (GroupHash) HStrLen ¶
HStrLen Returns the string length of the value associated with field in the hash stored at key. If the key or the field do not exist, 0 is returned.
It returns the string length of the value associated with field, or zero when field is not present in the hash or key does not exist at all.
type GroupList ¶
type GroupList struct {
Operation gredis.AdapterOperation
}
GroupList is the redis group list object.
func (GroupList) BLPop ¶
BLPop is a blocking list pop primitive. It is the blocking version of LPop because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the head of the first list that is non-empty, with the given keys being checked in the order that they are given.
The timeout argument is interpreted as a double value specifying the maximum number of seconds to block. A timeout of zero can be used to block indefinitely.
func (GroupList) BRPop ¶
BRPop is a blocking list pop primitive. It is the blocking version of RPop because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given.
The timeout argument is interpreted as a double value specifying the maximum number of seconds to block. A timeout of zero can be used to block indefinitely.
func (GroupList) BRPopLPush ¶
func (r GroupList) BRPopLPush(ctx context.Context, source, destination string, timeout int64) (*gvar.Var, error)
BRPopLPush is the blocking variant of RPopLPush. When source contains elements, this command behaves exactly like RPopLPush. When used inside a MULTI/EXEC block, this command behaves exactly like RPopLPush. When source is empty, Redis will block the connection until another // client pushes to it or until timeout is reached. A timeout of zero can be used to block indefinitely.
It returns the element being popped from source and pushed to destination. If timeout is reached, a Null reply is returned.
func (GroupList) LIndex ¶
LIndex return the element at index in the list stored at key. Returns the element at index in the list stored at key. The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth. When the value at key is not a list, an error is returned.
It returns the requested element, or nil when index is out of range.
func (GroupList) LInsert ¶
func (r GroupList) LInsert(ctx context.Context, key string, op gredis.LInsertOp, pivot, value interface{}) (int64, error)
LInsert inserts element in the list stored at key either before or after the reference value pivot. When key does not exist, it is considered an empty list and no operation is performed. An error is returned when key exists but does not hold a list value.
It returns the length of the list after the insert operation, or -1 when the value pivot was not found.
func (GroupList) LLen ¶
LLen returns the length of the list stored at key. Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. An error is returned when the value stored at key is not a list.
func (GroupList) LPop ¶
LPop remove and returns the first element of the list stored at key. Removes and returns the first elements of the list stored at key.
Starting with Redis version 6.2.0: Added the count argument.
By default, the command pops a single element from the beginning of the list. When provided with the optional count argument, the reply will consist of up to count elements, depending on the list's length.
Return When called without the count argument: Bulk string reply: the value of the first element, or nil when key does not exist.
When called with the count argument: Array reply: list of popped elements, or nil when key does not exist.
func (GroupList) LPush ¶
LPush inserts all the specified values at the head of the list stored at key Insert all the specified values at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.
It returns the length of the list after the push operations.
func (GroupList) LPushX ¶
func (r GroupList) LPushX(ctx context.Context, key string, element interface{}, elements ...interface{}) (int64, error)
LPushX insert value at the head of the list stored at key, only if key exists and holds a list. Inserts specified values at the head of the list stored at key, only if key already exists and holds a list. In contrary to LPush, no operation will be performed when key does not yet exist. Return Integer reply: the length of the list after the push operation.
It returns the length of the list after the push operations.
func (GroupList) LRange ¶
LRange returns the specified elements of the list stored at key. The offsets start and stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on.
These offsets can also be negative numbers indicating offsets starting at the end of the list. For example, -1 is the last element of the list, -2 the penultimate, and so on.
func (GroupList) LRem ¶
func (r GroupList) LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)
LRem removes the first count occurrences of elements equal to value from the list stored at key.
It returns the number of removed elements.
func (GroupList) LSet ¶
func (r GroupList) LSet(ctx context.Context, key string, index int64, value interface{}) (*gvar.Var, error)
LSet sets the list element at index to element. For more information on the index argument, see LIndex. An error is returned for out of range indexes.
func (GroupList) LTrim ¶
LTrim trims an existing list so that it will contain only the specified range of elements specified. Both start and stop are zero-based indexes, where 0 is the first element of the list (the head), 1 the next element and so on.
func (GroupList) RPop ¶
RPop remove and returns the last element of the list stored at key. Removes and returns the last elements of the list stored at key.
Starting with Redis version 6.2.0: Added the count argument.
By default, the command pops a single element from the end of the list. When provided with the optional count argument, the reply will consist of up to count elements, depending on the list's length.
It returns:
- When called without the count argument: the value of the last element, or nil when key does not exist.
- When called with the count argument: list of popped elements, or nil when key does not exist.
func (GroupList) RPopLPush ¶
RPopLPush remove the last element in list source, appends it to the front of list destination and returns it.
func (GroupList) RPush ¶
RPush inserts all the specified values at the tail of the list stored at key. Insert all the specified values at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation.
When key holds a value that is not a list, an error is returned. It is possible to push multiple elements using a single command call just specifying multiple arguments at the end of the command. Elements are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element. So for instance the command RPush mylist a b c will result into a list containing a as first element, b as second element and c as third element.
It returns the length of the list after the push operation.
func (GroupList) RPushX ¶
RPushX inserts value at the tail of the list stored at key, only if key exists and holds a list. Inserts specified values at the tail of the list stored at key, only if key already exists and holds a list.
In contrary to RPush, no operation will be performed when key does not yet exist.
It returns the length of the list after the push operation.
type GroupPubSub ¶
type GroupPubSub struct {
Operation gredis.AdapterOperation
}
GroupPubSub provides pub/sub functions for redis.
func (GroupPubSub) PSubscribe ¶
func (r GroupPubSub) PSubscribe( ctx context.Context, pattern string, patterns ...string, ) (gredis.Conn, []*gredis.Subscription, error)
PSubscribe subscribes the client to the given patterns.
Supported glob-style patterns: - h?llo subscribes to hello, hallo and hxllo - h*llo subscribes to hllo and heeeello - h[ae]llo subscribes to hello and hallo, but not hillo
Use \ to escape special characters if you want to match them verbatim.
func (GroupPubSub) Publish ¶
func (r GroupPubSub) Publish(ctx context.Context, channel string, message interface{}) (int64, error)
Publish posts a message to the given channel.
In a Redis Cluster clients can publish to every node. The cluster makes sure that published messages are forwarded as needed, so clients can subscribe to any channel by connecting to any one of the nodes.
It returns the number of clients that received the message. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count.
type GroupScript ¶
type GroupScript struct {
Operation gredis.AdapterOperation
}
GroupScript provides script functions for redis.
func (GroupScript) Eval ¶
func (r GroupScript) Eval(ctx context.Context, script string, numKeys int64, keys []string, args []interface{}) (*gvar.Var, error)
Eval invokes the execution of a server-side Lua script.
func (GroupScript) EvalSha ¶
func (r GroupScript) EvalSha(ctx context.Context, sha1 string, numKeys int64, keys []string, args []interface{}) (*gvar.Var, error)
EvalSha evaluates a script from the server's cache by its SHA1 digest.
The server caches scripts by using the SCRIPT LOAD command. The command is otherwise identical to EVAL.
func (GroupScript) ScriptExists ¶
func (r GroupScript) ScriptExists(ctx context.Context, sha1 string, sha1s ...string) (map[string]bool, error)
ScriptExists returns information about the existence of the scripts in the script cache.
It returns an array of integers that correspond to the specified SHA1 digest arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, a 1 is returned, otherwise 0 is returned.
func (GroupScript) ScriptFlush ¶
func (r GroupScript) ScriptFlush(ctx context.Context, option ...gredis.ScriptFlushOption) error
ScriptFlush flush the Lua scripts cache.
func (GroupScript) ScriptKill ¶
func (r GroupScript) ScriptKill(ctx context.Context) error
ScriptKill kills the currently executing EVAL script, assuming no write operation was yet performed by the script.
func (GroupScript) ScriptLoad ¶
ScriptLoad loads a script into the scripts cache, without executing it.
It returns the SHA1 digest of the script added into the script cache.
type GroupSet ¶
type GroupSet struct {
Operation gredis.AdapterOperation
}
GroupSet provides set functions for redis.
func (GroupSet) SAdd ¶
func (r GroupSet) SAdd(ctx context.Context, key string, member interface{}, members ...interface{}) (int64, error)
SAdd adds the specified members to the set stored at key. Specified members that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified members.
An error is returned when the value stored at key is not a set.
It returns the number of elements that were added to the set, not including all the elements already present in the set.
func (GroupSet) SCard ¶
SCard returns the set cardinality (number of elements) of the set stored at key.
It returns the cardinality (number of elements) of the set, or 0 if key does not exist.
func (GroupSet) SDiff ¶
SDiff returns the members of the set resulting from the difference between the first set and all the successive sets.
It returns list with members of the resulting set.
func (GroupSet) SDiffStore ¶
func (r GroupSet) SDiffStore(ctx context.Context, destination string, key string, keys ...string) (int64, error)
SDiffStore is equal to SDiff, but instead of returning the resulting set, it is stored in destination.
If destination already exists, it is overwritten.
It returns the number of elements in the resulting set.
func (GroupSet) SInter ¶
SInter returns the members of the set resulting from the intersection of all the given sets.
It returns list with members of the resulting set.
func (GroupSet) SInterStore ¶
func (r GroupSet) SInterStore(ctx context.Context, destination string, key string, keys ...string) (int64, error)
SInterStore is equal to SInter, but instead of returning the resulting set, it is stored in destination.
If destination already exists, it is overwritten.
It returns the number of elements in the resulting set.
func (GroupSet) SIsMember ¶
SIsMember returns if member is a member of the set stored at key.
It returns: - 1 if the element is a member of the set. - 0 if the element is not a member of the set, or if key does not exist.
func (GroupSet) SMIsMember ¶
func (r GroupSet) SMIsMember(ctx context.Context, key, member interface{}, members ...interface{}) ([]int, error)
SMIsMember returns whether each member is a member of the set stored at key.
For every member, 1 is returned if the value is a member of the set, or 0 if the element is not a member of the set or if key does not exist.
It returns list representing the membership of the given elements, in the same order as they are requested.
func (GroupSet) SMembers ¶
SMembers returns all the members of the set value stored at key. This has the same effect as running SINTER with one argument key.
It returns all elements of the set.
func (GroupSet) SMove ¶
func (r GroupSet) SMove(ctx context.Context, source, destination string, member interface{}) (int64, error)
SMove moves member from the set at source to the set at destination. This operation is atomic. In every given moment the element will appear to be a member of source or destination for other clients. If the source set does not exist or does not contain the specified element, no operation is performed and 0 is returned. Otherwise, the element is removed from the source set and added to the destination set. When the specified element already exists in the destination set, it is only removed from the source set.
An error is returned if source or destination does not hold a set value.
It returns: - 1 if the element is moved. - 0 if the element is not a member of source and no operation was performed.
func (GroupSet) SPop ¶
SPop removes and returns one or more random members from the set value store at key.
This operation is similar to SRandMember, that returns one or more random elements from a set but does not remove it. By default, the command pops a single member from the set. When provided with the optional count argument, the reply will consist of up to count members, depending on the set's cardinality.
It returns:
- When called without the count argument: Bulk string reply: the removed member, or nil when key does not exist.
- When called with the count argument: Array reply: the removed members, or an empty array when key does not exist.
func (GroupSet) SRandMember ¶
SRandMember called with just the key argument, return a random element from the set value stored at key. If the provided count argument is positive, return an array of distinct elements. The array's length is either count or the set's cardinality (SCard), whichever is lower. If called with a negative count, the behavior changes and the command is allowed to return the same element multiple times. In this case, the number of returned elements is the absolute value of the specified count.
It returns:
- Bulk string reply: without the additional count argument, the command returns a Bulk Reply with the randomly selected element, or nil when key does not exist.
- Array reply: when the additional count argument is passed, the command returns an array of elements, or an empty array when key does not exist.
func (GroupSet) SRem ¶
func (r GroupSet) SRem(ctx context.Context, key string, member interface{}, members ...interface{}) (int64, error)
SRem removes the specified members from the set stored at key. Specified members that are not a member of this set are ignored. If key does not exist, it is treated as an empty set and this command returns 0.
An error is returned when the value stored at key is not a set.
It returns the number of members that were removed from the set, not including non existing members.
func (GroupSet) SUnion ¶
SUnion returns the members of the set resulting from the union of all the given sets.
It returns list with members of the resulting set.
func (GroupSet) SUnionStore ¶
func (r GroupSet) SUnionStore(ctx context.Context, destination, key string, keys ...string) (int64, error)
SUnionStore is equal to SUnion, but instead of returning the resulting set, it is stored in destination.
If destination already exists, it is overwritten.
It returns the number of elements in the resulting set.
type GroupSortedSet ¶
type GroupSortedSet struct {
Operation gredis.AdapterOperation
}
GroupSortedSet provides sorted set functions for redis.
func (GroupSortedSet) ZAdd ¶
func (r GroupSortedSet) ZAdd( ctx context.Context, key string, option *gredis.ZAddOption, member gredis.ZAddMember, members ...gredis.ZAddMember, ) (*gvar.Var, error)
ZAdd adds all the specified members with the specified scores to the sorted set stored at key. It is possible to specify multiple score / member pairs. If a specified member is already a member of the sorted set, the score is updated and the element reinserted at the right position to ensure the correct ordering.
If key does not exist, a new sorted set with the specified members as sole members is created, like if the sorted set was empty. If the key exists but does not hold a sorted set, an error is returned.
The score values should be the string representation of a double precision floating point number. +inf and -inf values are valid values as well.
It returns: - When used without optional arguments, the number of elements added to the sorted set (excluding score updates). - If the CH option is specified, the number of elements that were changed (added or updated).
If the INCR option is specified, the return value will be Bulk string reply:
- The new score of member (a double precision floating point number) represented as string, or nil if the operation was aborted (when called with either the XX or the NX option).
func (GroupSortedSet) ZCard ¶
ZCard returns the sorted set cardinality (number of elements) of the sorted set stored at key.
It returns the cardinality (number of elements) of the sorted set, or 0 if key does not exist.
func (GroupSortedSet) ZCount ¶
ZCount returns the number of elements in the sorted set at key with a score between min and max.
The min and max arguments have the same semantic as described for ZRangeByScore.
Note: the command has a complexity of just O(log(N)) because it uses elements ranks (see ZRANK) to get an idea of the range. Because of this there is no need to do a work proportional to the size of the range.
It returns the number of elements in the specified score range.
func (GroupSortedSet) ZIncrBy ¶
func (r GroupSortedSet) ZIncrBy(ctx context.Context, key string, increment float64, member interface{}) (float64, error)
ZIncrBy increments the score of member in the sorted set stored at key by increment. If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0). If key does not exist, a new sorted set with the specified member as its sole member is created.
An error is returned when key exists but does not hold a sorted set.
The score value should be the string representation of a numeric value, and accepts double precision floating point numbers. It is possible to provide a negative value to decrement the score.
It returns the new score of member (a double precision floating point number).
func (GroupSortedSet) ZLexCount ¶
ZLexCount all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.
The min and max arguments have the same meaning as described for ZRangeByLex.
Note: the command has a complexity of just O(log(N)) because it uses elements ranks (see ZRank) to get an idea of the range. Because of this there is no need to do a work proportional to the size of the range.
It returns the number of elements in the specified score range.
func (GroupSortedSet) ZRange ¶
func (r GroupSortedSet) ZRange(ctx context.Context, key string, start, stop int64, option ...gredis.ZRangeOption) (gvar.Vars, error)
ZRange return the specified range of elements in the sorted set stored at <key>.
ZRange can perform different types of range queries: by index (rank), by the score, or by lexicographical order.
func (GroupSortedSet) ZRank ¶
ZRank returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. The rank (or index) is 0-based, which means that the member with the lowest score has rank 0.
Use ZRevRank to get the rank of an element with the scores ordered from high to low.
It returns: - If member exists in the sorted set, Integer reply: the rank of member. - If member does not exist in the sorted set or key does not exist, Bulk string reply: nil.
func (GroupSortedSet) ZRem ¶
func (r GroupSortedSet) ZRem(ctx context.Context, key string, member interface{}, members ...interface{}) (int64, error)
ZRem remove the specified members from the sorted set stored at key. Non-existing members are ignored.
An error is returned when key exists and does not hold a sorted set.
It returns the number of members removed from the sorted set, not including non existing members.
func (GroupSortedSet) ZRemRangeByLex ¶
func (r GroupSortedSet) ZRemRangeByLex(ctx context.Context, key string, min, max string) (int64, error)
ZRemRangeByLex removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.
The meaning of min and max are the same of the ZRangeByLex command. Similarly, this command actually removes the same elements that ZRangeByLex would return if called with the same min and max arguments.
It returns the number of elements removed.
func (GroupSortedSet) ZRemRangeByRank ¶
func (r GroupSortedSet) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error)
ZRemRangeByRank removes all elements in the sorted set stored at key with rank between start and stop. Both start and stop are 0 -based indexes with 0 being the element with the lowest score.
These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score. For example: -1 is the element with the highest score, -2 the element with the second-highest score and so forth.
It returns the number of elements removed.
func (GroupSortedSet) ZRemRangeByScore ¶
func (r GroupSortedSet) ZRemRangeByScore(ctx context.Context, key string, min, max string) (int64, error)
ZRemRangeByScore removes all elements in the sorted set stored at key with a score between min and max (inclusive).
It returns the number of elements removed.
func (GroupSortedSet) ZRevRange ¶
func (r GroupSortedSet) ZRevRange(ctx context.Context, key string, start, stop int64, option ...gredis.ZRevRangeOption) (*gvar.Var, error)
ZRevRange returns the specified range of elements in the sorted set stored at key. The elements are considered to be ordered from the highest to the lowest score. Descending lexicographical order is used for elements with equal score.
Apart from the reversed ordering, ZRevRange is similar to ZRange.
It returns list of elements in the specified range (optionally with their scores).
func (GroupSortedSet) ZRevRank ¶
func (r GroupSortedSet) ZRevRank(ctx context.Context, key string, member interface{}) (int64, error)
ZRevRank returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. The rank (or index) is 0-based, which means that the member with the highest score has rank 0.
Use ZRank to get the rank of an element with the scores ordered from low to high.
It returns: - If member exists in the sorted set, Integer reply: the rank of member. - If member does not exist in the sorted set or key does not exist, Bulk string reply: nil.
func (GroupSortedSet) ZScore ¶
func (r GroupSortedSet) ZScore(ctx context.Context, key string, member interface{}) (float64, error)
ZScore Returns the score of member in the sorted set at key.
If member does not exist in the sorted set, or key does not exist, nil is returned.
It returns the score of member (a double precision floating point number), represented as string.
type GroupString ¶
type GroupString struct {
Operation gredis.AdapterOperation
}
GroupString is the function group manager for string operations.
func (GroupString) Append ¶
Append appends the value at the end of the string, if key already exists and is a string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
func (GroupString) Get ¶
Get the value of key. If the key does not exist the special value nil is returned. An error is returned if the value stored at key is not a string, because GET only handles string values.
func (GroupString) GetDel ¶
GetDel gets the value of key and delete the key. This command is similar to GET, except for the fact that it also deletes the key on success (if and only if the key's value type is a string).
func (GroupString) GetEX ¶
func (r GroupString) GetEX(ctx context.Context, key string, option ...gredis.GetEXOption) (*gvar.Var, error)
GetEX is similar to GET, but is a write command with additional options.
func (GroupString) GetRange ¶
GetRange returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive). Negative offsets can be used in order to provide an offset starting from the end of the string. So -1 means the last character, -2 the penultimate and so forth.
The function handles out of range requests by limiting the resulting range to the actual length of the string.
func (GroupString) GetSet ¶
GetSet atomically sets key to value and returns the old value stored at key. Returns an error when key exists but does not hold a string value. Any previous time to live associated with the key is discarded on successful SET operation.
func (GroupString) Incr ¶
Incr increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bits signed integers.
func (GroupString) IncrBy ¶
IncrBy increments the number stored at key by increment. If the key does not exist, it is set to 0 before performing the operation.
An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer. This operation is limited to 64 bits signed integers.
func (GroupString) IncrByFloat ¶
func (r GroupString) IncrByFloat(ctx context.Context, key string, increment float64) (float64, error)
IncrByFloat increments the string representing a floating point number stored at key by the specified increment.
func (GroupString) MSet ¶
func (r GroupString) MSet(ctx context.Context, keyValueMap map[string]interface{}) error
MSet sets the given keys to their respective values. MSet replaces existing values with new values, just as regular SET. See MSetNX if you don't want to overwrite existing values.
MSet is atomic, so all given keys are set at once. It is not possible for clients to see that some keys were updated while others are unchanged.
func (GroupString) MSetNX ¶
MSetNX sets the given keys to their respective values.
It returns: true: if the all the keys were set. false: if no key was set (at least one key already existed).
func (GroupString) Set ¶
func (r GroupString) Set(ctx context.Context, key string, value interface{}, option ...gredis.SetOption) (*gvar.Var, error)
Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.
func (GroupString) SetEX ¶
func (r GroupString) SetEX(ctx context.Context, key string, value interface{}, ttlInSeconds int64) error
SetEX sets key to hold the string value and set key to timeout after a given number of seconds. This command is equivalent to executing the following commands:
SET myKey value EXPIRE myKey seconds
SetEX is atomic, and can be reproduced by using the previous two commands inside an MULTI / EXEC block. It is provided as a faster alternative to the given sequence of operations, because this operation is very common when Redis is used as a cache.
An error is returned when seconds invalid.
func (GroupString) SetNX ¶
SetNX sets key to hold string value if key does not exist. In that case, it is equal to SET. When key already holds a value, no operation is performed. SetNX is short for "SET if Not exists".
It returns: true: if the all the keys were set. false: if no key was set (at least one key already existed).
func (GroupString) SetRange ¶
func (r GroupString) SetRange(ctx context.Context, key string, offset int64, value string) (int64, error)
SetRange overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. If the offset is larger than the current length of the string at key, the string is padded with zero-bytes to make offset fit. Non-existing keys are considered as empty strings, so this command will make sure it holds a string large enough to be able to set value at offset.
It returns the length of the string after it was modified by the command.
type Redis ¶
type Redis struct { gredis.AdapterOperation // contains filtered or unexported fields }
Redis is an implement of Adapter using go-redis.
func (*Redis) Close ¶
Close closes the redis connection pool, which will release all connections reserved by this pool. It is commonly not necessary to call Close manually.
func (*Redis) Conn ¶
Conn retrieves and returns a connection object for continuous operations. Note that you should call Close function manually if you do not use this connection any further.
func (*Redis) Do ¶
Do send a command to the server and returns the received reply. It uses json.Marshal for struct/slice/map type values before committing them to redis.
func (*Redis) GroupGeneric ¶
func (r *Redis) GroupGeneric() gredis.IGroupGeneric
GroupGeneric creates and returns GroupGeneric.
func (*Redis) GroupHash ¶
func (r *Redis) GroupHash() gredis.IGroupHash
GroupHash creates and returns a redis group object for hash operations.
func (*Redis) GroupList ¶
func (r *Redis) GroupList() gredis.IGroupList
GroupList creates and returns a redis group object for list operations.
func (*Redis) GroupPubSub ¶
func (r *Redis) GroupPubSub() gredis.IGroupPubSub
GroupPubSub creates and returns GroupPubSub.
func (*Redis) GroupScript ¶
func (r *Redis) GroupScript() gredis.IGroupScript
GroupScript creates and returns GroupScript.
func (*Redis) GroupSortedSet ¶
func (r *Redis) GroupSortedSet() gredis.IGroupSortedSet
GroupSortedSet creates and returns GroupSortedSet.
func (*Redis) GroupString ¶
func (r *Redis) GroupString() gredis.IGroupString
GroupString is the redis group object for string operations.