* Make CoreDNS a server type plugin for Caddy Remove code we don't need and port all middleware over. Fix all tests and rework the documentation. Also make `go generate` build a caddy binary which we then copy into our directory. This means `go build`-builds remain working as-is. And new etc instances in each etcd test for better isolation. Fix more tests and rework test.Server with the newer support Caddy offers. Fix Makefile to support new mode of operation.
28 lines
813 B
Go
28 lines
813 B
Go
package test
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/miekg/dns"
|
|
)
|
|
|
|
type ResponseWriter struct{}
|
|
|
|
func (t *ResponseWriter) LocalAddr() net.Addr {
|
|
ip := net.ParseIP("127.0.0.1")
|
|
port := 53
|
|
return &net.UDPAddr{IP: ip, Port: port, Zone: ""}
|
|
}
|
|
|
|
func (t *ResponseWriter) RemoteAddr() net.Addr {
|
|
ip := net.ParseIP("10.240.0.1")
|
|
port := 40212
|
|
return &net.UDPAddr{IP: ip, Port: port, Zone: ""}
|
|
}
|
|
|
|
func (t *ResponseWriter) WriteMsg(m *dns.Msg) error { return nil }
|
|
func (t *ResponseWriter) Write(buf []byte) (int, error) { return len(buf), nil }
|
|
func (t *ResponseWriter) Close() error { return nil }
|
|
func (t *ResponseWriter) TsigStatus() error { return nil }
|
|
func (t *ResponseWriter) TsigTimersOnly(bool) { return }
|
|
func (t *ResponseWriter) Hijack() { return }
|