diff options
Diffstat (limited to 'plugin/loadbalance/setup.go')
-rw-r--r-- | plugin/loadbalance/setup.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/plugin/loadbalance/setup.go b/plugin/loadbalance/setup.go new file mode 100644 index 000000000..c2d90958e --- /dev/null +++ b/plugin/loadbalance/setup.go @@ -0,0 +1,26 @@ +package loadbalance + +import ( + "github.com/coredns/coredns/core/dnsserver" + "github.com/coredns/coredns/plugin" + "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).AddPlugin(func(next plugin.Handler) plugin.Handler { + return RoundRobin{Next: next} + }) + + return nil +} |