mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	
		
			
	
	
		
			20 lines
		
	
	
		
			463 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			20 lines
		
	
	
		
			463 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package setup
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import (
							 | 
						||
| 
								 | 
							
									"github.com/miekg/coredns/middleware"
							 | 
						||
| 
								 | 
							
									"github.com/miekg/coredns/middleware/loadbalance"
							 | 
						||
| 
								 | 
							
								)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// Root sets up the root file path of the server.
							 | 
						||
| 
								 | 
							
								func Loadbalance(c *Controller) (middleware.Middleware, error) {
							 | 
						||
| 
								 | 
							
									for c.Next() {
							 | 
						||
| 
								 | 
							
										// and choosing the correct balancer
							 | 
						||
| 
								 | 
							
										// TODO(miek): block and option parsing
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									return func(next middleware.Handler) middleware.Handler {
							 | 
						||
| 
								 | 
							
										return loadbalance.RoundRobin{Next: next}
							 | 
						||
| 
								 | 
							
									}, nil
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									return nil, nil
							 | 
						||
| 
								 | 
							
								}
							 |