Made other changes to GRPC implementation to clean it up #23

Merged
michael-bailey merged 30 commits from grpc-manager into master 2024-09-09 16:48:10 +00:00
3 changed files with 0 additions and 100 deletions
Showing only changes of commit ae190f88ed - Show all commits

View File

@ -1,23 +0,0 @@
[package]
name = "example_plugin"
version = "0.1.0"
authors = ["michael-bailey <mickyb18a@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["dylib"]
name = "ExamplePlugin"
path = "src/lib.rs"
[dependencies]
uuid = {version = "0.8", features = ["serde", "v4"]}
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
zeroize = "1.1.0"
futures = "0.3.16"
async-trait = "0.1.52"
server = {path = "../server"}

View File

@ -1,63 +0,0 @@
// use futures::lock::Mutex;
// use serverlib::plugin::WeakPluginInterface;
// use std::sync::Mutex as StdMutex;
// use std::thread::sleep;
// use std::time::Duration;
// use serverlib::plugin::IPlugin;
// use serverlib::plugin::PluginDetails;
// #[derive(Debug)]
// pub struct ExamplePlugin {
// number: Mutex<u8>,
// interface: StdMutex<Option<WeakPluginInterface>>,
// }
// impl Default for ExamplePlugin {
// fn default() -> Self {
// ExamplePlugin {
// number: Mutex::new(0),
// interface: StdMutex::default(),
// }
// }
// }
// #[async_trait::async_trait]
// impl IPlugin for ExamplePlugin {
// fn details(&self) -> PluginDetails {
// PluginDetails {
// display_name: "ExamplePlugin",
// id: "io.github.michael-bailey.ExamplePlugin",
// version: "0.0.1",
// contacts: vec!["bailey-michael1@outlook.com"],
// }
// }
// fn set_interface(&self, interface: WeakPluginInterface) {
// if let Ok(mut lock) = self.interface.lock() {
// *lock = Some(interface);
// }
// }
// async fn event(&self) {
// println!("Not Implemented");
// }
// fn init(&self) {
// println!("[ExamplePlugin]: example init")
// }
// async fn run(&self) {
// println!("Example!!!");
// sleep(Duration::new(1, 0));
// let mut a = self.number.lock().await;
// *a = a.overflowing_add(1).0;
// println!("[ExamplePlugin]: example run {}", *a);
// }
// fn deinit(&self) {
// if let Some(mut lock) = self.number.try_lock() {
// *lock = 0;
// }
// }
// }

View File

@ -1,14 +0,0 @@
mod example;
use std::sync::Arc;
// use serverlib::plugin::Plugin;
// use crate::example::ExamplePlugin;
// use serverlib::plugin::plugin::Plugin;
// use std::sync::Arc;
// #[no_mangle]
// pub extern "C" fn get_plugin() -> Plugin {
// Arc::new(ExamplePlugin::default())
// }