Skip to content

Commit 1a1456d

Browse files
committed
Generate new HGETDEL, HGETEX, HSETEX command builders
Signed-off-by: win5923 <ken89@kimo.com>
1 parent 9c59b24 commit 1a1456d

File tree

4 files changed

+537
-1
lines changed

4 files changed

+537
-1
lines changed

hack/cmds/commands.json

+178
Original file line numberDiff line numberDiff line change
@@ -3087,6 +3087,184 @@
30873087
"since": "2.0.0",
30883088
"group": "hash"
30893089
},
3090+
"HGETDEL": {
3091+
"summary": "Returns the value of a field and deletes it from the hash",
3092+
"complexity": "O(N) where N is the number of specified fields",
3093+
"arguments": [
3094+
{
3095+
"name": "key",
3096+
"type": "key",
3097+
"key_spec_index": 0
3098+
},
3099+
{
3100+
"name": "fields",
3101+
"token": "FIELDS",
3102+
"type": "block",
3103+
"arguments": [
3104+
{
3105+
"name": "numfields",
3106+
"type": "integer"
3107+
},
3108+
{
3109+
"name": "field",
3110+
"type": "string",
3111+
"multiple": true
3112+
}
3113+
]
3114+
}
3115+
],
3116+
"since": "8.0.0",
3117+
"group": "hash"
3118+
},
3119+
"HGETEX": {
3120+
"summary": "Get the value of one or more fields of a given hash key, and optionally set their expiration.",
3121+
"complexity": "O(N) where N is the number of specified fields",
3122+
"arguments": [
3123+
{
3124+
"name": "key",
3125+
"type": "key",
3126+
"key_spec_index": 0
3127+
},
3128+
{
3129+
"name": "expiration",
3130+
"type": "oneof",
3131+
"optional": true,
3132+
"arguments": [
3133+
{
3134+
"name": "seconds",
3135+
"type": "integer",
3136+
"token": "EX"
3137+
},
3138+
{
3139+
"name": "milliseconds",
3140+
"type": "integer",
3141+
"token": "PX"
3142+
},
3143+
{
3144+
"name": "unix-time-seconds",
3145+
"type": "unix-time",
3146+
"token": "EXAT"
3147+
},
3148+
{
3149+
"name": "unix-time-milliseconds",
3150+
"type": "unix-time",
3151+
"token": "PXAT"
3152+
},
3153+
{
3154+
"name": "persist",
3155+
"type": "pure-token",
3156+
"token": "PERSIST"
3157+
}
3158+
]
3159+
},
3160+
{
3161+
"name": "fields",
3162+
"token": "FIELDS",
3163+
"type": "block",
3164+
"arguments": [
3165+
{
3166+
"name": "numfields",
3167+
"type": "integer"
3168+
},
3169+
{
3170+
"name": "field",
3171+
"type": "string",
3172+
"multiple": true
3173+
}
3174+
]
3175+
}
3176+
],
3177+
"since": "8.0.0",
3178+
"group": "hash"
3179+
},
3180+
"HSETEX": {
3181+
"summary": "Set the value of one or more fields of a given hash key, and optionally set their expiration.",
3182+
"complexity": "O(N) where N is the number of fields being set.",
3183+
"arguments": [
3184+
{
3185+
"name": "key",
3186+
"type": "key",
3187+
"key_spec_index": 0
3188+
},
3189+
{
3190+
"name": "condition",
3191+
"type": "oneof",
3192+
"optional": true,
3193+
"arguments": [
3194+
{
3195+
"name": "fnx",
3196+
"type": "pure-token",
3197+
"token": "FNX"
3198+
},
3199+
{
3200+
"name": "fxx",
3201+
"type": "pure-token",
3202+
"token": "FXX"
3203+
}
3204+
]
3205+
},
3206+
{
3207+
"name": "expiration",
3208+
"type": "oneof",
3209+
"optional": true,
3210+
"arguments": [
3211+
{
3212+
"name": "seconds",
3213+
"type": "integer",
3214+
"token": "EX"
3215+
},
3216+
{
3217+
"name": "milliseconds",
3218+
"type": "integer",
3219+
"token": "PX"
3220+
},
3221+
{
3222+
"name": "unix-time-seconds",
3223+
"type": "unix-time",
3224+
"token": "EXAT"
3225+
},
3226+
{
3227+
"name": "unix-time-milliseconds",
3228+
"type": "unix-time",
3229+
"token": "PXAT"
3230+
},
3231+
{
3232+
"name": "keepttl",
3233+
"type": "pure-token",
3234+
"token": "KEEPTTL"
3235+
}
3236+
]
3237+
},
3238+
{
3239+
"name": "fields",
3240+
"token": "FIELDS",
3241+
"type": "block",
3242+
"arguments": [
3243+
{
3244+
"name": "numfields",
3245+
"type": "integer"
3246+
},
3247+
{
3248+
"name": "data",
3249+
"type": "block",
3250+
"multiple": true,
3251+
"arguments": [
3252+
{
3253+
"name": "field",
3254+
"type": "string"
3255+
},
3256+
{
3257+
"name": "value",
3258+
"type": "string"
3259+
}
3260+
]
3261+
}
3262+
]
3263+
}
3264+
],
3265+
"since": "8.0.0",
3266+
"group": "hash"
3267+
},
30903268
"HINCRBY": {
30913269
"summary": "Increment the integer value of a hash field by the given number",
30923270
"complexity": "O(1)",

hack/cmds/gen.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ func toGoType(paramType string) string {
681681
return "string"
682682
case "double":
683683
return "float64"
684-
case "integer", "posix time":
684+
case "integer", "posix time", "unix-time":
685685
return "int64"
686686
case "unsigned integer":
687687
return "uint64"

0 commit comments

Comments
 (0)