Documentation ¶
Index ¶
- Variables
- type Handler
- type Mux
- func (m *Mux) Delete(path string, fn Handler)
- func (m *Mux) Get(path string, fn Handler)
- func (m *Mux) Head(path string, fn Handler)
- func (m *Mux) Instance() *way.Router
- func (m *Mux) Options(path string, fn Handler)
- func (m *Mux) Param(r *http.Request, param string) string
- func (m *Mux) Patch(path string, fn Handler)
- func (m *Mux) Post(path string, fn Handler)
- func (m *Mux) Put(path string, fn Handler)
- func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultServeHTTP = func(w http.ResponseWriter, r *http.Request, status int, err error) { if status >= 400 { if err != nil { http.Error(w, err.Error(), status) } else { http.Error(w, "", status) } } }
DefaultServeHTTP is the default ServeHTTP function that receives the status and error from the function call.
Functions ¶
This section is empty.
Types ¶
type Mux ¶
type Mux struct { // CustomServeHTTP is a settable serve function. CustomServeHTTP func(w http.ResponseWriter, r *http.Request, status int, err error) // contains filtered or unexported fields }
Mux contains the router.
Click to show internal directories.
Click to hide internal directories.