dnsforward: upstream mode
This commit is contained in:
parent
93e4005125
commit
38e10dee48
|
@ -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 (
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue