mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	Move all (almost all) Go files in middleware into their own packages. This makes for better naming and discoverability. Lot of changes elsewhere to make this change. The middleware.State was renamed to request.Request which is better, but still does not cover all use-cases. It was also moved out middleware because it is used by `dnsserver` as well. A pkg/dnsutil packages was added for shared, handy, dns util functions. All normalize functions are now put in normalize.go
		
			
				
	
	
		
			16 lines
		
	
	
		
			311 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			311 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package dnsutil
 | |
| 
 | |
| import "github.com/miekg/dns"
 | |
| 
 | |
| // DuplicateCNAME returns true if r already exists in records.
 | |
| func DuplicateCNAME(r *dns.CNAME, records []dns.RR) bool {
 | |
| 	for _, rec := range records {
 | |
| 		if v, ok := rec.(*dns.CNAME); ok {
 | |
| 			if v.Target == r.Target {
 | |
| 				return true
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| 	return false
 | |
| }
 |