mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-04 03:03:14 -05:00 
			
		
		
		
	
		
			
	
	
		
			25 lines
		
	
	
		
			441 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			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
							 | 
						||
| 
								 | 
							
								}
							 |