summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-07-06 10:29:19 +0200
committerantirez <antirez@gmail.com>2017-07-06 11:04:46 +0200
commit51ffd062d37b370884e21cc70b20264ff4060dc8 (patch)
treee75ac9bcc39685c0d939a1c1e2f1df22807ebcd0 /src/modules
parentf9fac7f7770f056790b628e47af91ed3e814246c (diff)
downloadredis-51ffd062d37b370884e21cc70b20264ff4060dc8.tar.gz
Modules: DEBUG DIGEST interface.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/hellotype.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/hellotype.c b/src/modules/hellotype.c
index 027155d45..ba634c4a1 100644
--- a/src/modules/hellotype.c
+++ b/src/modules/hellotype.c
@@ -238,6 +238,16 @@ void HelloTypeFree(void *value) {
HelloTypeReleaseObject(value);
}
+void HelloTypeDigest(RedisModuleDigest *md, void *value) {
+ struct HelloTypeObject *hto = value;
+ struct HelloTypeNode *node = hto->head;
+ while(node) {
+ RedisModule_DigestAddLongLong(md,node->value);
+ node = node->next;
+ }
+ RedisModule_DigestEndSequence(md);
+}
+
/* This function must be present on each Redis module. It is used in order to
* register the commands into the Redis server. */
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
@@ -253,7 +263,8 @@ int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
.rdb_save = HelloTypeRdbSave,
.aof_rewrite = HelloTypeAofRewrite,
.mem_usage = HelloTypeMemUsage,
- .free = HelloTypeFree
+ .free = HelloTypeFree,
+ .digest = HelloTypeDigest
};
HelloType = RedisModule_CreateDataType(ctx,"hellotype",0,&tm);