MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_InfoEndDictField

Function RM_InfoEndDictField

src/module.cpp:7146–7155  ·  view source on GitHub ↗

Ends a dict field, see RedisModule_InfoBeginDictField */

Source from the content-addressed store, hash-verified

7144
7145/* Ends a dict field, see RedisModule_InfoBeginDictField */
7146int RM_InfoEndDictField(RedisModuleInfoCtx *ctx) {
7147 if (!ctx->in_dict_field)
7148 return REDISMODULE_ERR;
7149 /* trim the last ',' if found. */
7150 if (ctx->info[sdslen(ctx->info)-1]==',')
7151 sdsIncrLen(ctx->info, -1);
7152 ctx->info = sdscat(ctx->info, "\r\n");
7153 ctx->in_dict_field = 0;
7154 return REDISMODULE_OK;
7155}
7156
7157/* Used by RedisModuleInfoFunc to add info fields.
7158 * Each field will be automatically prefixed by `<modulename>_`.

Callers 3

RM_InfoAddSectionFunction · 0.85
RM_InfoBeginDictFieldFunction · 0.85
modulesCollectInfoFunction · 0.85

Calls 3

sdslenFunction · 0.85
sdsIncrLenFunction · 0.85
sdscatFunction · 0.85

Tested by

no test coverage detected