namespace CaddyManager.Contracts.Models.Caddy;
///
/// Wraps the information parsed from the Caddy configuration file.
///
public class CaddyConfigurationInfo
{
///
/// Hostnames that are configured in the Caddyfile.
///
public List Hostnames { get; set; } = [];
///
/// The hostname of the reverse proxy server.
///
public string ReverseProxyHostname { get; set; } = string.Empty;
///
/// Ports being used with the reverse proxy hostname
///
public List ReverseProxyPorts { get; set; } = [];
///
/// The name of the configuration file.
///
public string FileName { get; set; } = string.Empty;
///
/// Aggregated ports for the reverse proxy hostname from all configurations.
///
public List AggregatedReverseProxyPorts { get; set; } = [];
public override bool Equals(object? obj)
{
if (obj is not CaddyConfigurationInfo other)
return false;
return FileName == other.FileName;
}
public override int GetHashCode()
{
return FileName.GetHashCode();
}
}