fixup after rebase

This commit is contained in:
Aiden McClelland
2023-03-09 15:02:09 -07:00
parent 5e9e26fa67
commit 18922a1c6d
24 changed files with 40 additions and 779 deletions

View File

@@ -1,6 +1,5 @@
use std::sync::Arc;
use color_eyre::eyre::eyre;
use color_eyre::Report;
use models::InterfaceId;
use models::PackageId;
@@ -76,8 +75,8 @@ pub trait OsApi: Send + Sync + 'static {
async fn unbind_local(&self, id: InterfaceId, external: u16) -> Result<(), Report>;
async fn unbind_onion(&self, id: InterfaceId, external: u16) -> Result<(), Report>;
fn set_started(&self);
async fn restart(&self);
async fn start(&self);
async fn stop(&self);
fn set_started(&self) -> Result<(), Report>;
async fn restart(&self) -> Result<(), Report>;
async fn start(&self) -> Result<(), Report>;
async fn stop(&self) -> Result<(), Report>;
}

View File

@@ -1559,7 +1559,7 @@ mod fns {
callback.map(|id| Callback::new(id, sender)),
)
.await
.map_err(|e| anyhow!("Couldn't get service config: {e:?}"))
.map_err(|e| anyhow!("Couldn't get service config: {e}"))
}
#[op]
@@ -1585,7 +1585,7 @@ mod fns {
};
os.bind_onion(internal_port, address_schema)
.await
.map_err(|e| anyhow!("{e:?}"))
.map_err(|e| anyhow!("{e}"))
}
#[op]
async fn bind_local(
@@ -1610,16 +1610,16 @@ mod fns {
};
os.bind_local(internal_port, address_schema)
.await
.map_err(|e| anyhow!("{e:?}"))
.map_err(|e| anyhow!("{e}"))
}
#[op]
fn set_started(state: &mut OpState) {
fn set_started(state: &mut OpState) -> Result<(), AnyError> {
let os = {
let ctx = state.borrow::<JsContext>();
ctx.os.clone()
};
os.set_started()
os.set_started().map_err(|e| anyhow!("{e}"))
}
#[op]
@@ -1639,7 +1639,7 @@ mod fns {
let ctx = state.borrow::<JsContext>();
ctx.os.clone()
};
os.restart().await;
os.restart().await.map_err(|e| anyhow!("{e}"))?;
Ok(())
}
@@ -1661,7 +1661,7 @@ mod fns {
let ctx = state.borrow::<JsContext>();
ctx.os.clone()
};
os.start().await;
os.start().await.map_err(|e| anyhow!("{e}"))?;
Ok(())
}
@@ -1683,7 +1683,7 @@ mod fns {
let ctx = state.borrow::<JsContext>();
ctx.os.clone()
};
os.stop().await;
os.stop().await.map_err(|e| anyhow!("{e}"))?;
Ok(())
}