Struct seaplane_cli::context::Ctx
source · [−]pub struct Ctx {Show 17 fields
pub flight_ctx: LateInit<FlightCtx>,
pub formation_ctx: LateInit<FormationCtx>,
pub md_ctx: LateInit<MetadataCtx>,
pub locks_ctx: LateInit<LocksCtx>,
pub restrict_ctx: LateInit<RestrictCtx>,
pub conf_files: Vec<PathBuf>,
pub args: Args,
pub db: Db,
pub internal_run: bool,
pub did_init: bool,
pub disable_pb: bool,
pub compute_url: Option<Url>,
pub identity_url: Option<Url>,
pub metadata_url: Option<Url>,
pub locks_url: Option<Url>,
pub insecure_urls: bool,
pub invalid_certs: bool,
/* private fields */
}Expand description
The source of truth “Context” that is passed to all runtime processes to make decisions based on user configuration
Fields
flight_ctx: LateInit<FlightCtx>Context relate to exclusively to Flight operations and commands
formation_ctx: LateInit<FormationCtx>Context relate to exclusively to Formation operations and commands
md_ctx: LateInit<MetadataCtx>Context relate to exclusively to key-value operations and commands
locks_ctx: LateInit<LocksCtx>Context relate to exclusively to Locks operations and commands
restrict_ctx: LateInit<RestrictCtx>Context relate to exclusively to Restrict operations and commands
conf_files: Vec<PathBuf>Where the configuration files were loaded from
args: ArgsCommon CLI arguments
db: DbThe in memory databases
internal_run: boolAllows tracking if we’re running a command internally and skippy certain checks or output
did_init: boolDid we run initialization automatically or not on startup?
disable_pb: boolDisable progress bar indicators
compute_url: Option<Url>Set the base URL for the request
identity_url: Option<Url>metadata_url: Option<Url>locks_url: Option<Url>insecure_urls: boolinvalid_certs: boolImplementations
sourceimpl Ctx
impl Ctx
pub fn update_from_env(&mut self) -> Result<()>
pub fn data_dir(&self) -> &Path
pub fn conf_files(&self) -> &[PathBuf]
pub fn flights_file(&self) -> PathBuf
pub fn formations_file(&self) -> PathBuf
sourcepub fn persist_formations(&self) -> Result<()>
pub fn persist_formations(&self) -> Result<()>
Write out an entirely new JSON file if --stateless wasn’t used
sourcepub fn persist_flights(&self) -> Result<()>
pub fn persist_flights(&self) -> Result<()>
Write out an entirely new JSON file if --stateless wasn’t used