middleware.cfg to configure middleware directives (#496)

* Use go generate to build middleware setup based on middleware.cfg
Init default config

* generated files

* Move gen to an isolated area

* rename files

* PR review updates

* undo readme
This commit is contained in:
Bob Wasniak
2017-01-31 12:25:02 -05:00
committed by Miek Gieben
parent 738067a3c7
commit 439d8b8d12
7 changed files with 207 additions and 37 deletions

View File

@@ -1,3 +1,4 @@
//go:generate go run ../../gen/directives_generate.go ../../middleware.cfg
package dnsserver
import (
@@ -62,40 +63,3 @@ func RegisterDevDirective(name, before string) {
}
fmt.Printf("[INFO] %s\n", msg)
}
// Add here, and in core/coredns.go to use them.
// Directives are registered in the order they should be
// executed.
//
// Ordering is VERY important. Every middleware will
// feel the effects of all other middleware below
// (after) them during a request, but they must not
// care what middleware above them are doing.
var directives = []string{
"root",
"bind",
"trace",
"health",
"pprof",
"prometheus",
"errors",
"log",
"chaos",
"cache",
"rewrite",
"loadbalance",
"dnssec",
"file",
"auto",
"secondary",
"etcd",
"kubernetes",
"proxy",
"httpproxy",
"whoami",
"erratic",
}