mirror of
https://github.com/jwhited/wgsd.git
synced 2025-01-18 13:59:34 +08:00
21 lines
428 B
Go
21 lines
428 B
Go
|
package wgsd
|
||
|
|
||
|
import (
|
||
|
"github.com/caddyserver/caddy"
|
||
|
"github.com/coredns/coredns/core/dnsserver"
|
||
|
"github.com/coredns/coredns/plugin"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
plugin.Register("wgsd", setup)
|
||
|
}
|
||
|
|
||
|
func setup(c *caddy.Controller) error {
|
||
|
// Add the Plugin to CoreDNS, so Servers can use it in their plugin chain.
|
||
|
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
|
||
|
return &WGSD{Next: next}
|
||
|
})
|
||
|
|
||
|
return nil
|
||
|
}
|