diff options
author | 2019-09-28 10:41:12 +0100 | |
---|---|---|
committer | 2019-09-28 10:41:12 +0100 | |
commit | 03a3695ea9af1ff704861141a6ca807d742a894f (patch) | |
tree | af54c350e492f8d8c9bc5e16a40404940a5c97f3 /plugin/forward/setup.go | |
parent | ba5d4a637271b302830e38af0092d798bd9ad668 (diff) | |
download | coredns-03a3695ea9af1ff704861141a6ca807d742a894f.tar.gz coredns-03a3695ea9af1ff704861141a6ca807d742a894f.tar.zst coredns-03a3695ea9af1ff704861141a6ca807d742a894f.zip |
plugins: calling Dispenser itself is a mistake (#3323)
Remove all these uses and just make them work on caddy.Controller. Also
don't export parsing functions as their should be private to the plugin.
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/forward/setup.go')
-rw-r--r-- | plugin/forward/setup.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/plugin/forward/setup.go b/plugin/forward/setup.go index 60ec08fa3..3bfee9f01 100644 --- a/plugin/forward/setup.go +++ b/plugin/forward/setup.go @@ -13,7 +13,6 @@ import ( "github.com/coredns/coredns/plugin/pkg/transport" "github.com/caddyserver/caddy" - "github.com/caddyserver/caddy/caddyfile" ) func init() { plugin.Register("forward", setup) } @@ -74,7 +73,7 @@ func parseForward(c *caddy.Controller) (*Forward, error) { return nil, plugin.ErrOnce } i++ - f, err = ParseForwardStanza(&c.Dispenser) + f, err = parseStanza(c) if err != nil { return nil, err } @@ -82,8 +81,7 @@ func parseForward(c *caddy.Controller) (*Forward, error) { return f, nil } -// ParseForwardStanza parses one forward stanza -func ParseForwardStanza(c *caddyfile.Dispenser) (*Forward, error) { +func parseStanza(c *caddy.Controller) (*Forward, error) { f := New() if !c.Args(&f.from) { @@ -128,7 +126,7 @@ func ParseForwardStanza(c *caddyfile.Dispenser) (*Forward, error) { return f, nil } -func parseBlock(c *caddyfile.Dispenser, f *Forward) error { +func parseBlock(c *caddy.Controller, f *Forward) error { switch c.Val() { case "except": ignore := c.RemainingArgs() |