Skip to content

Commit

Permalink
chore: use enum for STORE/STOREDIST of GEORADIUS in commands.json
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Sep 10, 2023
1 parent c2ec5fb commit 73da7f7
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 144 deletions.
29 changes: 11 additions & 18 deletions hack/cmds/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -2115,15 +2115,11 @@
"optional": true
},
{
"command": "STORE",
"name": "key",
"type": "key",
"optional": true
},
{
"command": "STOREDIST",
"name": "key",
"type": "key",
"type": "enum",
"enum": [
"STORE key",
"STOREDIST key"
],
"optional": true
}
],
Expand Down Expand Up @@ -2210,15 +2206,12 @@
"optional": true
},
{
"command": "STORE",
"name": "key",
"type": "key",
"optional": true
},
{
"command": "STOREDIST",
"name": "key",
"type": "key",
"name": "store",
"type": "enum",
"enum": [
"STORE key",
"STOREDIST key"
],
"optional": true
}
],
Expand Down
4 changes: 4 additions & 0 deletions hack/cmds/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ func (n *node) GoStructs() (out []goStruct) {
}
} else {
switch cmds[1] {
case "key":
s.BuildDef.Command = append(s.BuildDef.Command, cmds[:1]...)
s.BuildDef.Parameters = []parameter{{Name: lcFirst(name(cmds[1])), Type: "key"}}
s.BuildDef.MethodName = strings.TrimSuffix(s.BuildDef.MethodName, "Key")
case "name", "category", "pattern":
s.BuildDef.Command = append(s.BuildDef.Command, cmds[:1]...)
s.BuildDef.Parameters = []parameter{{Name: lcFirst(name(cmds[1])), Type: "string"}}
Expand Down
Loading

0 comments on commit 73da7f7

Please sign in to comment.