caddy/middleware/path.go

14 lines
333 B
Go
Raw Normal View History

2015-01-30 08:08:40 +03:00
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)
}