* 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.
25 lines
456 B
Go
25 lines
456 B
Go
package loadbalance
|
|
|
|
import (
|
|
"github.com/mholt/caddy"
|
|
"github.com/miekg/coredns/core/dnsserver"
|
|
)
|
|
|
|
func init() {
|
|
caddy.RegisterPlugin("loadbalance", caddy.Plugin{
|
|
ServerType: "dns",
|
|
Action: setup,
|
|
})
|
|
}
|
|
|
|
func setup(c *caddy.Controller) error {
|
|
for c.Next() {
|
|
// TODO(miek): block and option parsing
|
|
}
|
|
|
|
dnsserver.GetConfig(c).AddMiddleware(func(next dnsserver.Handler) dnsserver.Handler {
|
|
return RoundRobin{Next: next}
|
|
})
|
|
|
|
return nil
|
|
}
|