Documentation ¶
Index ¶
- Constants
- Variables
- func Key(rules []AppendRule) string
- type AppendMatcher
- type AppendMatchers
- type AppendRule
- type AppendRules
- type CheckMatcher
- type CheckerHandler
- type CheckerSort
- type CookieChecker
- type EmptyChecker
- type EmptyMatcher
- type Handler
- type HeaderChecker
- type Hosts
- type IBuilder
- type IMatcher
- type IRouterHandler
- type MatcherChecker
- type MatcherCheckerItem
- type Methods
- type Paths
- type Ports
- type QueryChecker
- type Root
- type RuleCheckers
- type RuleType
- type SimpleMatcher
Constants ¶
View Source
const All = "*"
Variables ¶
View Source
var ErrorDuplicate = errors.New("duplicate")
Functions ¶
func Key ¶
func Key(rules []AppendRule) string
Types ¶
type AppendMatcher ¶
type AppendMatcher struct {
// contains filtered or unexported fields
}
func (*AppendMatcher) Match ¶
func (a *AppendMatcher) Match(port int, request http_service.IRequestReader) (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 http_service.IRequestReader) (IRouterHandler, bool)
func (AppendMatchers) Swap ¶
func (as AppendMatchers) Swap(i, j int)
type AppendRule ¶
type AppendRules ¶
type AppendRules []AppendRule
func (AppendRules) Len ¶
func (as AppendRules) Len() int
func (AppendRules) Less ¶
func (as AppendRules) Less(i, j int) bool
func (AppendRules) Swap ¶
func (as AppendRules) Swap(i, j int)
type CheckMatcher ¶
type CheckMatcher struct {
// contains filtered or unexported fields
}
func NewPathMatcher ¶
func NewPathMatcher(equals map[string]IMatcher, checkers []*CheckerHandler, all IMatcher) *CheckMatcher
func (*CheckMatcher) Match ¶
func (c *CheckMatcher) Match(port int, request http_service.IRequestReader) (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(request http_service.IRequestReader) bool
type EmptyChecker ¶
type EmptyChecker struct { }
func (*EmptyChecker) MatchCheck ¶
func (e *EmptyChecker) MatchCheck(request http_service.IRequestReader) bool
type EmptyMatcher ¶
type EmptyMatcher struct {
// contains filtered or unexported fields
}
func (*EmptyMatcher) Match ¶
func (e *EmptyMatcher) Match(port int, request http_service.IRequestReader) (IRouterHandler, bool)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(id string, handler IRouterHandler, appends []AppendRule) *Handler
type HeaderChecker ¶
func (*HeaderChecker) MatchCheck ¶
func (h *HeaderChecker) MatchCheck(request http_service.IRequestReader) bool
type Hosts ¶
type Hosts struct {
// contains filtered or unexported fields
}
func (*Hosts) Add ¶
func (h *Hosts) Add(id string, handler IRouterHandler, methods []string, path string, append []AppendRule) error
type IMatcher ¶
type IMatcher interface {
Match(port int, request http_service.IRequestReader) (IRouterHandler, bool)
}
type IRouterHandler ¶
type IRouterHandler interface {
ServeHTTP(ctx eoscContext.EoContext)
}
type MatcherChecker ¶
type MatcherChecker interface { MatchCheck(request http_service.IRequestReader) bool // contains filtered or unexported methods }
func Parse ¶
func Parse(rules []AppendRule) MatcherChecker
type MatcherCheckerItem ¶
type MatcherCheckerItem interface { checker.Checker MatcherChecker }
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 IRouterHandler, path string, append []AppendRule) error
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
func (*Paths) Add ¶
func (p *Paths) Add(id string, handler IRouterHandler, append []AppendRule) error
type Ports ¶
type Ports struct {
// contains filtered or unexported fields
}
func (*Ports) Add ¶
func (p *Ports) Add(id string, handler IRouterHandler, hosts []string, methods []string, path string, append []AppendRule) error
type QueryChecker ¶
func (*QueryChecker) MatchCheck ¶
func (q *QueryChecker) MatchCheck(request http_service.IRequestReader) bool
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
type RuleCheckers ¶
type RuleCheckers []MatcherCheckerItem
func (RuleCheckers) Len ¶
func (rs RuleCheckers) Len() int
func (RuleCheckers) Less ¶
func (rs RuleCheckers) Less(i, j int) bool
func (RuleCheckers) MatchCheck ¶
func (rs RuleCheckers) MatchCheck(request http_service.IRequestReader) bool
func (RuleCheckers) Swap ¶
func (rs RuleCheckers) Swap(i, j int)
type SimpleMatcher ¶
type SimpleMatcher struct {
// contains filtered or unexported fields
}
func (*SimpleMatcher) Match ¶
func (s *SimpleMatcher) Match(port int, request http_service.IRequestReader) (IRouterHandler, bool)
Click to show internal directories.
Click to hide internal directories.