* 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.
22 lines
392 B
Go
22 lines
392 B
Go
package test
|
|
|
|
import (
|
|
"github.com/miekg/coredns/middleware"
|
|
|
|
"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
|
|
}
|
|
|
|
func Exchange(m *dns.Msg, server, net string) (*dns.Msg, error) {
|
|
c := new(dns.Client)
|
|
c.Net = net
|
|
return middleware.Exchange(c, m, server)
|
|
}
|