mirror of
https://github.com/coredns/coredns.git
synced 2025-11-08 13:06:24 -05:00
add local plugin (#4262)
* add local plugin See: #4260 Signed-off-by: Miek Gieben <miek@miek.nl> * stickler bot Signed-off-by: Miek Gieben <miek@miek.nl> * See Also Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
20
plugin/local/setup.go
Normal file
20
plugin/local/setup.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package local
|
||||
|
||||
import (
|
||||
"github.com/coredns/caddy"
|
||||
"github.com/coredns/coredns/core/dnsserver"
|
||||
"github.com/coredns/coredns/plugin"
|
||||
)
|
||||
|
||||
func init() { plugin.Register("local", setup) }
|
||||
|
||||
func setup(c *caddy.Controller) error {
|
||||
l := Local{}
|
||||
|
||||
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
|
||||
l.Next = next
|
||||
return l
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user