iocaine 3.4.0

The deadliest poison known to AI
// SPDX-FileCopyrightText: 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 variant: Variant,
}

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

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

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

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