From 38e10dee48c8dc55606e0d99dd9cdf7719786f3a Mon Sep 17 00:00:00 2001 From: Dimitry Kolyshev Date: Thu, 4 Jul 2024 10:37:50 +0300 Subject: [PATCH] dnsforward: upstream mode --- internal/dnsforward/config.go | 2 ++ internal/dnsforward/upstreams.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/dnsforward/config.go b/internal/dnsforward/config.go index 4d2924abfa3..4aba57ec800 100644 --- a/internal/dnsforward/config.go +++ b/internal/dnsforward/config.go @@ -301,6 +301,8 @@ type ServerConfig struct { // UpstreamMode is a enumeration of upstream mode representations. See // [proxy.UpstreamModeType]. +// +// TODO(d.kolyshev): Consider using [proxy.UpstreamMode]. type UpstreamMode string const ( diff --git a/internal/dnsforward/upstreams.go b/internal/dnsforward/upstreams.go index 6fbe0638983..00e10125b6c 100644 --- a/internal/dnsforward/upstreams.go +++ b/internal/dnsforward/upstreams.go @@ -150,12 +150,12 @@ func setProxyUpstreamMode( ) (err error) { switch upstreamMode { case UpstreamModeParallel: - conf.UpstreamMode = proxy.UModeParallel + conf.UpstreamMode = proxy.UpstreamModeParallel case UpstreamModeFastestAddr: - conf.UpstreamMode = proxy.UModeFastestAddr + conf.UpstreamMode = proxy.UpstreamModeFastestAddr conf.FastestPingTimeout = fastestTimeout case UpstreamModeLoadBalance: - conf.UpstreamMode = proxy.UModeLoadBalance + conf.UpstreamMode = proxy.UpstreamModeLoadBalance default: return fmt.Errorf("unexpected value %q", upstreamMode) }