mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			434 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			434 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package middleware
 | 
						|
 | 
						|
import "strings"
 | 
						|
 | 
						|
 | 
						|
// TODO(miek): matches for names.
 | 
						|
 | 
						|
// Path represents a URI path, maybe with pattern characters.
 | 
						|
type Path string
 | 
						|
 | 
						|
// Matches checks to see if other matches p.
 | 
						|
//
 | 
						|
// Path matching will probably not always be a direct
 | 
						|
// comparison; this method assures that paths can be
 | 
						|
// easily and consistently matched.
 | 
						|
func (p Path) Matches(other string) bool {
 | 
						|
	return strings.HasPrefix(string(p), other)
 | 
						|
}
 |