Create labadoor-auth
, for wrapping storage backends
This commit is contained in:
parent
104d8a862d
commit
5013fdcf1c
7 changed files with 58 additions and 0 deletions
11
labadoor-auth/Cargo.toml
Normal file
11
labadoor-auth/Cargo.toml
Normal 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
31
labadoor-auth/src/cli.rs
Normal 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
7
labadoor-auth/src/lib.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
pub mod cli;
|
||||
|
||||
pub fn auth(i: &cli::Cli) {
|
||||
match i.command {
|
||||
cli::Command::Open(_) => todo!(),
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue