|
|
@ -54,6 +54,7 @@ type (
|
|
|
|
Setex(key, value string, seconds int) error
|
|
|
|
Setex(key, value string, seconds int) error
|
|
|
|
Setnx(key, value string) (bool, error)
|
|
|
|
Setnx(key, value string) (bool, error)
|
|
|
|
SetnxEx(key, value string, seconds int) (bool, error)
|
|
|
|
SetnxEx(key, value string, seconds int) (bool, error)
|
|
|
|
|
|
|
|
Getset(key, value string) (string, error)
|
|
|
|
Sismember(key string, value interface{}) (bool, error)
|
|
|
|
Sismember(key string, value interface{}) (bool, error)
|
|
|
|
Smembers(key string) ([]string, error)
|
|
|
|
Smembers(key string) ([]string, error)
|
|
|
|
Spop(key string) (string, error)
|
|
|
|
Spop(key string) (string, error)
|
|
|
@ -459,6 +460,15 @@ func (cs clusterStore) SetnxEx(key, value string, seconds int) (bool, error) {
|
|
|
|
return node.SetnxEx(key, value, seconds)
|
|
|
|
return node.SetnxEx(key, value, seconds)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (cs clusterStore) Getset(key, value string) (string, error) {
|
|
|
|
|
|
|
|
node, err := cs.getRedis(key)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return "", err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return node.GetSet(key, value)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (cs clusterStore) Sismember(key string, value interface{}) (bool, error) {
|
|
|
|
func (cs clusterStore) Sismember(key string, value interface{}) (bool, error) {
|
|
|
|
node, err := cs.getRedis(key)
|
|
|
|
node, err := cs.getRedis(key)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|