Documentation ¶
Index ¶
- type WildcardRouter
- func (w *WildcardRouter) AddHandler(handler http.Handler)
- func (w *WildcardRouter) MountTo(mountTo string, mux *http.ServeMux)
- func (w *WildcardRouter) NoRoute(handler http.HandlerFunc)
- func (w *WildcardRouter) ServeHTTP(writer http.ResponseWriter, req *http.Request)
- func (w *WildcardRouter) Use(middleware func(writer http.ResponseWriter, request *http.Request))
- type WildcardRouterWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WildcardRouter ¶
type WildcardRouter struct {
// contains filtered or unexported fields
}
WildcardRouter holds registered route handlers
func (*WildcardRouter) AddHandler ¶
func (w *WildcardRouter) AddHandler(handler http.Handler)
AddHandler will append new handler to Handlers
func (*WildcardRouter) MountTo ¶
func (w *WildcardRouter) MountTo(mountTo string, mux *http.ServeMux)
MountTo mount the service into mux (HTTP request multiplexer) with given path
func (*WildcardRouter) NoRoute ¶
func (w *WildcardRouter) NoRoute(handler http.HandlerFunc)
NoRoute will set handler to handle 404
func (*WildcardRouter) ServeHTTP ¶
func (w *WildcardRouter) ServeHTTP(writer http.ResponseWriter, req *http.Request)
ServeHTTP serve http for wildcard router
func (*WildcardRouter) Use ¶
func (w *WildcardRouter) Use(middleware func(writer http.ResponseWriter, request *http.Request))
Use will append new middleware
type WildcardRouterWriter ¶
type WildcardRouterWriter struct { http.ResponseWriter // contains filtered or unexported fields }
WildcardRouterWriter will used to capture status
func (WildcardRouterWriter) Status ¶
func (w WildcardRouterWriter) Status() int
Status will return request's status code
func (*WildcardRouterWriter) Write ¶
func (w *WildcardRouterWriter) Write(data []byte) (int, error)
Write only set content when not 404
func (*WildcardRouterWriter) WriteHeader ¶
func (w *WildcardRouterWriter) WriteHeader(statusCode int)
WriteHeader only set status code when not 404
Click to show internal directories.
Click to hide internal directories.