mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
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>
This commit is contained in:
@@ -9,8 +9,7 @@ package dnsserver
|
||||
// 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{
|
||||
"tls",
|
||||
"nsid",
|
||||
"root",
|
||||
|
||||
Reference in New Issue
Block a user