21 lines
436 B
Go
21 lines
436 B
Go
|
package overide
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/coredns/coredns/plugin"
|
||
|
"github.com/miekg/dns"
|
||
|
)
|
||
|
|
||
|
type Override struct {
|
||
|
Next plugin.Handler
|
||
|
Rules []Rule
|
||
|
}
|
||
|
|
||
|
func (o Override) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||
|
rw := &ResponseWrapper{ResponseWriter: w, Rules: o.Rules}
|
||
|
return plugin.NextOrFailure(o.Name(), o.Next, ctx, rw, r)
|
||
|
}
|
||
|
|
||
|
func (o Override) Name() string { return "override" }
|