Front the whole network's help through HelpServ
Each service now exposes its help catalog via Service::help_topics; the engine collects them into a network-wide index on Network, reachable through two new NetView methods. HelpServ uses it: HELP <service> [command] (or a bare service name) serves any service's per-command help, bare HELP lists the services, and its own ticket commands still work. No cross-crate dependency: the catalog flows through the SDK's NetView, keeping every module dependent only on echo-api.
This commit is contained in:
parent
69a93198ff
commit
fcca8e4e3b
17 changed files with 151 additions and 6 deletions
|
|
@ -1053,6 +1053,15 @@ pub trait NetView {
|
|||
// `limit`). An empty pattern returns the most recent; otherwise matches the
|
||||
// id or a case-insensitive substring of the summary.
|
||||
fn search_incidents(&self, pattern: &str, limit: usize) -> Vec<IncidentView>;
|
||||
// The network-wide help index the engine builds from every service, so
|
||||
// HelpServ can front help for the whole network. `help_services` lists the
|
||||
// service names; `service_help` returns one service's blurb and topics.
|
||||
fn help_services(&self) -> Vec<String> {
|
||||
Vec::new()
|
||||
}
|
||||
fn service_help(&self, _service: &str) -> Option<(&'static str, &'static [HelpEntry])> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// One recorded action from the incident log: a short id (also stamped into the
|
||||
|
|
@ -1083,6 +1092,11 @@ pub trait Service: Send {
|
|||
fn manages_accounts(&self) -> bool {
|
||||
false
|
||||
}
|
||||
// This service's HELP catalog: its blurb and per-command topics. The engine
|
||||
// collects these into a network-wide index HelpServ can front. Empty default.
|
||||
fn help_topics(&self) -> (&'static str, &'static [HelpEntry]) {
|
||||
("", &[])
|
||||
}
|
||||
fn on_command(&mut self, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, net: &dyn NetView, store: &mut dyn Store);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue