mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	
		
			
	
	
		
			27 lines
		
	
	
		
			416 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			27 lines
		
	
	
		
			416 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package any
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import (
							 | 
						||
| 
								 | 
							
									"github.com/coredns/coredns/core/dnsserver"
							 | 
						||
| 
								 | 
							
									"github.com/coredns/coredns/plugin"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									"github.com/mholt/caddy"
							 | 
						||
| 
								 | 
							
								)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								func init() {
							 | 
						||
| 
								 | 
							
									caddy.RegisterPlugin("any", caddy.Plugin{
							 | 
						||
| 
								 | 
							
										ServerType: "dns",
							 | 
						||
| 
								 | 
							
										Action:     setup,
							 | 
						||
| 
								 | 
							
									})
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								func setup(c *caddy.Controller) error {
							 | 
						||
| 
								 | 
							
									a := Any{}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
							 | 
						||
| 
								 | 
							
										a.Next = next
							 | 
						||
| 
								 | 
							
										return a
							 | 
						||
| 
								 | 
							
									})
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									return nil
							 | 
						||
| 
								 | 
							
								}
							 |