Skip to content

Commit

Permalink
add the custom commands of TairString、TairHash and TairZset
Browse files Browse the repository at this point in the history
Signed-off-by: liyaojie <[email protected]>
  • Loading branch information
lyj199907 committed Aug 24, 2023
1 parent 53f1058 commit d5d2afa
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 11 deletions.
76 changes: 65 additions & 11 deletions internal/commands/table.go
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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,
},
},
},
}
29 changes: 29 additions & 0 deletions scripts/commands/exhset.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
]
}
}
29 changes: 29 additions & 0 deletions scripts/commands/exset.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
]
}
}
29 changes: 29 additions & 0 deletions scripts/commands/exzadd.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
]
}
}

0 comments on commit d5d2afa

Please sign in to comment.