plana 0.2.1

PLANA protocol foundation: the canonical JSON-RPC 2.0 wire layer (unix-socket / HTTP / WS bindings, typed method routing) merged with the generic protocol core (handshake, identity, RBAC, regions, health descriptors) — the base every plana-rpc-* and domain-profile crate builds on.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::path::PathBuf;

pub const DEFAULT_SOCKET_DIR: &str = "/run/entelecheia";
pub const LOG_SOCKET_FILENAME: &str = "entelecheia-log.sock";

pub fn log_socket_dir() -> PathBuf {
    std::env::var("ENTELECHEIA_SOCKET_DIR")
        .map(PathBuf::from)
        .unwrap_or_else(|_| PathBuf::from(DEFAULT_SOCKET_DIR))
}

pub fn log_socket_path() -> PathBuf {
    log_socket_dir().join(LOG_SOCKET_FILENAME)
}