dnsforward: upstream mode

This commit is contained in:
Dimitry Kolyshev 2024-07-04 10:37:50 +03:00
parent 93e4005125
commit 38e10dee48
2 changed files with 5 additions and 3 deletions

View File

@ -301,6 +301,8 @@ type ServerConfig struct {
// UpstreamMode is a enumeration of upstream mode representations. See // UpstreamMode is a enumeration of upstream mode representations. See
// [proxy.UpstreamModeType]. // [proxy.UpstreamModeType].
//
// TODO(d.kolyshev): Consider using [proxy.UpstreamMode].
type UpstreamMode string type UpstreamMode string
const ( const (

View File

@ -150,12 +150,12 @@ func setProxyUpstreamMode(
) (err error) { ) (err error) {
switch upstreamMode { switch upstreamMode {
case UpstreamModeParallel: case UpstreamModeParallel:
conf.UpstreamMode = proxy.UModeParallel conf.UpstreamMode = proxy.UpstreamModeParallel
case UpstreamModeFastestAddr: case UpstreamModeFastestAddr:
conf.UpstreamMode = proxy.UModeFastestAddr conf.UpstreamMode = proxy.UpstreamModeFastestAddr
conf.FastestPingTimeout = fastestTimeout conf.FastestPingTimeout = fastestTimeout
case UpstreamModeLoadBalance: case UpstreamModeLoadBalance:
conf.UpstreamMode = proxy.UModeLoadBalance conf.UpstreamMode = proxy.UpstreamModeLoadBalance
default: default:
return fmt.Errorf("unexpected value %q", upstreamMode) return fmt.Errorf("unexpected value %q", upstreamMode)
} }