52 std::vector<std::pair<std::string, Provider>> _sections;
54 std::optional<ServerCommand> _command;
Build text and JSON diagnostics from named providers.
std::function< std::string()> Provider
Returns this section's payload as JSON text (an object or scalar).
void InstallCommand(std::string_view name, std::string_view helpText, HealthCheck healthy={})
Install the server command that reports this status.
std::string BuildJson() const
One JSON object with a key per section, plus a top-level healthy flag.
bool IsHealthy() const
The registered health result, or true when no predicate is registered.
std::function< bool()> HealthCheck
Optional plugin-specific health predicate.
std::string BuildText() const
Human-readable multi-line rendering of the same sections.
void RegisterSection(std::string name, Provider provider)
Add a section, replacing any existing one with the same name.
static std::string ReadFile(const std::filesystem::path &path)