Example #1
0
func NewMiddleware(path string, sensitive bool) *Middleware {
	this := new(Middleware)
	this.path = path
	this.regex, _ = ptor.PathToRegexp(path, sensitive, false)

	return this
}
Example #2
0
func NewRoute(path string, sensitive bool) *Route {
	this := new(Route)

	this.path = path
	this.regex, this.params = ptor.PathToRegexp(path, sensitive, true)

	this.stack = make(map[string][]*Handler)
	this.methods = make(map[string]bool)

	return this
}