WIP on simple disk serve

This commit is contained in:
Dominik Werder
2021-03-31 22:17:54 +02:00
commit 6dbc7cb605
14 changed files with 359 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
use err::Error;
pub fn main() {
tokio::runtime::Builder::new_multi_thread()
.worker_threads(12)
.max_blocking_threads(256)
.enable_all()
.build()
.unwrap()
.block_on(async {
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::new("daqbuffer=trace,tokio_postgres=info"))
.init();
go().await;
})
}
async fn go() {
match inner().await {
Ok(_) => (),
Err(_) => ()
}
}
async fn inner() -> Result<(), Error> {
use clap::Clap;
use retrieval::cli::Opts;
let _opts = Opts::parse();
Ok(())
}
pub fn tracing_init() {
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::new("retrieval=trace,tokio_postgres=info"))
.init();
}
#[test]
fn t1() {
tracing_init();
tracing::error!("parsed");
//panic!();
}

20
retrieval/src/cli.rs Normal file
View File

@@ -0,0 +1,20 @@
use clap::{Clap, crate_version};
#[derive(Debug, Clap)]
#[clap(name="retrieval", author="Dominik Werder <dominik.werder@gmail.com>", version=crate_version!())]
pub struct Opts {
#[clap(short, long, parse(from_occurrences))]
pub verbose: i32,
#[clap(subcommand)]
pub subcmd: SubCmd,
}
#[derive(Debug, Clap)]
pub enum SubCmd {
Version,
Retrieval(Retrieval),
}
#[derive(Debug, Clap)]
pub struct Retrieval {
}

3
retrieval/src/lib.rs Normal file
View File

@@ -0,0 +1,3 @@
pub mod cli;
pub fn test() {}