MCPcopy Create free account
hub / github.com/F-Stack/f-stack / genModulesInfoString

Function genModulesInfoString

app/redis-6.2.6/src/module.c:8724–8746  ·  view source on GitHub ↗

Helper function for the INFO command: adds loaded modules as to info's * output. * * After the call, the passed sds info string is no longer valid and all the * references must be substituted with the new pointer returned by the call. */

Source from the content-addressed store, hash-verified

8722 * After the call, the passed sds info string is no longer valid and all the
8723 * references must be substituted with the new pointer returned by the call. */
8724sds genModulesInfoString(sds info) {
8725 dictIterator *di = dictGetIterator(modules);
8726 dictEntry *de;
8727
8728 while ((de = dictNext(di)) != NULL) {
8729 sds name = dictGetKey(de);
8730 struct RedisModule *module = dictGetVal(de);
8731
8732 sds usedby = genModulesInfoStringRenderModulesList(module->usedby);
8733 sds using = genModulesInfoStringRenderModulesList(module->using);
8734 sds options = genModulesInfoStringRenderModuleOptions(module);
8735 info = sdscatfmt(info,
8736 "module:name=%S,ver=%i,api=%i,filters=%i,"
8737 "usedby=%S,using=%S,options=%S\r\n",
8738 name, module->ver, module->apiver,
8739 (int)listLength(module->filters), usedby, using, options);
8740 sdsfree(usedby);
8741 sdsfree(using);
8742 sdsfree(options);
8743 }
8744 dictReleaseIterator(di);
8745 return info;
8746}
8747
8748/* Redis MODULE command.
8749 *

Callers 1

genRedisInfoStringFunction · 0.85

Calls 7

sdscatfmtFunction · 0.85
sdsfreeFunction · 0.85
dictGetIteratorFunction · 0.70
dictNextFunction · 0.70
dictReleaseIteratorFunction · 0.70

Tested by

no test coverage detected