Documentation
¶
Index ¶
- type Multiplexer
- func (mux *Multiplexer) DELETE(path string, h http.HandlerFunc)
- func (mux *Multiplexer) Debug()
- func (mux *Multiplexer) GET(path string, h http.HandlerFunc)
- func (mux *Multiplexer) HEAD(path string, h http.HandlerFunc)
- func (mux *Multiplexer) Handle(path string, handler http.Handler)
- func (mux *Multiplexer) HandleFunc(path string, handler func(http.ResponseWriter, *http.Request))
- func (mux *Multiplexer) Handler(r *http.Request) (h http.Handler, pattern string)
- func (mux *Multiplexer) OPTIONS(path string, h http.HandlerFunc)
- func (mux *Multiplexer) PATCH(path string, h http.HandlerFunc)
- func (mux *Multiplexer) POST(path string, h http.HandlerFunc)
- func (mux *Multiplexer) PUT(path string, h http.HandlerFunc)
- func (mux *Multiplexer) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Multiplexer ¶
type Multiplexer struct {
// contains filtered or unexported fields
}
func NewMultiplexer ¶
func NewMultiplexer() *Multiplexer
NewMultiplexer allocates and returns a new Multiplexer.
func (*Multiplexer) DELETE ¶
func (mux *Multiplexer) DELETE(path string, h http.HandlerFunc)
func (*Multiplexer) Debug ¶
func (mux *Multiplexer) Debug()
func (*Multiplexer) GET ¶
func (mux *Multiplexer) GET(path string, h http.HandlerFunc)
func (*Multiplexer) HEAD ¶
func (mux *Multiplexer) HEAD(path string, h http.HandlerFunc)
func (*Multiplexer) Handle ¶
func (mux *Multiplexer) Handle(path string, handler http.Handler)
Handle registers the handler for the given path. If a handler already exists for path, Handle panics.
func (*Multiplexer) HandleFunc ¶
func (mux *Multiplexer) HandleFunc(path string, handler func(http.ResponseWriter, *http.Request))
HandleFunc registers the handler function for the given pattern.
func (*Multiplexer) Handler ¶
Handler returns the handler to use for the given request, consulting r.Method, r.Host, and r.URL.Path. It always returns a non-nil handler. If the path is not in its canonical form, the handler will be an internally-generated handler that redirects to the canonical path.
Handler also returns the registered pattern that matches the request or, in the case of internally-generated redirects, the pattern that will match after following the redirect.
If there is no registered handler that applies to the request, Handler returns a “page not found” handler and an empty pattern.
func (*Multiplexer) OPTIONS ¶
func (mux *Multiplexer) OPTIONS(path string, h http.HandlerFunc)
func (*Multiplexer) PATCH ¶
func (mux *Multiplexer) PATCH(path string, h http.HandlerFunc)
func (*Multiplexer) POST ¶
func (mux *Multiplexer) POST(path string, h http.HandlerFunc)
func (*Multiplexer) PUT ¶
func (mux *Multiplexer) PUT(path string, h http.HandlerFunc)
func (*Multiplexer) ServeHTTP ¶
func (mux *Multiplexer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches the request to the handler whose pattern most closely matches the request URL.