Documentation ¶
Index ¶
- func CleanPath(p string) string
- type Chain
- type Default
- type Group
- func (g *Group) CONNECT(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) DELETE(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) DefRouter(method string, path string, ac context.ActionInterface) RouterInterface
- func (g *Group) GET(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) HEAD(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) Middleware(middlewares ...context.MiddlewareInterface) *Group
- func (g *Group) Middlewares() []context.MiddlewareInterface
- func (g *Group) OPTIONS(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) PATCH(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) POST(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) PUT(path string, ac context.ActionInterface) RouterInterface
- func (g *Group) Path() string
- func (g *Group) TRACE(path string, ac context.ActionInterface) RouterInterface
- type RouterInterface
- type Routers
- func (r *Routers) Add(router RouterInterface)
- func (r *Routers) Group(path string) *Group
- func (r *Routers) Handle(method, path string, chain *Chain)
- func (r *Routers) HandleHTTP(c *context.Context)
- func (r *Routers) Lookup(method, path string) (*Chain, context.Params, bool)
- func (r *Routers) Middlerware(middlewares ...context.MiddlewareInterface)
- func (r *Routers) ServeFiles(path string, root http.FileSystem, chain *Chain)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chain ¶
type Chain struct { Middlewares []context.MiddlewareInterface Action context.ActionInterface // contains filtered or unexported fields }
type Default ¶
type Default struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault(m string, p string, a context.ActionInterface) *Default
func (*Default) Middleware ¶
func (d *Default) Middleware(middlewares ...context.MiddlewareInterface)
type Group ¶ added in v0.0.8
type Group struct {
// contains filtered or unexported fields
}
func (*Group) CONNECT ¶ added in v0.0.8
func (g *Group) CONNECT(path string, ac context.ActionInterface) RouterInterface
func (*Group) DELETE ¶ added in v0.0.8
func (g *Group) DELETE(path string, ac context.ActionInterface) RouterInterface
func (*Group) DefRouter ¶ added in v0.0.8
func (g *Group) DefRouter(method string, path string, ac context.ActionInterface) RouterInterface
func (*Group) GET ¶ added in v0.0.8
func (g *Group) GET(path string, ac context.ActionInterface) RouterInterface
func (*Group) HEAD ¶ added in v0.0.8
func (g *Group) HEAD(path string, ac context.ActionInterface) RouterInterface
func (*Group) Middleware ¶ added in v0.0.8
func (g *Group) Middleware(middlewares ...context.MiddlewareInterface) *Group
func (*Group) Middlewares ¶ added in v0.0.8
func (g *Group) Middlewares() []context.MiddlewareInterface
func (*Group) OPTIONS ¶ added in v0.0.8
func (g *Group) OPTIONS(path string, ac context.ActionInterface) RouterInterface
func (*Group) PATCH ¶ added in v0.0.8
func (g *Group) PATCH(path string, ac context.ActionInterface) RouterInterface
func (*Group) POST ¶ added in v0.0.8
func (g *Group) POST(path string, ac context.ActionInterface) RouterInterface
func (*Group) PUT ¶ added in v0.0.8
func (g *Group) PUT(path string, ac context.ActionInterface) RouterInterface
func (*Group) TRACE ¶ added in v0.0.8
func (g *Group) TRACE(path string, ac context.ActionInterface) RouterInterface
type RouterInterface ¶
type RouterInterface interface { Method() string Path() string Chain() *Chain Middleware(...context.MiddlewareInterface) }
type Routers ¶
type Routers struct { SaveMatchedRoutePath bool RedirectTrailingSlash bool RedirectFixedPath bool HandleMethodNotAllowed bool HandleOPTIONS bool GlobalOPTIONS *Chain NotFound *Chain MethodNotAllowed *Chain // contains filtered or unexported fields }
func NewRouters ¶
func NewRouters() *Routers
func (*Routers) Add ¶
func (r *Routers) Add(router RouterInterface)
func (*Routers) HandleHTTP ¶
func (*Routers) Middlerware ¶
func (r *Routers) Middlerware(middlewares ...context.MiddlewareInterface)
func (*Routers) ServeFiles ¶
func (r *Routers) ServeFiles(path string, root http.FileSystem, chain *Chain)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.