2019-04-28 11:46:45 +01:00
|
|
|
package any
|
|
|
|
|
|
|
|
|
|
import (
|
2020-09-24 18:14:41 +02:00
|
|
|
"github.com/coredns/caddy"
|
2019-04-28 11:46:45 +01:00
|
|
|
"github.com/coredns/coredns/core/dnsserver"
|
|
|
|
|
"github.com/coredns/coredns/plugin"
|
|
|
|
|
)
|
|
|
|
|
|
2019-09-20 08:02:30 +01:00
|
|
|
func init() { plugin.Register("any", setup) }
|
2019-04-28 11:46:45 +01:00
|
|
|
|
|
|
|
|
func setup(c *caddy.Controller) error {
|
2026-06-01 02:41:27 +04:00
|
|
|
c.Next() // 'any'
|
|
|
|
|
if c.NextArg() {
|
|
|
|
|
return plugin.Error("any", c.ArgErr())
|
|
|
|
|
}
|
|
|
|
|
if c.NextBlock() {
|
|
|
|
|
return plugin.Error("any", c.Errf("unknown property '%s'", c.Val()))
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-28 11:46:45 +01:00
|
|
|
a := Any{}
|
|
|
|
|
|
|
|
|
|
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
|
|
|
|
|
a.Next = next
|
|
|
|
|
return a
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|