|
|
@ -73,6 +73,7 @@ type (
|
|
|
|
ZrevrangebyscoreWithScores(key string, start, stop int64) ([]redis.Pair, error)
|
|
|
|
ZrevrangebyscoreWithScores(key string, start, stop int64) ([]redis.Pair, error)
|
|
|
|
ZrevrangebyscoreWithScoresAndLimit(key string, start, stop int64, page, size int) ([]redis.Pair, error)
|
|
|
|
ZrevrangebyscoreWithScoresAndLimit(key string, start, stop int64, page, size int) ([]redis.Pair, error)
|
|
|
|
Zscore(key string, value string) (int64, error)
|
|
|
|
Zscore(key string, value string) (int64, error)
|
|
|
|
|
|
|
|
Zrevrank(key, field string) (int64, error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
clusterStore struct {
|
|
|
|
clusterStore struct {
|
|
|
@ -644,6 +645,15 @@ func (cs clusterStore) Zscore(key string, value string) (int64, error) {
|
|
|
|
return node.Zscore(key, value)
|
|
|
|
return node.Zscore(key, value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (cs clusterStore) Zrevrank(key, field string) (int64, error) {
|
|
|
|
|
|
|
|
node, err := cs.getRedis(key)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return 0, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return node.Zrevrank(key, field)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (cs clusterStore) getRedis(key string) (*redis.Redis, error) {
|
|
|
|
func (cs clusterStore) getRedis(key string) (*redis.Redis, error) {
|
|
|
|
if val, ok := cs.dispatcher.Get(key); !ok {
|
|
|
|
if val, ok := cs.dispatcher.Get(key); !ok {
|
|
|
|
return nil, ErrNoRedisNode
|
|
|
|
return nil, ErrNoRedisNode
|
|
|
|