Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PatternRoute ¶
type PlaceholderRoute ¶
type PlaceholderRoute struct {
// The HTTP method to filter on
Method string
// The placeholder pattern to match on e.g. /release/:releaseId
Pattern string
// contains filtered or unexported fields
}
You can use this to perform placeholder style routing such as "/article/:articleName". Valid placeholder patterns consist of characters A-z, 0-9, -, :, / and nothing else.
func (*PlaceholderRoute) GetPattern ¶
func (r *PlaceholderRoute) GetPattern() string
func (*PlaceholderRoute) Match ¶
func (r *PlaceholderRoute) Match(req *http.Request) *RouteMatches
func (*PlaceholderRoute) SetPattern ¶
func (r *PlaceholderRoute) SetPattern(p string) error
type RegexpRoute ¶
func (*RegexpRoute) GetPattern ¶
func (r *RegexpRoute) GetPattern() string
func (*RegexpRoute) Match ¶
func (r *RegexpRoute) Match(req *http.Request) *RouteMatches
func (*RegexpRoute) SetPattern ¶
func (r *RegexpRoute) SetPattern(p string) error
type Route ¶
type Route interface {
Match(r *http.Request) *RouteMatches
GetHandler() func(interface{})
}
type RouteMatches ¶
type RouteMatches struct {
// contains filtered or unexported fields
}
func (*RouteMatches) Add ¶
func (m *RouteMatches) Add(name, value string)
func (*RouteMatches) All ¶
func (m *RouteMatches) All() []string
func (*RouteMatches) AllNamed ¶
func (m *RouteMatches) AllNamed() map[string]string
func (*RouteMatches) Index ¶
func (m *RouteMatches) Index(i int) string
func (*RouteMatches) Named ¶
func (m *RouteMatches) Named(name string) string
type StringRoute ¶
Use this for exact matching routes with string comparison. Very basic.
func (*StringRoute) GetPattern ¶
func (r *StringRoute) GetPattern() string
func (*StringRoute) Match ¶
func (r *StringRoute) Match(req *http.Request) *RouteMatches
func (*StringRoute) SetPattern ¶
func (r *StringRoute) SetPattern(p string) error
Click to show internal directories.
Click to hide internal directories.