mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
优化redis eval的key重命名
This commit is contained in:
@ -20,7 +20,7 @@ const (
|
||||
|
||||
var Nil = redis.Nil
|
||||
|
||||
type ReidsOption struct {
|
||||
type RedisOption struct {
|
||||
Addr string
|
||||
Addrs []string
|
||||
Password string // 密码
|
||||
@ -67,7 +67,7 @@ type redisClient struct {
|
||||
separator string
|
||||
}
|
||||
|
||||
func New(opt *ReidsOption) redisClient {
|
||||
func New(opt *RedisOption) redisClient {
|
||||
var rdb redisClient
|
||||
|
||||
if len(opt.Addrs) == 0 && len(opt.Addr) > 0 {
|
||||
@ -114,12 +114,6 @@ func New(opt *ReidsOption) redisClient {
|
||||
return rdb
|
||||
}
|
||||
|
||||
func (rdb redisClient) Eval(ctx context.Context, script string, keys []string, args ...interface{}) *redis.Cmd {
|
||||
newKeys := rdb.FormatKeys(keys...)
|
||||
|
||||
return rdb.UniversalClient.Eval(ctx, script, newKeys, args...)
|
||||
}
|
||||
|
||||
func (rdb redisClient) Prefix() string {
|
||||
return rdb.prefix
|
||||
}
|
||||
|
Reference in New Issue
Block a user