diff --git a/Cargo.toml b/Cargo.toml index d994aa7..62dccd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,29 @@ [package] name = "lldap" +edition = "2018" version = "0.1.0" authors = [ "Valentin Tolmer ", "Steve Barrau ", "Thomas Wickham " ] -edition = "2018" [dependencies] +clap = "3.0.0-beta.2" +actix-web = "3" +anyhow = "*" +thiserror="*" +http = "*" +passablewords = "*" +serde = "*" +tracing = "*" +tracing-actix-web = "*" +tracing-log = "*" +tracing-subscriber = "*" + +[dependencies.figment] +features = ["toml", "env"] +version = "*" + +[dev-dependencies] +actix-rt = "*" diff --git a/src/domain/.keep b/src/domain/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/infra/cli.rs b/src/infra/cli.rs new file mode 100644 index 0000000..049ee67 --- /dev/null +++ b/src/infra/cli.rs @@ -0,0 +1,10 @@ +use clap::Clap; + +/// lldap is a lightweight LDAP server +#[derive(Debug, Clap)] +#[clap(version = "0.1", author = "The LLDAP team")] +pub struct CLIOpts; + +pub fn init() -> CLIOpts { + CLIOpts::parse() +} diff --git a/src/infra/configuration.rs b/src/infra/configuration.rs new file mode 100644 index 0000000..4880f38 --- /dev/null +++ b/src/infra/configuration.rs @@ -0,0 +1,6 @@ +#[derive(Debug, Default)] +pub struct Configuration; + +pub fn init() -> Configuration { + Configuration::default() +} diff --git a/src/infra/mod.rs b/src/infra/mod.rs new file mode 100644 index 0000000..d01d024 --- /dev/null +++ b/src/infra/mod.rs @@ -0,0 +1,2 @@ +pub mod cli; +pub mod configuration; diff --git a/src/main.rs b/src/main.rs index e7a11a9..d41b24a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,7 @@ +mod infra; + fn main() { - println!("Hello, world!"); + let config = infra::configuration::init(); + let cli_opts = infra::cli::init(); + println!("Hello, world! Config: {:?}, CLI: {:?}", config, cli_opts); }