mirror of
https://github.com/coredns/coredns.git
synced 2025-10-31 18:23:13 -04:00
Cleanup: put middleware helper functions in pkgs (#245)
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
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/miekg/coredns/middleware"
|
||||
"github.com/miekg/coredns/request"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
@@ -50,7 +50,7 @@ func ParseKeyFile(pubFile, privFile string) (*DNSKEY, error) {
|
||||
}
|
||||
|
||||
// getDNSKEY returns the correct DNSKEY to the client. Signatures are added when do is true.
|
||||
func (d Dnssec) getDNSKEY(state middleware.State, zone string, do bool) *dns.Msg {
|
||||
func (d Dnssec) getDNSKEY(state request.Request, zone string, do bool) *dns.Msg {
|
||||
keys := make([]dns.RR, len(d.keys))
|
||||
for i, k := range d.keys {
|
||||
keys[i] = dns.Copy(k.K)
|
||||
|
||||
Reference in New Issue
Block a user