Documentation ¶
Index ¶
- func Method(method ...string) []string
- func NewStaticHandle(root string) http.Handler
- func PrepareResponse(request *context.Request, rule *Rule, result interface{}) interface{}
- func RunRoute(request *context.Request, rule *Rule) interface{}
- type Closure
- type Compiled
- type Middleware
- type Pipeline
- type Request
- type Response
- type Route
- func (r *Route) Add(method []string, pattern string, handler interface{}) *Route
- func (r *Route) AddRule(rule *Rule) *Rule
- func (r *Route) Any(pattern string, handler interface{}) *Route
- func (r *Route) Delete(pattern string, handler interface{}) *Route
- func (r *Route) Dispatch(request Request) (*Rule, error)
- func (r *Route) Get(pattern string, handler interface{}) *Route
- func (r *Route) Group(callback func(group *Route)) *Route
- func (r *Route) Head(pattern string, handler interface{}) *Route
- func (r *Route) Match(request Request) (*Rule, error)
- func (r *Route) Middleware(middlewares ...Middleware) *Route
- func (r *Route) Options(pattern string, handler interface{}) *Route
- func (r *Route) Patch(pattern string, handler interface{}) *Route
- func (r *Route) Post(pattern string, handler interface{}) *Route
- func (r *Route) Prefix(prefix string) *Route
- func (r *Route) Put(pattern string, handler interface{}) *Route
- func (r *Route) Register()
- func (r *Route) Static(path, root string)
- func (r *Route) Statics(statics map[string]string)
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStaticHandle ¶
NewStaticHandle A Handler responds to a Static HTTP request.
func PrepareResponse ¶
PrepareResponse Create a response instance from the given value.
Types ¶
type Middleware ¶
MiddlewareFunc Handle an incoming request.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
func (*Pipeline) Pipe ¶
func (p *Pipeline) Pipe(m Middleware) *Pipeline
Pipe Push a Middleware Handler to the pipeline
func (*Pipeline) Run ¶
func (p *Pipeline) Run(destination Middleware) interface{}
Run run the pipeline
func (*Pipeline) Through ¶
func (p *Pipeline) Through(hls []Middleware) *Pipeline
Pipe Batch push Middleware Handlers to the pipeline
type Response ¶
type Response interface {
Send(w http.ResponseWriter)
}
Response an HTTP response interface
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) Middleware ¶
func (r *Route) Middleware(middlewares ...Middleware) *Route
Middleware Set the middleware attached to the route.
type Rule ¶
type Rule struct { Compiled *Compiled // contains filtered or unexported fields }
Rule Route rule
func (*Rule) GatherRouteMiddleware ¶
func (r *Rule) GatherRouteMiddleware() []Middleware
GatherRouteMiddleware Get all middleware, including the ones from the controller.
func (*Rule) Middleware ¶
func (r *Rule) Middleware(middlewares ...Middleware) *Rule
Middleware Set the middleware attached to the rule.
Click to show internal directories.
Click to hide internal directories.