summaryrefslogtreecommitdiff
path: root/runtest-moduleapi
diff options
context:
space:
mode:
authorViktor Söderqvist <viktor.soderqvist@est.tech>2022-02-04 20:09:36 +0100
committerGitHub <noreply@github.com>2022-02-04 21:09:36 +0200
commit0a82fe844765e3c49d4807fcb8562342f88dffaf (patch)
treea9d95e1c908afc7a1f95a69e7300dd03f2f701f2 /runtest-moduleapi
parentd7fcb3c5a16dce188728b0c2ab3a2a0df9bb5e2a (diff)
downloadredis-0a82fe844765e3c49d4807fcb8562342f88dffaf.tar.gz
Command info module API (#10108)
Adds RM_SetCommandInfo, allowing modules to provide the following command info: * summary * complexity * since * history * hints * arity * key specs * args This information affects the output of `COMMAND`, `COMMAND INFO` and `COMMAND DOCS`, Cluster, ACL and is used to filter commands with the wrong number of arguments before the call reaches the module code. The recently added API functions for key specs (never released) are removed. A minimalist example would look like so: ```c RedisModuleCommand *mycmd = RedisModule_GetCommand(ctx,"mymodule.mycommand"); RedisModuleCommandInfo mycmd_info = { .version = REDISMODULE_COMMAND_INFO_VERSION, .arity = -5, .summary = "some description", }; if (RedisModule_SetCommandInfo(mycmd, &mycmd_info) == REDISMODULE_ERR) return REDISMODULE_ERR; ```` Notes: * All the provided information (including strings) is copied, not keeping references to the API input data. * The version field is actually a static struct that contains the sizes of the the structs used in arrays, so we can extend these in the future and old version will still be able to take the part they can support.
Diffstat (limited to 'runtest-moduleapi')
-rwxr-xr-xruntest-moduleapi2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtest-moduleapi b/runtest-moduleapi
index d13425f81..a3aab1f7a 100755
--- a/runtest-moduleapi
+++ b/runtest-moduleapi
@@ -44,7 +44,7 @@ $TCLSH tests/test_helper.tcl \
--single unit/moduleapi/aclcheck \
--single unit/moduleapi/subcommands \
--single unit/moduleapi/reply \
+--single unit/moduleapi/cmdintrospection \
--single unit/moduleapi/eventloop \
--single unit/moduleapi/timer \
"${@}"
-