Files
1e3f40dc04 Added minimal-responses plugin (#4417)
* Added minimal-responses plugin

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* Removed unnecessary comments

* Updated tests

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* Reformated imports

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* Updated package name

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* Removed  unnecessary comments

Co-authored-by: Miek Gieben <[email protected]>

* Added changes

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* updated

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* Updated comment for NextOrFailure

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* Updated to test.Case for testing

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

* Formated imports using goimports

Signed-off-by: Soumya Ghosh Dastidar <[email protected]>

Co-authored-by: Miek Gieben <[email protected]>
2021-03-15 15:37:55 +01:00

25 lines
441 B
Go

package minimal
import (
"github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
)
func init() {
plugin.Register("minimal", setup)
}
func setup(c *caddy.Controller) error {
c.Next()
if c.NextArg() {
return plugin.Error("minimal", c.ArgErr())
}
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
return &minimalHandler{Next: next}
})
return nil
}