mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-27 08:14:18 -04:00 
			
		
		
		
	all: simply registering plugins (#3287)
Abstract the caddy call and make it simpler. See #3261 for some part of the discussion. Go from: ~~~ go func init() { caddy.RegisterPlugin("any", caddy.Plugin{ ServerType: "dns", Action: setup, }) } ~~~ To: ~~~ go func init() { plugin.Register("any", setup) } ~~~ This requires some external documents in coredns.io to be updated as well; the old way still works, so it's backwards compatible. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
		| @@ -16,12 +16,7 @@ import ( | ||||
| 	"github.com/caddyserver/caddy/caddyfile" | ||||
| ) | ||||
|  | ||||
| func init() { | ||||
| 	caddy.RegisterPlugin("forward", caddy.Plugin{ | ||||
| 		ServerType: "dns", | ||||
| 		Action:     setup, | ||||
| 	}) | ||||
| } | ||||
| func init() { plugin.Register("forward", setup) } | ||||
|  | ||||
| func setup(c *caddy.Controller) error { | ||||
| 	f, err := parseForward(c) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user