proxy-pilot 0.7.0

Core-agnostic proxy health monitor, automatic failover daemon, and multi-channel alerting tool for Linux servers.
Documentation
pub mod http;

use std::time::Duration;

use async_trait::async_trait;

use crate::config::ProbeTarget;
use crate::error::Result;

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ProbeOutcome {
    Healthy { status: u16, latency: Duration },
    GeoBlocked { status: u16 },
    Unreachable { reason: String },
}

impl ProbeOutcome {
    pub fn is_healthy(&self) -> bool {
        matches!(self, Self::Healthy { .. })
    }
}

/// Abstraction over health-check probes executed through a proxy endpoint.
#[async_trait]
pub trait HealthProbe: Send + Sync {
    async fn check(&self, target: &ProbeTarget) -> Result<ProbeOutcome>;
}