DnsUpdater/Sources/App/Model/GlobalState.swift

37 lines
853 B
Swift
Raw Permalink Normal View History

2024-11-15 10:46:29 +01:00
import Foundation
enum GlobalState: UInt8, Codable {
case nominal = 0
/// No domains set in configuration file
case noDomainConfigured = 1
/// Both addresses are missing
case missingAddresses = 2
/// Missing IPv4 address
case missingIPv4 = 3
/// Missing IPv6 address
case missingIPv6 = 4
case serverError = 5
case clientError = 6
}
extension GlobalState: CustomStringConvertible {
var description: String {
switch self {
case .nominal: return "Nominal"
case .noDomainConfigured: return "No domains"
case .missingAddresses: return "Missing addresses"
case .missingIPv4: return "Missing IPv4"
case .missingIPv6: return "Missing IPv6"
case .serverError: return "Server error"
case .clientError: return "Client error"
}
}
}