add the custom commands of TairString、TairHash and TairZset

Signed-off-by: liyaojie <lyj199907@outlook.com>
v4
liyaojie 1 year ago committed by suxb201
parent f15e13eb06
commit 8e1cd0fb9c
  1. 76
      internal/commands/table.go
  2. 29
      scripts/commands/exhset.json
  3. 29
      scripts/commands/exset.json
  4. 29
      scripts/commands/exzadd.json

@ -1,22 +1,22 @@
package commands
var containers = map[string]bool{
"XINFO": true,
"COMMAND": true,
"FUNCTION": true,
"CONFIG": true,
"MODULE": true,
"MEMORY": true,
"LATENCY": true,
"SCRIPT": true,
"ACL": true,
"CLUSTER": true,
"CLIENT": true,
"XGROUP": true,
"PUBSUB": true,
"COMMAND": true,
"SLOWLOG": true,
"OBJECT": true,
"MEMORY": true,
"CONFIG": true,
"FUNCTION": true,
"LATENCY": true,
"XINFO": true,
"CLIENT": true,
"SENTINEL": true,
"SLOWLOG": true,
"PUBSUB": true,
"SCRIPT": true,
"ACL": true,
}
var redisCommands = map[string]redisCommand{
"LLEN": {
@ -4505,4 +4505,58 @@ var redisCommands = map[string]redisCommand{
},
},
},
"EXHSET": {
"TAIRHASH",
[]keySpec{
{
"index",
1,
"",
0,
"range",
0,
1,
0,
0,
0,
0,
},
},
},
"EXSET": {
"TAIRSTRING",
[]keySpec{
{
"index",
1,
"",
0,
"range",
0,
1,
0,
0,
0,
0,
},
},
},
"EXZADD": {
"TAIRZSET",
[]keySpec{
{
"index",
1,
"",
0,
"range",
0,
1,
0,
0,
0,
0,
},
},
},
}

@ -0,0 +1,29 @@
{
"EXHSET": {
"summary": "TairHash, Insert a field into the TairHash specified by the key",
"complexity": "O(1)",
"group": "TairHash",
"container": "TairHash",
"function": "exhsetCommand",
"key_specs": [
{
"flags": [
"RW",
"UPDATE"
],
"begin_search": {
"index": {
"pos": 1
}
},
"find_keys": {
"range": {
"lastkey": 0,
"step": 1,
"limit": 0
}
}
}
]
}
}

@ -0,0 +1,29 @@
{
"EXSET": {
"summary": "TairString, Set the value of a key",
"complexity": "O(1)",
"group": "TairString",
"container": "TairString",
"function": "exsetCommand",
"key_specs": [
{
"flags": [
"RW",
"UPDATE"
],
"begin_search": {
"index": {
"pos": 1
}
},
"find_keys": {
"range": {
"lastkey": 0,
"step": 1,
"limit": 0
}
}
}
]
}
}

@ -0,0 +1,29 @@
{
"EXZADD": {
"summary": "TairZset, Adds all the specified members with the specified (multi)scores to the tairzset stored at key",
"complexity": "O(N)",
"group": "TairZset",
"container": "TairZset",
"function": "exzaddCommand",
"key_specs": [
{
"flags": [
"RW",
"UPDATE"
],
"begin_search": {
"index": {
"pos": 1
}
},
"find_keys": {
"range": {
"lastkey": 0,
"step": 1,
"limit": 0
}
}
}
]
}
}
Loading…
Cancel
Save