Documentation
¶
Index ¶
- func Param(r *http.Request, param string) string
- func ParamInt(r *http.Request, param string) int
- type Key
- type Mux
- func (m *Mux) Connect(path string, handler http.HandlerFunc)
- func (m *Mux) Delete(path string, handler http.HandlerFunc)
- func (m *Mux) Get(path string, handler http.HandlerFunc)
- func (m *Mux) Head(path string, handler http.HandlerFunc)
- func (m *Mux) NotFound(handler http.HandlerFunc)
- func (m *Mux) NotFoundHandler() http.HandlerFunc
- func (m *Mux) Options(path string, handler http.HandlerFunc)
- func (m *Mux) Patch(path string, handler http.HandlerFunc)
- func (m *Mux) Post(path string, handler http.HandlerFunc)
- func (m *Mux) Put(path string, handler http.HandlerFunc)
- func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Mux) Trace(path string, handler http.HandlerFunc)
- func (m *Mux) Use(middleware func(http.Handler) http.Handler)
- func (m *Mux) With(middleware func(http.Handler) http.Handler) *Mux
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Key ¶
type Key string
Key is a type alias for string
var ParamKey Key = "params"
ParamKey is the key used to store the path parameters in the request context
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux is a simple HTTP request multiplexer
func (*Mux) Connect ¶
func (m *Mux) Connect(path string, handler http.HandlerFunc)
Connect adds a new route for the CONNECT HTTP method
func (*Mux) Delete ¶
func (m *Mux) Delete(path string, handler http.HandlerFunc)
Delete adds a new route for the DELETE HTTP method
func (*Mux) Get ¶
func (m *Mux) Get(path string, handler http.HandlerFunc)
Get adds a new route for the GET HTTP method
func (*Mux) Head ¶
func (m *Mux) Head(path string, handler http.HandlerFunc)
Head adds a new route for the HEAD HTTP method
func (*Mux) NotFound ¶
func (m *Mux) NotFound(handler http.HandlerFunc)
NotFound sets the handler to be called when no matching route is found
func (*Mux) NotFoundHandler ¶
func (m *Mux) NotFoundHandler() http.HandlerFunc
NotFoundHandler returns the handler to be called when no matching route is found
func (*Mux) Options ¶
func (m *Mux) Options(path string, handler http.HandlerFunc)
Options adds a new route for the OPTIONS HTTP method
func (*Mux) Patch ¶
func (m *Mux) Patch(path string, handler http.HandlerFunc)
Patch adds a new route for the PATCH HTTP method
func (*Mux) Post ¶
func (m *Mux) Post(path string, handler http.HandlerFunc)
Post adds a new route for the POST HTTP method
func (*Mux) Put ¶
func (m *Mux) Put(path string, handler http.HandlerFunc)
Put adds a new route for the PUT HTTP method
func (*Mux) ServeHTTP ¶
func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface and handles incoming requests
func (*Mux) Trace ¶
func (m *Mux) Trace(path string, handler http.HandlerFunc)
Trace adds a new route for the TRACE HTTP method