mirror of
https://github.com/coredns/coredns.git
synced 2026-06-01 23:00:23 -04:00
29 lines
534 B
Go
29 lines
534 B
Go
package any
|
|
|
|
import (
|
|
"github.com/coredns/caddy"
|
|
"github.com/coredns/coredns/core/dnsserver"
|
|
"github.com/coredns/coredns/plugin"
|
|
)
|
|
|
|
func init() { plugin.Register("any", setup) }
|
|
|
|
func setup(c *caddy.Controller) error {
|
|
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()))
|
|
}
|
|
|
|
a := Any{}
|
|
|
|
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
|
|
a.Next = next
|
|
return a
|
|
})
|
|
|
|
return nil
|
|
}
|