mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-22 09:29:50 +00:00
Failover: code refactoring changes done.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Technitium DNS Server
|
||||
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
|
||||
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -37,7 +37,7 @@ namespace Failover
|
||||
Secondary = 2
|
||||
}
|
||||
|
||||
public class Address : IDnsApplication, IDnsAppRecordRequestHandler
|
||||
public sealed class Address : IDnsApplication, IDnsAppRecordRequestHandler
|
||||
{
|
||||
#region variables
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Technitium DNS Server
|
||||
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
|
||||
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -29,7 +29,7 @@ using TechnitiumLibrary.Net.Dns.ResourceRecords;
|
||||
|
||||
namespace Failover
|
||||
{
|
||||
public class CNAME : IDnsApplication, IDnsAppRecordRequestHandler
|
||||
public sealed class CNAME : IDnsApplication, IDnsAppRecordRequestHandler
|
||||
{
|
||||
#region variables
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Failover
|
||||
|
||||
#region private
|
||||
|
||||
private IReadOnlyList<DnsResourceRecord> GetAnswers(string domain, DnsQuestionRecord question, string zoneName, uint appRecordTtl, string healthCheck, Uri healthCheckUrl)
|
||||
private DnsResourceRecord[] GetAnswers(string domain, DnsQuestionRecord question, string zoneName, uint appRecordTtl, string healthCheck, Uri healthCheckUrl)
|
||||
{
|
||||
HealthCheckResponse response = _healthService.QueryStatus(domain, question.Type, healthCheck, healthCheckUrl, true);
|
||||
switch (response.Status)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Technitium DNS Server
|
||||
Copyright (C) 2022 Shreyas Zare (shreyas@technitium.com)
|
||||
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using DnsServerCore.ApplicationCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Mail;
|
||||
using System.Text;
|
||||
@@ -348,7 +347,7 @@ DNS Failover App
|
||||
public bool Enabled
|
||||
{ get { return _enabled; } }
|
||||
|
||||
public IReadOnlyList<MailAddress> AlertTo
|
||||
public MailAddress[] AlertTo
|
||||
{ get { return _alertTo; } }
|
||||
|
||||
public string SmtpServer
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Technitium DNS Server
|
||||
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
|
||||
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -420,16 +420,16 @@ namespace Failover
|
||||
|
||||
#region properties
|
||||
|
||||
public IReadOnlyDictionary<string, HealthCheck> HealthChecks
|
||||
public ConcurrentDictionary<string, HealthCheck> HealthChecks
|
||||
{ get { return _healthChecks; } }
|
||||
|
||||
public IReadOnlyDictionary<string, EmailAlert> EmailAlerts
|
||||
public ConcurrentDictionary<string, EmailAlert> EmailAlerts
|
||||
{ get { return _emailAlerts; } }
|
||||
|
||||
public IReadOnlyDictionary<string, WebHook> WebHooks
|
||||
public ConcurrentDictionary<string, WebHook> WebHooks
|
||||
{ get { return _webHooks; } }
|
||||
|
||||
public IReadOnlyDictionary<NetworkAddress, bool> UnderMaintenance
|
||||
public ConcurrentDictionary<NetworkAddress, bool> UnderMaintenance
|
||||
{ get { return _underMaintenance; } }
|
||||
|
||||
public IDnsServer DnsServer
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Technitium DNS Server
|
||||
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
|
||||
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -330,7 +330,7 @@ namespace Failover
|
||||
public bool Enabled
|
||||
{ get { return _enabled; } }
|
||||
|
||||
public IReadOnlyList<Uri> Urls
|
||||
public Uri[] Urls
|
||||
{ get { return _urls; } }
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user