Files
coredns/plugin/whoami/setup.go

24 lines
435 B
Go
Raw Normal View History

package whoami
import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
"github.com/caddyserver/caddy"
)
func init() { plugin.Register("whoami", setup) }
func setup(c *caddy.Controller) error {
c.Next() // 'whoami'
if c.NextArg() {
return plugin.Error("whoami", c.ArgErr())
}
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
return Whoami{}
})
return nil
}