pub mod client;
pub mod error;
pub mod framing;
pub mod lock;
pub mod messages;
pub mod notifications;
pub use client::IpcClient;
pub use error::IpcError;
pub use lock::DaemonLock;
pub use messages::{IpcCommand, IpcErrorPayload, IpcRequest, IpcResponse};
pub use notifications::Notification;
pub const IPC_SCHEMA_VERSION: u32 = 1;
pub const DEFAULT_TIMEOUT_MS: u64 = 10_000;
pub const DEFAULT_LEASE_MS: u64 = 30_000;
pub mod issue_action {
pub const CREATED: &str = "created";
pub const CLOSED: &str = "closed";
pub const REOPENED: &str = "reopened";
}
pub fn default_socket_path() -> String {
if let Ok(runtime_dir) = std::env::var("XDG_RUNTIME_DIR") {
return format!("{}/grite-daemon.sock", runtime_dir);
}
#[cfg(unix)]
{
let uid = unsafe { libc::getuid() };
format!("/tmp/grite-daemon-{}.sock", uid)
}
#[cfg(not(unix))]
{
"/tmp/grite-daemon.sock".to_string()
}
}