rieter/server/src/main.rs

32 lines
535 B
Rust
Raw Normal View History

2023-07-30 18:21:07 +02:00
mod api;
2023-07-16 20:52:03 +02:00
mod cli;
pub mod db;
mod error;
2023-07-11 13:41:56 +02:00
mod repo;
2023-07-16 20:52:03 +02:00
use clap::Parser;
pub use error::{Result, ServerError};
use repo::RepoGroupManager;
2023-07-30 18:21:07 +02:00
use sea_orm::DatabaseConnection;
2023-07-11 13:41:56 +02:00
use std::path::PathBuf;
use std::sync::{Arc, RwLock};
2023-07-11 13:41:56 +02:00
#[derive(Clone)]
pub struct Config {
repo_dir: PathBuf,
pkg_dir: PathBuf,
}
#[derive(Clone)]
pub struct Global {
config: Config,
repo_manager: Arc<RwLock<RepoGroupManager>>,
2023-07-30 18:21:07 +02:00
db: DatabaseConnection,
}
2023-07-11 13:41:56 +02:00
#[tokio::main]
async fn main() {
2023-07-16 20:52:03 +02:00
let cli = cli::Cli::parse();
cli.run().await;
2023-07-11 13:41:56 +02:00
}