Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Router ¶
type Router struct {
// NotFound is the http.Handler to call when no routes
// match. By default uses http.NotFoundHandler().
NotFound http.Handler
// contains filtered or unexported fields
}
Router routes HTTP requests.
func (*Router) Handle ¶
Handle adds a handler with the specified method and pattern. Method can be any HTTP method string or "*" to match all methods. Pattern can contain path segments such as: /item/:id which is accessible via the Param function. If pattern ends with trailing /, it acts as a prefix.
func (*Router) HandleFunc ¶
func (r *Router) HandleFunc(method, pattern string, fn http.HandlerFunc)
HandleFunc is the http.HandlerFunc alternative to http.Handle.
Click to show internal directories.
Click to hide internal directories.