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:
parent
684330fd28
commit
d1f17fa7e0
90 changed files with 680 additions and 1037 deletions
|
@ -9,11 +9,11 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/miekg/coredns/middleware"
|
||||
"github.com/miekg/coredns/middleware/etcd"
|
||||
"github.com/miekg/coredns/middleware/etcd/msg"
|
||||
"github.com/miekg/coredns/middleware/proxy"
|
||||
"github.com/miekg/coredns/middleware/test"
|
||||
"github.com/miekg/coredns/request"
|
||||
|
||||
etcdc "github.com/coreos/etcd/client"
|
||||
"github.com/miekg/dns"
|
||||
|
@ -67,7 +67,7 @@ func TestEtcdStubAndProxyLookup(t *testing.T) {
|
|||
}
|
||||
|
||||
p := proxy.New([]string{udp}) // use udp port from the server
|
||||
state := middleware.State{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
|
||||
state := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
|
||||
resp, err := p.Lookup(state, "example.com.", dns.TypeA)
|
||||
if err != nil {
|
||||
t.Error("Expected to receive reply, but didn't")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue