coredns/middleware/loadbalance/setup.go
Miek Gieben 4723fb9418 Gofmt all code (#552)
* Gofmt all code

* fmt
2017-02-22 16:06:20 +00:00

26 lines
501 B
Go

package loadbalance
import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/middleware"
"github.com/mholt/caddy"
)
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 middleware.Handler) middleware.Handler {
return RoundRobin{Next: next}
})
return nil
}