PragmaTwice commented on issue #2302:
URL: https://github.com/apache/kvrocks/issues/2302#issuecomment-2118692063

   In details, we can have such small functions, like:
   ```
   auto GetPersistenceInfo() ->std::map<KeyTy, ValueTy>;
   auto GetServerInfo() ->std::map<KeyTy, ValueTy>;
   auto GetPWhateverInfo() ->std::map<KeyTy, ValueTy>;
   ```
   
   And then at the function that can generate all info (not real C++ code):
   ```
   std::map<..> func_map = {{"persistence", GetPersistenceInfo}, ...}
   
   auto all_info = func_map.filter(selected_info_sections).map(x -> x.call())
   
   if (JSON) generateJsonOutput(all_info)
   else (TXT) generateTxtOutput(all_info)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to