Documentation ¶
Index ¶
- Variables
- func Parse(rules []router.AppendRule) router.MatcherChecker
- type AppendMatcher
- type AppendMatchers
- type CheckMatcher
- type CheckerHandler
- type CheckerSort
- type CookieChecker
- type EmptyMatcher
- type Handler
- type HeaderChecker
- type Hosts
- type IBuilder
- type Methods
- type Paths
- type Ports
- type Protocols
- type QueryChecker
- type Root
- type RuleType
- type SimpleMatcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorDuplicate = errors.New("duplicate")
Functions ¶
func Parse ¶
func Parse(rules []router.AppendRule) router.MatcherChecker
Types ¶
type AppendMatcher ¶
type AppendMatcher struct {
// contains filtered or unexported fields
}
func (*AppendMatcher) Match ¶
func (a *AppendMatcher) Match(port int, req interface{}) (router.IRouterHandler, bool)
type AppendMatchers ¶
type AppendMatchers []*AppendMatcher
func (AppendMatchers) Len ¶
func (as AppendMatchers) Len() int
func (AppendMatchers) Less ¶
func (as AppendMatchers) Less(i, j int) bool
func (AppendMatchers) Match ¶
func (as AppendMatchers) Match(port int, request interface{}) (router.IRouterHandler, bool)
func (AppendMatchers) Swap ¶
func (as AppendMatchers) Swap(i, j int)
type CheckMatcher ¶
type CheckMatcher struct {
// contains filtered or unexported fields
}
func NewPathMatcher ¶
func NewPathMatcher(equals map[string]router.IMatcher, checkers []*CheckerHandler, all router.IMatcher) *CheckMatcher
func (*CheckMatcher) Match ¶
func (c *CheckMatcher) Match(port int, req interface{}) (router.IRouterHandler, bool)
type CheckerHandler ¶
type CheckerHandler struct {
// contains filtered or unexported fields
}
type CheckerSort ¶
type CheckerSort []*CheckerHandler
func (CheckerSort) Len ¶
func (cs CheckerSort) Len() int
func (CheckerSort) Less ¶
func (cs CheckerSort) Less(i, j int) bool
func (CheckerSort) Swap ¶
func (cs CheckerSort) Swap(i, j int)
type CookieChecker ¶
func (*CookieChecker) MatchCheck ¶
func (c *CookieChecker) MatchCheck(req interface{}) bool
func (*CookieChecker) Weight ¶ added in v0.10.0
func (c *CookieChecker) Weight() int
type EmptyMatcher ¶
type EmptyMatcher struct {
// contains filtered or unexported fields
}
func (*EmptyMatcher) Match ¶
func (e *EmptyMatcher) Match(port int, request interface{}) (router.IRouterHandler, bool)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(id string, handler router.IRouterHandler, appends []router.AppendRule) *Handler
type HeaderChecker ¶
func (*HeaderChecker) MatchCheck ¶
func (h *HeaderChecker) MatchCheck(req interface{}) bool
func (*HeaderChecker) Weight ¶ added in v0.10.0
func (h *HeaderChecker) Weight() int
type Hosts ¶
type Hosts struct {
// contains filtered or unexported fields
}
type Methods ¶
type Methods struct {
// contains filtered or unexported fields
}
func NewMethods ¶
func NewMethods() *Methods
func (*Methods) Add ¶
func (m *Methods) Add(id string, handler router.IRouterHandler, path string, append []router.AppendRule) error
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
func (*Paths) Add ¶
func (p *Paths) Add(id string, handler router.IRouterHandler, append []router.AppendRule) error
type Protocols ¶ added in v0.17.0
type Protocols struct {
// contains filtered or unexported fields
}
func NewProtocols ¶ added in v0.17.0
func NewProtocols() *Protocols
type QueryChecker ¶
func (*QueryChecker) MatchCheck ¶
func (q *QueryChecker) MatchCheck(req interface{}) bool
func (*QueryChecker) Weight ¶ added in v0.10.0
func (q *QueryChecker) Weight() int
type SimpleMatcher ¶
type SimpleMatcher struct {
// contains filtered or unexported fields
}
func (*SimpleMatcher) Match ¶
func (s *SimpleMatcher) Match(port int, req interface{}) (router.IRouterHandler, bool)
Click to show internal directories.
Click to hide internal directories.