use anyhow::Result;
use athena_control_plane::{DaemonId, install_process_daemon_id, resolve_runtime_daemon_id};
#[derive(Debug, Clone)]
pub struct DaemonIdentity {
pub daemon_id: DaemonId,
pub runtime_kind: String,
}
impl DaemonIdentity {
pub fn resolve_for_runtime(runtime_kind: &str, override_value: Option<&str>) -> Result<Self> {
let daemon_id = resolve_runtime_daemon_id(runtime_kind, override_value)?;
install_process_daemon_id(daemon_id.as_str())?;
Ok(Self {
daemon_id,
runtime_kind: runtime_kind.to_string(),
})
}
}
pub fn install_process_daemon_identity(
runtime_kind: &str,
override_value: Option<&str>,
) -> Result<DaemonIdentity> {
DaemonIdentity::resolve_for_runtime(runtime_kind, override_value)
}