mirror of
https://github.com/jwhited/wgsd.git
synced 2025-01-18 22:09:34 +08:00
24 lines
492 B
Go
24 lines
492 B
Go
package wgsd
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/coredns/coredns/plugin"
|
|
"github.com/miekg/dns"
|
|
)
|
|
|
|
// WGSD is a CoreDNS plugin that provides Wireguard peer information via DNS-SD
|
|
// semantics. WGSD implements the plugin.Handler interface.
|
|
type WGSD struct {
|
|
Next plugin.Handler
|
|
}
|
|
|
|
func (w *WGSD) ServeDNS(ctx context.Context, rw dns.ResponseWriter,
|
|
msg *dns.Msg) (int, error) {
|
|
return plugin.NextOrFailure(w.Name(), w.Next, ctx, rw, msg)
|
|
}
|
|
|
|
func (w *WGSD) Name() string {
|
|
return "wgsd"
|
|
}
|