Create labadoor-auth, for wrapping storage backends

This commit is contained in:
George Kaklamanos 2023-11-22 18:18:51 +02:00
parent 104d8a862d
commit 5013fdcf1c
No known key found for this signature in database
GPG key ID: C0CAB8A6BDC9399D
7 changed files with 58 additions and 0 deletions

11
labadoor-auth/Cargo.toml Normal file
View file

@ -0,0 +1,11 @@
[package]
name = "labadoor-auth"
version = "0.1.0"
edition = "2021"
[dependencies]
clap = { version = "4.4.8", features = ["derive"] }
labadoor-csv = { path = "../labadoor-csv", optional = true }
[features]
csv = ["dep:labadoor-csv"]

31
labadoor-auth/src/cli.rs Normal file
View file

@ -0,0 +1,31 @@
use clap::{Parser, ValueEnum};
#[derive(Parser, Debug)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
#[arg(short, long, value_enum)]
pub backend: Backend,
}
#[derive(Parser, ValueEnum, Clone, Debug)]
pub enum Backend {
#[cfg(feature = "csv")]
CSV,
}
#[derive(Parser, Debug)]
pub enum Command {
Open(Open),
}
#[derive(Parser, Debug)]
pub struct Open {
pub method: String,
pub identifier: String,
pub resource: i8,
}
pub fn parse() -> Cli {
Cli::parse()
}

7
labadoor-auth/src/lib.rs Normal file
View file

@ -0,0 +1,7 @@
pub mod cli;
pub fn auth(i: &cli::Cli) {
match i.command {
cli::Command::Open(_) => todo!(),
};
}