Documentation ¶
Overview ¶
Route the request by path
Index ¶
- type ByPattern
- type PathRouter
- func (m *PathRouter) AddLocation(pattern string, location Location) error
- func (m *PathRouter) GetLocationById(id string) Location
- func (m *PathRouter) GetLocationByPattern(pattern string) Location
- func (m *PathRouter) RemoveLocation(location Location) error
- func (m *PathRouter) Route(req Request) (Location, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathRouter ¶
type PathRouter struct {
// contains filtered or unexported fields
}
Matches the location by path regular expression. Out of two paths will select the one with the longer regular expression
func NewPathRouter ¶
func NewPathRouter() *PathRouter
func (*PathRouter) AddLocation ¶
func (m *PathRouter) AddLocation(pattern string, location Location) error
func (*PathRouter) GetLocationById ¶
func (m *PathRouter) GetLocationById(id string) Location
func (*PathRouter) GetLocationByPattern ¶
func (m *PathRouter) GetLocationByPattern(pattern string) Location
func (*PathRouter) RemoveLocation ¶
func (m *PathRouter) RemoveLocation(location Location) error
func (*PathRouter) Route ¶
func (m *PathRouter) Route(req Request) (Location, error)
Click to show internal directories.
Click to hide internal directories.