diff options
Diffstat (limited to 'plugin/any/setup.go')
-rw-r--r-- | plugin/any/setup.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/plugin/any/setup.go b/plugin/any/setup.go new file mode 100644 index 000000000..de4697a82 --- /dev/null +++ b/plugin/any/setup.go @@ -0,0 +1,26 @@ +package any + +import ( + "github.com/coredns/coredns/core/dnsserver" + "github.com/coredns/coredns/plugin" + + "github.com/mholt/caddy" +) + +func init() { + caddy.RegisterPlugin("any", caddy.Plugin{ + ServerType: "dns", + Action: setup, + }) +} + +func setup(c *caddy.Controller) error { + a := Any{} + + dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler { + a.Next = next + return a + }) + + return nil +} |