• Yong Tang's avatar
    Expose directives in dnsserver to help external plugin developers (#1315) · c6937b0b
    Yong Tang authored
    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: default avatarYong Tang <yong.tang.github@outlook.com>
    c6937b0b
register.go 6.11 KB