Documentation ¶
Index ¶
- Constants
- Variables
- type MatchedRoute
- type Route
- type Router
- func (r *Router) ApplyHook(name string, rw http.ResponseWriter, req *http.Request)
- func (r *Router) Handle(pattern string, handler http.Handler) *Route
- func (r *Router) HandleFunc(pattern string, f func(http.ResponseWriter, *http.Request)) *Route
- func (r *Router) HookFunc(name string, f func(http.ResponseWriter, *http.Request)) *Router
- func (r *Router) MiddlewareFunc(f func(http.ResponseWriter, *http.Request)) *Router
- func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (r *Router) StrictSlash(strictSlash bool) *Router
- func (r *Router) UrlFor(name string, params map[string]interface{}) (string, bool)
Constants ¶
View Source
const ( DefaultConverter = "any" HttpMethodGet = "GET" HttpMethodPost = "POST" HttpMethodPut = "PUT" HttpMethodDelete = "DELETE" )
View Source
const ( HookBeforeRouter = "hook.before.router" HookBeforeDispatch = "hook.before.dispatch" HookAfterRouter = "hook.after.router" HookAfterDispatch = "hook.after.dispatch" )
Variables ¶
View Source
var (
DefaultReplacer = []string{"int", "\\d+", "string", "[\\w\\-]+", "any", "[^/]+"}
)
Functions ¶
This section is empty.
Types ¶
type MatchedRoute ¶
type MatchedRoute struct {
// contains filtered or unexported fields
}
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) MiddlewareFunc ¶
func (*Route) StrictSlash ¶
type Router ¶
func (*Router) HandleFunc ¶
func (*Router) MiddlewareFunc ¶
func (*Router) StrictSlash ¶
Click to show internal directories.
Click to hide internal directories.