Moved Path type around

This commit is contained in:
Matthew Holt
2015-01-29 22:08:40 -07:00
parent 04996b2850
commit 612d77eaab
3 changed files with 16 additions and 16 deletions

13
middleware/path.go Normal file
View File

@ -0,0 +1,13 @@
package middleware
import "strings"
// Path represents a URI path, maybe with pattern characters.
type Path string
// Path matching will probably not always be a direct
// comparison; this method assures that paths can be
// easily matched.
func (p Path) Matches(other string) bool {
return strings.HasPrefix(string(p), other)
}