Documentation
¶
Overview ¶
Package chirouter provides instrumentation for chi.Router.
Index ¶
- func PathToURLValues(rc *fasthttp.RequestCtx, params url.Values) error
- type Wrapper
- func (r *Wrapper) Connect(pattern string, h fchi.Handler)
- func (r *Wrapper) Delete(pattern string, h fchi.Handler)
- func (r *Wrapper) Get(pattern string, h fchi.Handler)
- func (r *Wrapper) Group(fn func(r fchi.Router)) fchi.Router
- func (r *Wrapper) Handle(pattern string, h fchi.Handler)
- func (r *Wrapper) Head(pattern string, h fchi.Handler)
- func (r *Wrapper) Method(method, pattern string, h fchi.Handler)
- func (r *Wrapper) Mount(pattern string, h fchi.Handler)
- func (r *Wrapper) Options(pattern string, h fchi.Handler)
- func (r *Wrapper) Patch(pattern string, h fchi.Handler)
- func (r *Wrapper) Post(pattern string, h fchi.Handler)
- func (r *Wrapper) Put(pattern string, h fchi.Handler)
- func (r *Wrapper) Route(pattern string, fn func(r fchi.Router)) fchi.Router
- func (r *Wrapper) Trace(pattern string, h fchi.Handler)
- func (r *Wrapper) Use(middlewares ...func(fchi.Handler) fchi.Handler)
- func (r Wrapper) With(middlewares ...func(fchi.Handler) fchi.Handler) fchi.Router
- func (r *Wrapper) Wrap(wraps ...func(handler fchi.Handler) fchi.Handler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PathToURLValues ¶
func PathToURLValues(rc *fasthttp.RequestCtx, params url.Values) error
PathToURLValues is a decoder function for parameters in path.
Types ¶
type Wrapper ¶
Wrapper wraps chi.Router to enable unwrappable handlers in middlewares.
Middlewares can call fhttp.HandlerAs to inspect wrapped handlers.
func NewWrapper ¶
NewWrapper creates router wrapper to upgrade middlewares processing.
func (*Wrapper) Connect ¶
Connect adds the route `pattern` that matches a CONNECT http method to execute the `h` fchi.Handler.
func (*Wrapper) Delete ¶
Delete adds the route `pattern` that matches a DELETE http method to execute the `h` fchi.Handler.
func (*Wrapper) Get ¶
Get adds the route `pattern` that matches a GET http method to execute the `h` fchi.Handler.
func (*Wrapper) Group ¶
Group adds a new inline-router along the current routing path, with a fresh middleware stack for the inline-router.
func (*Wrapper) Head ¶
Head adds the route `pattern` that matches a HEAD http method to execute the `h` fchi.Handler.
func (*Wrapper) Method ¶
Method adds routes for `basePattern` that matches the `method` HTTP method.
func (*Wrapper) Options ¶
Options adds the route `pattern` that matches a OPTIONS http method to execute the `h` fchi.Handler.
func (*Wrapper) Patch ¶
Patch adds the route `pattern` that matches a PATCH http method to execute the `h` fchi.Handler.
func (*Wrapper) Post ¶
Post adds the route `pattern` that matches a POST http method to execute the `h` fchi.Handler.
func (*Wrapper) Put ¶
Put adds the route `pattern` that matches a PUT http method to execute the `h` fchi.Handler.
func (*Wrapper) Trace ¶
Trace adds the route `pattern` that matches a TRACE http method to execute the `h` fchi.Handler.
func (*Wrapper) Wrap ¶
Wrap appends one or more wrappers that will be applied to handler before adding to Router. It is different from middleware in the sense that it is handler-centric, rather than request-centric. Wraps are invoked once for each added handler, they are not invoked for http requests. Wraps can leverage fhttp.HandlerAs to inspect and access deeper layers. For most cases Wrap can be safely used instead of Use, Use is mandatory for middlewares that affect routing (such as middleware.StripSlashes for example).