From 004c5fca9d7dfb8b58d608e4d50833b40953441f Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Fri, 20 Sep 2019 08:02:30 +0100 Subject: all: simply registering plugins (#3287) Abstract the caddy call and make it simpler. See #3261 for some part of the discussion. Go from: ~~~ go func init() { caddy.RegisterPlugin("any", caddy.Plugin{ ServerType: "dns", Action: setup, }) } ~~~ To: ~~~ go func init() { plugin.Register("any", setup) } ~~~ This requires some external documents in coredns.io to be updated as well; the old way still works, so it's backwards compatible. Signed-off-by: Miek Gieben --- plugin/file/setup.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'plugin/file/setup.go') diff --git a/plugin/file/setup.go b/plugin/file/setup.go index ce78e815e..44ecf2ca1 100644 --- a/plugin/file/setup.go +++ b/plugin/file/setup.go @@ -13,12 +13,7 @@ import ( "github.com/caddyserver/caddy" ) -func init() { - caddy.RegisterPlugin("file", caddy.Plugin{ - ServerType: "dns", - Action: setup, - }) -} +func init() { plugin.Register("file", setup) } func setup(c *caddy.Controller) error { zones, err := fileParse(c) -- cgit v1.2.3