feat(grpc): Add basic grpc example

This commit is contained in:
Alexander Navarro 2024-04-23 20:12:18 -04:00
parent 3439bdc37a
commit 3bc2286586
7 changed files with 157 additions and 2 deletions

View file

@ -1,8 +1,10 @@
use std::{env, path::PathBuf};
use clap::Parser;
use std::error::Error;
mod file_explorer;
mod grpc;
#[derive(Parser)]
#[command(version, about, long_about = None)]
@ -11,7 +13,8 @@ struct Args {
path: Option<PathBuf>,
}
fn main() {
#[tokio::main()]
async fn main() -> Result<(), Box<dyn Error>> {
let cli = Args::parse();
let path = cli
.path
@ -19,5 +22,11 @@ fn main() {
let files = file_explorer::walk_dir(&path).expect("error");
eprintln!("DEBUGPRINT[4]: main.rs:20: files={:#?}", files);
eprintln!("DEBUGPRINT[4]: main.rs:20: files={:#?}", files.len());
let server = grpc::run()?;
server.connect().await?;
Ok(())
}