router

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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) MatchThen

func (c *ConditionRouter) MatchThen(url common.URL, param common.URL) (bool, error)

MatchThen MatchThen

func (*ConditionRouter) MatchWhen

func (c *ConditionRouter) MatchWhen(url common.URL, invocation protocol.Invocation) (bool, error)

func (*ConditionRouter) Route

func (c *ConditionRouter) Route(invokers []protocol.Invoker, url common.URL, invocation protocol.Invocation) []protocol.Invoker

Router determine the target server list.

type ConditionRouterFactory

type ConditionRouterFactory struct{}

func (ConditionRouterFactory) Router

type MatchPair

type MatchPair struct {
	Matches    *gxset.HashSet
	Mismatches *gxset.HashSet
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL