mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
js effect for subscribing to config
fix errors chore: Fix some things in the manager for clippy
This commit is contained in:
@@ -6,6 +6,7 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1.64"
|
||||
color-eyre = "0.6.2"
|
||||
futures = "0.3.21"
|
||||
lazy_async_pool = "0.3.3"
|
||||
|
||||
@@ -10,10 +10,12 @@ use tokio::sync::oneshot;
|
||||
use tokio::task::{JoinError, JoinHandle, LocalSet};
|
||||
|
||||
mod byte_replacement_reader;
|
||||
mod os_api;
|
||||
mod rpc_client;
|
||||
mod rsync;
|
||||
mod script_dir;
|
||||
pub use byte_replacement_reader::*;
|
||||
pub use os_api::*;
|
||||
pub use rpc_client::{RpcClient, UnixRpcClient};
|
||||
pub use rsync::*;
|
||||
pub use script_dir::*;
|
||||
|
||||
17
libs/helpers/src/os_api.rs
Normal file
17
libs/helpers/src/os_api.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use models::Error;
|
||||
use models::PackageId;
|
||||
use serde_json::Value;
|
||||
|
||||
pub struct RuntimeDropped;
|
||||
|
||||
pub type Callback = Box<dyn Fn(Value) -> Result<(), RuntimeDropped> + Send + Sync + 'static>; // bool indicating if
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait OsApi: Send + Sync + 'static {
|
||||
async fn get_service_config(
|
||||
&self,
|
||||
id: PackageId,
|
||||
path: &str,
|
||||
callback: Callback,
|
||||
) -> Result<Value, Error>;
|
||||
}
|
||||
Reference in New Issue
Block a user