升级redis client实现
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
package abstract
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.zhangdeman.cn/zhangdeman/redis/define"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@ -18,9 +20,11 @@ import (
|
||||
//
|
||||
// Date : 15:09 2024/6/18
|
||||
type IRedisClient interface {
|
||||
GetRealClient(instanceFlag string) *redis.ClusterClient // 获取客户端连接
|
||||
GetRealClientWithError(instanceFlag string) (*redis.ClusterClient, error) // 获取带error的客户端连接
|
||||
AddClient(instanceFlag string, instanceConfig *redis.ClusterOptions) error // 添加新的客户端连接
|
||||
RemoveClient(instanceFlag string) // 移除一个客户端连接
|
||||
SetLogger(loggerInstance *zap.Logger) // 设置日志实例
|
||||
GetRealClient(instanceFlag string) *redis.ClusterClient // 获取客户端连接
|
||||
GetRealClientWithError(instanceFlag string) (*redis.ClusterClient, error) // 获取带error的客户端连接
|
||||
AddClient(instanceFlag string, instanceConfig *redis.ClusterOptions) error // 添加新的客户端连接
|
||||
RemoveClient(instanceFlag string) // 移除一个客户端连接
|
||||
SetLogger(loggerInstance *zap.Logger) // 设置日志实例, 全局生效, 而非针对某一个实例
|
||||
Exec(ctx context.Context, instanceFlag string, command string, args ...any) *define.RedisResult // 执行任意命令
|
||||
SetCommandWhiteList(command []string) // 设置命令的白名单,全局生效, 而非单独针对某一个实例
|
||||
}
|
||||
|
Reference in New Issue
Block a user