Documentation ¶
Index ¶
- Constants
- func MatchCondition(pairs map[string]MatchPair, url *common.URL, param *common.URL, ...) (bool, error)
- func NewConditionRouterFactory() cluster.RouterFactory
- type ConditionRouter
- func (c *ConditionRouter) MatchThen(url common.URL, param common.URL) (bool, error)
- func (c *ConditionRouter) MatchWhen(url common.URL, invocation protocol.Invocation) (bool, error)
- func (c *ConditionRouter) Route(invokers []protocol.Invoker, url common.URL, invocation protocol.Invocation) []protocol.Invoker
- type ConditionRouterFactory
- type MatchPair
Constants ¶
View Source
const ( ROUTE_PATTERN = `([&!=,]*)\\s*([^&!=,\\s]+)` FORCE = "force" PRIORITY = "priority" )
Variables ¶
This section is empty.
Functions ¶
func MatchCondition ¶
func MatchCondition(pairs map[string]MatchPair, url *common.URL, param *common.URL, invocation protocol.Invocation) (bool, error)
MatchCondition MatchCondition
func NewConditionRouterFactory ¶
func NewConditionRouterFactory() cluster.RouterFactory
Types ¶
type ConditionRouter ¶
type ConditionRouter struct { Pattern string Url *common.URL Priority int64 Force bool WhenCondition map[string]MatchPair ThenCondition map[string]MatchPair }
ConditionRouter condition router struct
func (*ConditionRouter) MatchWhen ¶
func (c *ConditionRouter) MatchWhen(url common.URL, invocation protocol.Invocation) (bool, error)
type ConditionRouterFactory ¶
type ConditionRouterFactory struct{}
Click to show internal directories.
Click to hide internal directories.