Last active
January 10, 2019 15:57
-
-
Save kristoff-it/8846868dda416753fda67ab3e4e60099 to your computer and use it in GitHub Desktop.
This file contains 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
#include "redismodule.h" | |
int HelloWorld_Command(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { | |
RedisModule_ReplyWithSimpleString(ctx, "Hello World!"); | |
return REDISMODULE_OK; | |
} | |
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { | |
if (RedisModule_Init(ctx,"testmodule",1,REDISMODULE_APIVER_1) | |
== REDISMODULE_ERR){ | |
return REDISMODULE_ERR; | |
} | |
if (RedisModule_CreateCommand(ctx,"test.hello", HelloWorld_Command, | |
"readonly", 0, 0, 0) == REDISMODULE_ERR){ | |
return REDISMODULE_ERR; | |
} | |
return REDISMODULE_OK; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment