server api

This commit is contained in:
John Smith
2023-06-07 17:39:10 -04:00
parent 88db69c28f
commit 317f036598
14 changed files with 423 additions and 259 deletions

View File

@@ -1,8 +1,5 @@
use crate::command_processor::*;
use crate::tools::*;
use crate::veilid_client_capnp::*;
use capnp::capability::Promise;
use capnp_rpc::{pry, rpc_twoparty_capnp, twoparty, Disconnector, RpcSystem};
use futures::future::FutureExt;
use serde::de::DeserializeOwned;
use std::cell::RefCell;
@@ -11,25 +8,6 @@ use std::rc::Rc;
use veilid_core::tools::*;
use veilid_core::*;
macro_rules! capnp_failed {
($ex:expr) => {{
let msg = format!("Capnp Error: {}", $ex);
error!("{}", msg);
Promise::err(capnp::Error::failed(msg))
}};
}
macro_rules! pry_result {
($ex:expr) => {
match $ex {
Ok(v) => v,
Err(e) => {
return capnp_failed!(e);
}
}
};
}
fn map_to_internal_error<T: ToString>(e: T) -> VeilidAPIError {
VeilidAPIError::Internal {
message: e.to_string(),

View File

@@ -18,11 +18,6 @@ mod settings;
mod tools;
mod ui;
#[allow(clippy::all)]
pub mod veilid_client_capnp {
include!(concat!(env!("OUT_DIR"), "/proto/veilid_client_capnp.rs"));
}
fn parse_command_line(default_config_path: &OsStr) -> Result<clap::ArgMatches, String> {
let matches = Command::new("veilid-cli")
.version("0.1")