-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V1.7.x redis 插件 #139
base: v1.7.x
Are you sure you want to change the base?
V1.7.x redis 插件 #139
Conversation
1 . Type : list 的时候,Del 事件的时候,数据被 lrem 删除了,list 旧版本中,数据是不会被 删除的,不管什么逻辑,都是 lpush 的方式写入
在 insert ,update 指令的时候,写新数据进去,不是会被复盖吗? 需要自行操作一次 del ?
keyConfig : {$SchemaName}-{$TableName}-{$} 等是否会更好一点?
(ps: filedName 替换为字段名 字段必须勾选才能替换) 加上,不选字段的情况下,默认全选 5 缺少单元测试 参考进行修改 ` import ( func getParamByType(Type string,DataType string) map[string]interface{}{
} var TypeArr = []string{"list","set","hash","sadd","zset"} func InsertDataFun(Type string,DataType string) error { func UpdateDataFun(Type string,DataType string) error { func DelDataFun(Type string,DataType string) error { // 执行完,去 redis 查看 key 数据对否 // 执行完,去 redis 查看 key 数据对否 // 执行完,去 redis 查看 key 数据对否 // 执行完,去 redis 查看 key 数据对否 // 先执行 TestInsertByAllTypeAndCustom 再执TestDelByAllTypeAndCustom 行去 redis 查看 key 数据对否 ` |
说明文档:
Type
key=>value : SET 命令写入数据
List : LPUSH 命令写入数据
Hash : HSET 命令写入数据
Zset : ZSET 命令写入数据
SET : SADD 命令写入数据
DataType
custom : 指定写入哪些数据, 选择这个,通过 Value 参数编辑数据
auto json : 自动将选择中的Fields 进行json 写入Redis
Key
Redis 写入数据时候的key值,{$SchemaName},{$TableName},{$EventType},{$"+filedName+"} 标签将会替换成数据库名 ,表名 ,事件类型 , 甚至字段内容
HashKey
Redis 写入Hash数据时候的key值,{$SchemaName},{$TableName},{$EventType},{$"+filedName+"} 标签将会替换成数据库名 ,表名 ,事件类型 , 甚至字段内容
Sort
Redis 写入Sorted set 数据时候的sort值 标签会自动替换为 {$"+filedName+"} 字段内容, *****请确保改字段是数字类型*****, 如果不是将自动使用 0
Custom Value
自定义写入Redis 的内容当DataType == Custom 的时候 , 同样会标签替换 替换规则: {$SchemaName},{$TableName},{$EventType},{$"+filedName+"}
Expired
key=>value 消息过期时间,单位秒. *****注意: 仅 key=>value 支持*****,必须为 int 类型,默认为0,不过期, CRUD 会同步到redis 上, 该参数一般不需要设置
全部类型 测试 写入json
Zset 类型 测试 写入 自定义内容