Cleanup ParseHostOrFile (#2100)
Create plugin/pkg/transport that holds the transport related functions. This needed to be a new pkg to prevent cyclic import errors. This cleans up a bunch of duplicated code in core/dnsserver that also tried to parse a transport (now all done in transport.Parse). Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
parent
2f1223c36a
commit
c349446a23
24 changed files with 182 additions and 221 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/coredns/coredns/plugin/pkg/dnstest"
|
||||
"github.com/coredns/coredns/plugin/pkg/transport"
|
||||
"github.com/coredns/coredns/plugin/test"
|
||||
"github.com/coredns/coredns/request"
|
||||
|
||||
|
@ -26,7 +27,7 @@ func TestProxyClose(t *testing.T) {
|
|||
ctx := context.TODO()
|
||||
|
||||
for i := 0; i < 100; i++ {
|
||||
p := NewProxy(s.Addr, DNS)
|
||||
p := NewProxy(s.Addr, transport.DNS)
|
||||
p.start(hcInterval)
|
||||
|
||||
go func() { p.Connect(ctx, state, options{}) }()
|
||||
|
@ -95,7 +96,7 @@ func TestProxyTLSFail(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestProtocolSelection(t *testing.T) {
|
||||
p := NewProxy("bad_address", DNS)
|
||||
p := NewProxy("bad_address", transport.DNS)
|
||||
|
||||
stateUDP := request.Request{W: &test.ResponseWriter{}, Req: new(dns.Msg)}
|
||||
stateTCP := request.Request{W: &test.ResponseWriter{TCP: true}, Req: new(dns.Msg)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue