BareGit
#pragma once

#include <chrono>
#include <optional>
#include <string>
#include <variant>

#include "probe.h"

/// Protocol-specific configuration for a monitored service.
using EndpointConfig = std::variant<HttpEndpoint, TcpEndpoint, UdpEndpoint,
                                    IcmpEndpoint>;

/// Configured settings for one monitored service, without runtime state.
struct ServiceConfig
{
    /// Unique service ID across all groups.
    std::string id;
    /// Display name shown in the web UI.
    std::string name;
    /// Description shown in the web UI.
    std::string description;
    /// Protocol and destination used to check this service.
    EndpointConfig endpoint;
    /// Positive timeout covering DNS resolution and network I/O.
    std::chrono::seconds timeout;
    /// Positive interval between scheduled probes.
    std::chrono::steady_clock::duration interval;
    /// Optional user-facing URL, also used as the HTTP endpoint fallback.
    std::optional<std::string> url;
};