Documentation ¶
Index ¶
- Constants
- func Route(part string) func(chi.Handler) chi.Handler
- func SetAC(fn func(chi.Handler) chi.Handler)
- type Mux
- func (r *Mux) Connect(pattern string, handlers ...interface{})
- func (r *Mux) Delete(pattern string, handlers ...interface{})
- func (r *Mux) Get(pattern string, handlers ...interface{})
- func (r *Mux) Group(fn func(r chi.Router)) chi.Router
- func (r *Mux) Handle(pattern string, handlers ...interface{})
- func (r *Mux) Head(pattern string, handlers ...interface{})
- func (r *Mux) Mount(path string, handlers ...interface{})
- func (r *Mux) Options(pattern string, handlers ...interface{})
- func (r *Mux) Patch(pattern string, handlers ...interface{})
- func (r *Mux) Post(pattern string, handlers ...interface{})
- func (r *Mux) Put(pattern string, handlers ...interface{})
- func (r *Mux) Route(pattern string, fn func(r chi.Router)) chi.Router
- func (r *Mux) Trace(pattern string, handlers ...interface{})
- func (r *Mux) Use(middlewares ...interface{})
Constants ¶
const UseParentRoute = "#"
UseParentRoute passed as route to NewRouter results in nothing being added to acl.route on subrouter creation - parent route is used instead
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mux ¶
Mux implements chi.Router and makes access control with chi a bit easier
func NewRouter ¶
NewRouter creates new chakra Mux and appends its route to acl.route, unless the passed route is chakra.UseParentRoute.
func (*Mux) Connect ¶
Connect is a wrapper of chi.Connect for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Delete ¶
Delete is a wrapper of chi.Delete for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Get ¶
Get is a wrapper of chi.Get for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Group ¶
Group is a wrapper of chi.Group for chakra.Mux. It works exactly the same as the underlying chi method
func (*Mux) Handle ¶
Handle is a wrapper of chi.Handle for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Head ¶
Head is a wrapper of chi.Head for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Mount ¶
Mount is a wrapper of chi.Mount for chakra.Mux. It works exactly the same as the underlying chi method
func (*Mux) Options ¶
Options is a wrapper of chi.Options for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Patch ¶
Patch is a wrapper of chi.Patch for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Post ¶
Post is a wrapper of chi.Post for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Put ¶
Put a wrapper of chi.Put for chakra.Mux. It appends the pattern passed to it to acl.route and injects access control middleware as penultimate one - just before handler(s)
func (*Mux) Route ¶
Route is a wrapper of chi.Route for chakra.Mux. It works exactly the same as the underlying chi method