Documentation ¶
Index ¶
- func CleanPath(p string) string
- type Chain
- type Default
- type RouterInterface
- type Routers
- func (r *Routers) Add(router RouterInterface)
- 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 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)
Click to show internal directories.
Click to hide internal directories.