como/crates/como_infrastructure/src/configs/mod.rs
kjuulh 6e16fc6b2b
feat: move project to crates
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-10-21 11:14:58 +02:00

30 lines
689 B
Rust

use clap::ValueEnum;
use como_auth::AuthClap;
#[derive(clap::Parser)]
pub struct AppConfig {
#[clap(long, env)]
pub database_url: String,
#[clap(long, env, default_value = "postgres")]
pub database_type: DatabaseType,
#[clap(long, env)]
pub rust_log: String,
#[clap(long, env, default_value = "3001")]
pub api_port: u32,
#[clap(long, env, default_value = "true")]
pub run_migrations: bool,
#[clap(long, env, default_value = "false")]
pub seed: bool,
#[clap(long, env)]
pub cors_origin: String,
#[clap(flatten)]
pub auth: AuthClap,
}
#[derive(Clone, Debug, ValueEnum)]
pub enum DatabaseType {
Postgres,
InMemory,
}