Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownChannel = errors.New("Unknown channel type")
Functions ¶
func CleanPath ¶
CleanPath is the URL version of path.Clean, it returns a canonical URL path for p, eliminating . and .. elements.
The following rules are applied iteratively until no further processing can be done:
- Replace multiple slashes with a single slash.
- Eliminate each . path name element (the current directory).
- Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it.
- Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path.
If the result of this process is an empty string, "/" is returned
Types ¶
type Handler ¶
type Handler interface {
Handle(*UrlContext) error
}
type HandlerFunc ¶
type HandlerFunc func(*UrlContext) error
type PanicHandler ¶
type PanicHandler interface {
Handle(*UrlContext, interface{})
}
type Router ¶
type Router struct { PanicHandler PanicHandler NotFound Handler // contains filtered or unexported fields }
func (*Router) Handle ¶
func (r *Router) Handle(c *UrlContext) error
func (*Router) RegisterFunc ¶
func (r *Router) RegisterFunc(path string, handle HandlerFunc)
Click to show internal directories.
Click to hide internal directories.