iocaine 3.0.0

The deadliest poison known to AI
Documentation
// SPDX-FileCopyrightText: 2025 Gergely Nagy
// SPDX-FileContributor: Gergely Nagy
//
// SPDX-License-Identifier: MIT

use std::collections::HashMap;
use tokio_listener::ListenerAddress;

use crate::{bruce::Bruce, checkpoint_charlie::CheckpointCharlie, tenx_programmer::TenXProgrammer};

pub struct Freezer {
    pub servers: HashMap<String, Server>,
}

pub struct Server {
    pub bind: ListenerAddress,
    pub unix_socket_access: Option<tokio_listener::UnixChmodVariant>,

    pub server: ServerVariant,
}

pub enum ServerVariant {
    Http(Bruce),
    HaproxySPOA(CheckpointCharlie),
    Prometheus(TenXProgrammer),
}

impl From<TenXProgrammer> for ServerVariant {
    fn from(txp: TenXProgrammer) -> Self {
        Self::Prometheus(txp)
    }
}

impl From<Bruce> for ServerVariant {
    fn from(bruce: Bruce) -> Self {
        Self::Http(bruce)
    }
}

impl From<CheckpointCharlie> for ServerVariant {
    fn from(charlie: CheckpointCharlie) -> Self {
        Self::HaproxySPOA(charlie)
    }
}