Dedup policy implement between grpc and proxy plugin (#3537)

Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
This commit is contained in:
Zou Nengren
2019-12-17 16:15:31 +08:00
committed by Miek Gieben
parent acb75ea904
commit 5e04c27238
7 changed files with 104 additions and 142 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/pkg/policy"
"github.com/coredns/coredns/plugin/pkg/parse"
pkgtls "github.com/coredns/coredns/plugin/pkg/tls"
"github.com/coredns/coredns/plugin/pkg/transport"
@@ -202,11 +203,11 @@ func parseBlock(c *caddy.Controller, f *Forward) error {
}
switch x := c.Val(); x {
case "random":
f.p = &random{}
f.p = &policy.Random{}
case "round_robin":
f.p = &roundRobin{}
f.p = &policy.RoundRobin{}
case "sequential":
f.p = &sequential{}
f.p = &policy.Sequential{}
default:
return c.Errf("unknown policy '%s'", x)
}