Documentation ¶
Overview ¶
URL router provides a simple clean way of setting up multiplexed url routes.
Index ¶
Constants ¶
View Source
const (
NAMED_PAAMTERS urlNamedParameter = "urlrouter_named_parameters"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) HandleFunc ¶
func (router *Router) HandleFunc(method string, path string, handlerFunc http.HandlerFunc)
Add a new url handler to the router. If a route already exists with the same url path, then this will overwrite the previous handler.
PARAMS: - method - API method to match against. Commonly one of: POST, PUT, PATCH, GET, DELETE - path - The path of a URL. This will panic if path is the empty string - handlerFunc - handler callback to used when a pathi is found. This will panic if the handlerFunc is nil
Click to show internal directories.
Click to hide internal directories.