Documentation ¶
Overview ¶
A collection of useful Routers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostRouter ¶
type HostRouter struct {
// contains filtered or unexported fields
}
Route requsts based on hostname
func (*HostRouter) AddMatch ¶
func (r *HostRouter) AddMatch(host string, pipe falcore.RequestFilter)
TODO: support for non-exact matches
func (*HostRouter) SelectPipeline ¶
func (r *HostRouter) SelectPipeline(req *falcore.Request) (pipe falcore.RequestFilter)
type MatchAnyRoute ¶
type MatchAnyRoute struct {
Filter falcore.RequestFilter
}
Will match any request. Useful for fallthrough filters.
func (*MatchAnyRoute) MatchString ¶
func (r *MatchAnyRoute) MatchString(str string) falcore.RequestFilter
type PathRouter ¶
Route requests based on path
func (*PathRouter) AddMatch ¶
func (r *PathRouter) AddMatch(match string, filter falcore.RequestFilter) (err error)
convenience method for adding RegexpRoutes
func (*PathRouter) AddRoute ¶
func (r *PathRouter) AddRoute(route Route)
func (*PathRouter) SelectPipeline ¶
func (r *PathRouter) SelectPipeline(req *falcore.Request) (pipe falcore.RequestFilter)
Will panic if r.Routes contains an object that isn't a Route
type RegexpRoute ¶
type RegexpRoute struct { Match *regexp.Regexp Filter falcore.RequestFilter }
Will match based on a regular expression
func (*RegexpRoute) MatchString ¶
func (r *RegexpRoute) MatchString(str string) falcore.RequestFilter
type Route ¶
type Route interface { // Returns the route's filter if there's a match. nil if there isn't MatchString(str string) falcore.RequestFilter }
Interface for defining individual routes
Click to show internal directories.
Click to hide internal directories.