Add gpgui-helper (#326)

This commit is contained in:
Kevin Yue
2024-02-21 07:34:14 -05:00
committed by GitHub
parent 5767c252b7
commit 4be877bf8c
53 changed files with 4351 additions and 51 deletions

View File

@@ -6,6 +6,7 @@ use gpapi::{
utils::{crypto::Crypto, lock_file::LockFile, redact::Redaction},
};
use log::{info, warn};
use serde::de::DeserializeOwned;
use tokio::{
net::TcpListener,
sync::{mpsc, watch, RwLock},
@@ -38,6 +39,10 @@ impl WsServerContext {
}
}
pub fn decrypt<T: DeserializeOwned>(&self, encrypted: Vec<u8>) -> anyhow::Result<T> {
self.crypto.decrypt(encrypted)
}
pub async fn send_event(&self, event: WsEvent) {
let connections = self.connections.read().await;