diff options
Diffstat (limited to 'directives_generate.go')
-rw-r--r-- | directives_generate.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/directives_generate.go b/directives_generate.go index 3ecb7e066..8c74fa573 100644 --- a/directives_generate.go +++ b/directives_generate.go @@ -17,7 +17,7 @@ func main() { mi := make(map[string]string, 0) md := make(map[int]string, 0) - file, err := os.Open(middlewareFile) + file, err := os.Open(pluginFile) fatalIfErr(err) defer file.Close() @@ -41,14 +41,14 @@ func main() { log.Fatalf("Duplicate priority '%d', slot already taken by %q", priority, v) } md[priority] = items[1] - mi[items[1]] = middlewarePath + items[2] // Default, unless overridden by 3rd arg + mi[items[1]] = pluginPath + items[2] // Default, unless overridden by 3rd arg - if _, err := os.Stat(middlewareFSPath + items[2]); err != nil { // External package has been given + if _, err := os.Stat(pluginFSPath + items[2]); err != nil { // External package has been given mi[items[1]] = items[2] } } - genImports("core/zmiddleware.go", "core", mi) + genImports("core/zplugin.go", "core", mi) genDirectives("core/dnsserver/zdirectives.go", "dnsserver", md) } @@ -59,7 +59,7 @@ func genImports(file, pack string, mi map[string]string) { outs += "\n" } - outs += "// Include all middleware.\n" + outs += "// Include all plugin.\n" for _, v := range mi { outs += `_ "` + v + `"` + "\n" } @@ -79,10 +79,10 @@ func genDirectives(file, pack string, md map[int]string) { // 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 +// Ordering is VERY important. Every plugin will +// feel the effects of all other plugin below // (after) them during a request, but they must not -// care what middleware above them are doing. +// care what plugin above them are doing. var directives = []string{ ` @@ -113,8 +113,8 @@ func fatalIfErr(err error) { } const ( - middlewarePath = "github.com/coredns/coredns/middleware/" - middlewareFile = "middleware.cfg" - middlewareFSPath = "middleware/" // Where the middleware packages are located on the file system - header = "// generated by directives_generate.go; DO NOT EDIT\n\n" + pluginPath = "github.com/coredns/coredns/plugin/" + pluginFile = "plugin.cfg" + pluginFSPath = "plugin/" // Where the plugins are located on the file system + header = "// generated by directives_generate.go; DO NOT EDIT\n\n" ) |