diff options
author | 2017-12-15 01:26:36 -0600 | |
---|---|---|
committer | 2017-12-15 07:26:36 +0000 | |
commit | c6937b0bfcf8c200a7d0fdb698838e329d37b78c (patch) | |
tree | 699ebc04d027321c0654b22b56911995f219b3be /directives_generate.go | |
parent | cee6f60ab870a235dc7e052a4b5e4e7e64643f62 (diff) | |
download | coredns-c6937b0bfcf8c200a7d0fdb698838e329d37b78c.tar.gz coredns-c6937b0bfcf8c200a7d0fdb698838e329d37b78c.tar.zst coredns-c6937b0bfcf8c200a7d0fdb698838e329d37b78c.zip |
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 <yong.tang.github@outlook.com>
Diffstat (limited to 'directives_generate.go')
-rw-r--r-- | directives_generate.go | 3 |
1 files changed, 1 insertions, 2 deletions
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 { |