Skip to main content

manta_shared/common/
app_context.rs

1//! CLI context struct threaded through `manta-cli`'s call stack.
2//!
3//! The server's analogous `InfraContext` (with backend dispatcher and
4//! per-site URLs) lives in `manta-server::common::app_context` — it
5//! depends on `StaticBackendDispatcher` which the CLI never touches.
6
7use crate::common::kafka::Kafka;
8use config::Config;
9
10/// Top-level CLI context, passed as `&AppContext` through CLI
11/// handlers and commands.
12#[derive(Debug)]
13pub struct AppContext<'a> {
14  /// Site name used to set the `X-Manta-Site` header on outbound
15  /// `MantaClient` requests.
16  pub site_name: &'a str,
17  /// URL of the manta HTTP server this CLI talks to. Required.
18  pub manta_server_url: &'a str,
19  pub settings_hsm_group_name_opt: Option<&'a str>,
20  pub kafka_audit_opt: Option<&'a Kafka>,
21  pub settings: &'a Config,
22}