Documentation ¶
Index ¶
- type ChainedMiddlewares
- func (cmw *ChainedMiddlewares) Delete(path string, handler HandlerFunc)
- func (cmw *ChainedMiddlewares) Get(path string, handler HandlerFunc)
- func (cmw *ChainedMiddlewares) Head(path string, handler HandlerFunc)
- func (cmw *ChainedMiddlewares) Options(path string, handler HandlerFunc)
- func (cmw *ChainedMiddlewares) Patch(path string, handler HandlerFunc)
- func (cmw *ChainedMiddlewares) Post(path string, handler HandlerFunc)
- func (cmw *ChainedMiddlewares) Then(method, path string, handler HandlerFunc)
- type HandlerFunc
- type MiddlewareFunc
- type Options
- type Router
- func (r *Router) Delete(path string, handler HandlerFunc)
- func (r *Router) Get(path string, handler HandlerFunc)
- func (r *Router) Handle(path string, handler http.Handler)
- func (r *Router) HandleFunc(method, path string, handler HandlerFunc)
- func (r *Router) Head(path string, handler HandlerFunc)
- func (r *Router) Options(path string, handler HandlerFunc)
- func (r *Router) Patch(path string, handler HandlerFunc)
- func (r *Router) PathPrefix(tpl string) *mux.Route
- func (r *Router) Post(path string, handler HandlerFunc)
- func (r *Router) Routes() []*mux.Route
- func (r *Router) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (r *Router) Use(middlewares ...MiddlewareFunc)
- func (r *Router) Vars(req *http.Request) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainedMiddlewares ¶
type ChainedMiddlewares struct {
// contains filtered or unexported fields
}
ChainedMiddlewares type
func NewChainedMiddleware ¶
func NewChainedMiddleware(r *Router, middlewares ...MiddlewareFunc) *ChainedMiddlewares
NewChainedMiddleware function
func (*ChainedMiddlewares) Delete ¶
func (cmw *ChainedMiddlewares) Delete(path string, handler HandlerFunc)
Delete right from router
func (*ChainedMiddlewares) Get ¶
func (cmw *ChainedMiddlewares) Get(path string, handler HandlerFunc)
Get right from router
func (*ChainedMiddlewares) Head ¶
func (cmw *ChainedMiddlewares) Head(path string, handler HandlerFunc)
Head right from router
func (*ChainedMiddlewares) Options ¶
func (cmw *ChainedMiddlewares) Options(path string, handler HandlerFunc)
Options right from router
func (*ChainedMiddlewares) Patch ¶
func (cmw *ChainedMiddlewares) Patch(path string, handler HandlerFunc)
Patch right from router
func (*ChainedMiddlewares) Post ¶
func (cmw *ChainedMiddlewares) Post(path string, handler HandlerFunc)
Post right from router
func (*ChainedMiddlewares) Then ¶
func (cmw *ChainedMiddlewares) Then(method, path string, handler HandlerFunc)
Then function
type HandlerFunc ¶
type HandlerFunc func(ctx *requestcontext.RequestContext) error
HandlerFunc to handle http request
type MiddlewareFunc ¶
type MiddlewareFunc func(HandlerFunc) HandlerFunc
MiddlewareFunc to handle middleware chaining
func (MiddlewareFunc) Next ¶
func (mw MiddlewareFunc) Next(handler HandlerFunc) HandlerFunc
Next function
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router struct
func (*Router) HandleFunc ¶
func (r *Router) HandleFunc(method, path string, handler HandlerFunc)
HandleFunc function
func (*Router) Options ¶
func (r *Router) Options(path string, handler HandlerFunc)
Options function
func (*Router) PathPrefix ¶
PathPrefix implementation of mux router this function is not using custom handleRoute functions metrics/diagnostics will not exported from this method
Click to show internal directories.
Click to hide internal directories.