feat(grpc): Add basic grpc example
This commit is contained in:
parent
3439bdc37a
commit
3bc2286586
7 changed files with 157 additions and 2 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue