Closed
Conversation
Redis has a lot of commands, users can use those commands to access redis data.People get to know the commands by reading redis document (https://redis.io/commands) . Redis module is a wonderful feature which make it possible for user to create custom commands.But when a module is loaded in redis, we don't know what commands in the module, unless we have read the module's source code or the module released with document. A brief description about the module and the commands in the module is needed.So the new module subcommand 'module desc' is very useful. The module and its commands' brief description will be shown to users by run 'module desc name'. In order to make the module subcommand work properly, module developers should provide the module description when call RedisModule_Init and function description when call RedisModule_CreateCommand. A new desc parameter added to RedisModule_Init,so the function changed to: int RedisModule_Init(RedisModuleCtx *ctx, const char *modulename, const char *moduledesc,int module_version, int api_version); A new desc parameter added to RedisModule_CreateCommand, so the function changed to: int RedisModule_CreateCommand(RedisModuleCtx *ctx, const char *cmdname, const char *cmddesc,RedisModuleCmdFunc cmdfunc);
zuiderkwast
reviewed
Jan 25, 2021
Comment on lines
-121
to
+122
| int REDISMODULE_API_FUNC(RedisModule_CreateCommand)(RedisModuleCtx *ctx, const char *name, RedisModuleCmdFunc cmdfunc, const char *strflags, int firstkey, int lastkey, int keystep); | ||
| int REDISMODULE_API_FUNC(RedisModule_SetModuleAttribs)(RedisModuleCtx *ctx, const char *name, int ver, int apiver); | ||
| int REDISMODULE_API_FUNC(RedisModule_CreateCommand)(RedisModuleCtx *ctx, const char *name, const char *desc, RedisModuleCmdFunc cmdfunc, const char *strflags, int firstkey, int lastkey, int keystep); | ||
| int REDISMODULE_API_FUNC(RedisModule_SetModuleAttribs)(RedisModuleCtx *ctx, const char *name, const char *desc, int ver, int apiver); |
Contributor
There was a problem hiding this comment.
This is not backwards compatible, unfortunately.
It would need to be a separate function like RedisModule_SetDesc(name, desc) or maybe a mechanism like RedisModule_RegisterInfoFunc could be used for providing help texts.
Contributor
Author
There was a problem hiding this comment.
5 years past, things changed. I will change it .
Contributor
|
I think this is obsoleted by #10108. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Redis has a lot of commands, users can use those commands to access
redis data.People get to know the commands by reading redis document
(https://redis.io/commands) .
Redis module is a wonderful feature which make it possible for user
to create custom commands.But when a module is loaded in redis, we
don't know what commands in the module, unless we have read the
module's source code or the module released with document.
A brief description about the module and the commands in the module
is needed.So the new module subcommand 'module desc' is very useful.
The module and its commands' brief description will be shown to
users by run 'module desc name'.
In order to make the module subcommand work properly, module developers
should provide the module description when call RedisModule_Init and
function description when call RedisModule_CreateCommand.
A new desc parameter added to RedisModule_Init,so the function changed
to:
int RedisModule_Init(RedisModuleCtx *ctx, const char *modulename,
const char *moduledesc,int module_version,
int api_version);
A new desc parameter added to RedisModule_CreateCommand, so the function
changed to:
int RedisModule_CreateCommand(RedisModuleCtx *ctx, const char *cmdname,
const char *cmddesc,RedisModuleCmdFunc cmdfunc);