add redis Zrevrank (#137)

* update goctl rpc template log print url

* add redis Zrevrank

Co-authored-by: zhangkai <zhangkai@laoyuegou.com>
This commit is contained in:
mywaystay
2020-10-19 15:30:19 +08:00
committed by GitHub
parent 81bf122fa4
commit 33faab61a3
3 changed files with 27 additions and 0 deletions

View File

@@ -1273,6 +1273,20 @@ func (s *Redis) ZrevrangebyscoreWithScoresAndLimit(key string, start, stop int64
return
}
func (s *Redis) Zrevrank(key string, field string) (val int64, err error) {
err = s.brk.DoWithAcceptable(func() error {
conn, err := getRedis(s)
if err != nil {
return err
}
val, err = conn.ZRevRank(key, field).Result()
return err
}, acceptable)
return
}
func (s *Redis) String() string {
return s.Addr
}