rieter/server/src/main.rs

32 lines
530 B
Rust
Raw Normal View History

2023-07-16 20:52:03 +02:00
mod cli;
mod db;
mod error;
2023-07-11 13:41:56 +02:00
mod repo;
mod api;
2023-07-11 13:41:56 +02:00
2023-07-16 20:52:03 +02:00
use clap::Parser;
pub use error::{Result, ServerError};
use repo::RepoGroupManager;
2023-07-11 13:41:56 +02:00
use std::path::PathBuf;
use std::sync::{Arc, RwLock};
use sea_orm::DatabaseConnection;
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>>,
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
}