mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
set up structure for multiple cli commands
The previous cli is now behind the 'serve' subcommand.
This commit is contained in:
parent
1ee3bbb316
commit
be87774a3b
4 changed files with 60 additions and 39 deletions
11
src/main.rs
11
src/main.rs
|
|
@ -19,6 +19,7 @@ use axum::{
|
|||
use axum_server::{
|
||||
bind, bind_rustls, tls_rustls::RustlsConfig, Handle as ServerHandle,
|
||||
};
|
||||
use clap::Parser;
|
||||
use futures_util::FutureExt;
|
||||
use http::{
|
||||
header::{self, HeaderName},
|
||||
|
|
@ -41,7 +42,7 @@ use tower_http::{
|
|||
use tracing::{debug, error, info, info_span, warn, Instrument};
|
||||
|
||||
mod api;
|
||||
mod args;
|
||||
mod cli;
|
||||
mod config;
|
||||
mod database;
|
||||
mod error;
|
||||
|
|
@ -51,6 +52,7 @@ mod utils;
|
|||
|
||||
pub(crate) use api::ruma_wrapper::{Ar, Ra};
|
||||
use api::{client_server, server_server, well_known};
|
||||
use cli::{Args, Command};
|
||||
pub(crate) use config::{Config, ListenConfig};
|
||||
pub(crate) use database::KeyValueDatabase;
|
||||
pub(crate) use service::{pdu::PduEvent, Services};
|
||||
|
|
@ -108,9 +110,12 @@ async fn main() -> ExitCode {
|
|||
async fn try_main() -> Result<(), error::Main> {
|
||||
use error::Main as Error;
|
||||
|
||||
let args = args::parse();
|
||||
let args = Args::parse();
|
||||
// This is a placeholder, the logic specific to the 'serve' command will be
|
||||
// moved to another file in a later commit
|
||||
let Command::Serve(args) = args.command;
|
||||
|
||||
let config = config::load(args.config.as_ref()).await?;
|
||||
let config = config::load(args.config.config.as_ref()).await?;
|
||||
|
||||
let (_guard, reload_handles) = observability::init(&config)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue