From c6937b0bfcf8c200a7d0fdb698838e329d37b78c Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Fri, 15 Dec 2017 01:26:36 -0600 Subject: Expose directives in dnsserver to help external plugin developers (#1315) This fix expose directives in dnsserver package, so that external plugin developers could easily build customerized coredns+plugin without changing the code base tree of coredns. The following is an example that could bundle coredns+example, in one simple file without modifying coredns codebase: ``` package main import ( _ "github.com/coredns/example" "github.com/coredns/coredns/coremain" "github.com/coredns/coredns/core/dnsserver" ) var directives = []string{ "example", "log", "errors", ... ... ... "whoami", "startup", "shutdown", } func init() { dnsserver.Directives = directives } func main() { coremain.Run() } ``` Signed-off-by: Yong Tang --- directives_generate.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'directives_generate.go') diff --git a/directives_generate.go b/directives_generate.go index b67e6dea5..ece92e329 100644 --- a/directives_generate.go +++ b/directives_generate.go @@ -81,8 +81,7 @@ func genDirectives(file, pack string, md []string) { // feel the effects of all other plugin below // (after) them during a request, but they must not // care what plugin above them are doing. - -var directives = []string{ +var Directives = []string{ ` for i := range md { -- cgit v1.2.3