Documentation ¶
Index ¶
- func DefaultContextFactory(req *http.Request) context.Context
- func FromContext(c context.Context) (paramsHelper.Params, bool)
- type ContextProvider
- type HandleFunc
- type Handler
- type Middleware
- type Router
- func (r *Router) DELETE(path string, handle HandleFunc)
- func (r *Router) GET(path string, handle HandleFunc)
- func (r *Router) HEAD(path string, handle HandleFunc)
- func (r *Router) Handle(method, path string, handle HandleFunc)
- func (r *Router) Handler(method, path string, handler http.Handler)
- func (r *Router) HandlerFunc(method, path string, handler http.HandlerFunc)
- func (r *Router) Lookup(method, path string) (httprouter.Handle, httprouter.Params, bool)
- func (r *Router) OPTIONS(path string, handle HandleFunc)
- func (r *Router) PATCH(path string, handle HandleFunc)
- func (r *Router) POST(path string, handle HandleFunc)
- func (r *Router) PUT(path string, handle HandleFunc)
- func (r *Router) ServeFiles(path string, root http.FileSystem)
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) WithMiddleware(m Middleware) *Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
func FromContext(c context.Context) (paramsHelper.Params, bool)
Types ¶
type HandleFunc ¶
func (HandleFunc) ServeHTTP ¶
func (h HandleFunc) ServeHTTP(c context.Context, w http.ResponseWriter, r *http.Request)
type Middleware ¶
type Middleware func(HandleFunc) HandleFunc
type Router ¶
type Router struct { R *httprouter.Router ContextFactory ContextProvider // contains filtered or unexported fields }
func (*Router) DELETE ¶
func (r *Router) DELETE(path string, handle HandleFunc)
func (*Router) GET ¶
func (r *Router) GET(path string, handle HandleFunc)
func (*Router) HEAD ¶
func (r *Router) HEAD(path string, handle HandleFunc)
func (*Router) Handle ¶
func (r *Router) Handle(method, path string, handle HandleFunc)
func (*Router) HandlerFunc ¶
func (r *Router) HandlerFunc(method, path string, handler http.HandlerFunc)
func (*Router) Lookup ¶
func (r *Router) Lookup(method, path string) (httprouter.Handle, httprouter.Params, bool)
func (*Router) OPTIONS ¶
func (r *Router) OPTIONS(path string, handle HandleFunc)
func (*Router) PATCH ¶
func (r *Router) PATCH(path string, handle HandleFunc)
func (*Router) POST ¶
func (r *Router) POST(path string, handle HandleFunc)
func (*Router) PUT ¶
func (r *Router) PUT(path string, handle HandleFunc)
func (*Router) ServeFiles ¶
func (r *Router) ServeFiles(path string, root http.FileSystem)
func (*Router) WithMiddleware ¶
func (r *Router) WithMiddleware(m Middleware) *Router
Click to show internal directories.
Click to hide internal directories.