Move all (almost all) Go files in middleware into their own packages. This makes for better naming and discoverability. Lot of changes elsewhere to make this change. The middleware.State was renamed to request.Request which is better, but still does not cover all use-cases. It was also moved out middleware because it is used by `dnsserver` as well. A pkg/dnsutil packages was added for shared, handy, dns util functions. All normalize functions are now put in normalize.go
12 lines
201 B
Go
12 lines
201 B
Go
package test
|
|
|
|
import "github.com/miekg/dns"
|
|
|
|
func Msg(zone string, typ uint16, o *dns.OPT) *dns.Msg {
|
|
m := new(dns.Msg)
|
|
m.SetQuestion(zone, typ)
|
|
if o != nil {
|
|
m.Extra = []dns.RR{o}
|
|
}
|
|
return m
|
|
}
|