pub(crate) mod common;
mod deploy;
mod dlq;
pub(crate) mod errors;
mod fire;
pub mod harness;
mod inspect;
pub(crate) mod inspect_data;
pub(crate) mod listener;
mod origin_guard;
mod queue;
mod recover;
mod reload;
mod replay;
mod replay_oracle;
mod resume;
pub(crate) mod role;
mod serve;
mod stats;
pub(crate) mod supervisor_state;
mod tenant;
pub mod tls;
#[allow(unused_imports)]
pub(crate) use errors::{OrchestratorError, OrchestratorResult};
use std::future::Future;
use std::pin::Pin;
use crate::cli::{OrchestratorArgs, OrchestratorCommand};
pub(crate) async fn handle(args: OrchestratorArgs) -> OrchestratorResult<()> {
let command: Pin<Box<dyn Future<Output = OrchestratorResult<()>> + Send>> = match args.command {
OrchestratorCommand::Serve(serve_args) => Box::pin(serve::run(serve_args)),
OrchestratorCommand::Deploy(deploy_args) => Box::pin(deploy::run(*deploy_args)),
OrchestratorCommand::Reload(reload_args) => Box::pin(reload::run(reload_args)),
OrchestratorCommand::Inspect(inspect_args) => Box::pin(inspect::run(inspect_args)),
OrchestratorCommand::Stats(stats_args) => Box::pin(stats::run(stats_args)),
OrchestratorCommand::Fire(fire_args) => Box::pin(fire::run(fire_args)),
OrchestratorCommand::Replay(replay_args) => Box::pin(replay::run(replay_args)),
OrchestratorCommand::ReplayOracle(replay_oracle_args) => {
Box::pin(replay_oracle::run(replay_oracle_args))
}
OrchestratorCommand::Resume(resume_args) => Box::pin(resume::run(resume_args)),
OrchestratorCommand::Dlq(dlq_args) => Box::pin(dlq::run(dlq_args)),
OrchestratorCommand::Queue(queue_args) => Box::pin(queue::run(queue_args)),
OrchestratorCommand::Recover(recover_args) => Box::pin(recover::run(recover_args)),
OrchestratorCommand::Tenant(tenant_args) => Box::pin(tenant::run(tenant_args)),
};
command.await
}