增加常用写命令枚举
This commit is contained in:
11
client.go
11
client.go
@ -9,6 +9,7 @@ package redis
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.zhangdeman.cn/zhangdeman/consts"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@ -209,7 +210,15 @@ func (o *OwnClient) SetLogger(loggerInstance *zap.Logger, extraLogFieldList []st
|
||||
//
|
||||
// Date : 16:22 2024/10/8
|
||||
func (o *OwnClient) isWriteCommand(command string) bool {
|
||||
return wrapperOperate.ArrayType([]string{}).Has(strings.ToUpper(command)) >= 0
|
||||
return wrapperOperate.ArrayType([]string{
|
||||
consts.RedisCommandDel,
|
||||
consts.RedisCommandSet,
|
||||
consts.RedisCommandLpush,
|
||||
consts.RedisCommandRpush,
|
||||
consts.RedisCommandMSet,
|
||||
consts.RedisCommandPublish,
|
||||
consts.RedisCommandPsubScribe,
|
||||
}).Has(strings.ToUpper(command)) >= 0
|
||||
}
|
||||
|
||||
// newClient 获取客户端连接
|
||||
|
Reference in New Issue
Block a user