Documentation
¶
Overview ¶
Package mux implements an HTTP request multiplexer.
Index ¶
- Variables
- func Recovery(w http.ResponseWriter, r *http.Request)
- type Entry
- func (entry *Entry) All()
- func (entry *Entry) CONNECT() *Entry
- func (entry *Entry) DELETE() *Entry
- func (entry *Entry) GET() *Entry
- func (entry *Entry) HEAD() *Entry
- func (entry *Entry) OPTIONS() *Entry
- func (entry *Entry) PATCH() *Entry
- func (entry *Entry) POST() *Entry
- func (entry *Entry) PUT() *Entry
- func (entry *Entry) TRACE() *Entry
- type Mux
- func (m *Mux) Group(group string, f func(m *Mux))
- func (m *Mux) Handle(pattern string, handler http.Handler) *Entry
- func (m *Mux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) *Entry
- func (m *Mux) NotFound(handler http.HandlerFunc)
- func (m *Mux) Params(r *http.Request) map[string]string
- func (m *Mux) Recovery(handler http.HandlerFunc)
- func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Mux) Use(handler http.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrGroupExisted = errors.New("Group Existed")
ErrGroupExisted is the error returned by Group when registers a existed group.
View Source
var ErrParamsKeyEmpty = errors.New("Params key must be not empty")
ErrParamsKeyEmpty is the error returned by HandleFunc when the params key is empty.
View Source
var RecoveryContextKey = &contextKey{"recovery"}
RecoveryContextKey is a context key.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry represents an HTTP HandlerFunc entry.
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux is an HTTP request multiplexer.
func (*Mux) HandleFunc ¶
HandleFunc registers a handler function with the given pattern to the Mux.
func (*Mux) NotFound ¶
func (m *Mux) NotFound(handler http.HandlerFunc)
NotFound registers a not found handler function to the Mux.
func (*Mux) Recovery ¶ added in v0.0.2
func (m *Mux) Recovery(handler http.HandlerFunc)
Recovery registers a recovery handler function to the Mux.
Click to show internal directories.
Click to hide internal directories.