Skip to content
Snippets Groups Projects
Commit 1e61acb1 authored by 邹毅贤's avatar 邹毅贤
Browse files

fix review comment

parent 26d7af9b
Branches
Tags
No related merge requests found
......@@ -46,12 +46,12 @@ type BaseDirectory struct {
routerChain router.Chain
}
// RouterChain return router chain in directory
// RouterChain Return router chain in directory
func (dir *BaseDirectory) RouterChain() router.Chain {
return dir.routerChain
}
// SetRouterChain set router chain in directory
// SetRouterChain Set router chain in directory
func (dir *BaseDirectory) SetRouterChain(routerChain router.Chain) {
dir.mutex.Lock()
defer dir.mutex.Unlock()
......@@ -77,7 +77,7 @@ func (dir *BaseDirectory) GetDirectoryUrl() *common.URL {
return dir.url
}
// SetRouters convert url to routers and add them into dir.routerChain
// SetRouters Convert url to routers and add them into dir.routerChain
func (dir *BaseDirectory) SetRouters(urls []*common.URL) {
if len(urls) == 0 {
return
......@@ -121,13 +121,13 @@ func (dir *BaseDirectory) IsAvailable() bool {
return !dir.destroyed.Load()
}
// GetRouterURLSet return router URL
// GetRouterURLSet Return router URL
func GetRouterURLSet() *gxset.HashSet {
return routerURLSet
}
// AddRouterURLSet add router URL
// router URL will init in config/config_loader.go
// AddRouterURLSet Add router URL
// Router URL will init in config/config_loader.go
func AddRouterURLSet(url *common.URL) {
routerURLSet.Add(url)
}
......@@ -36,9 +36,9 @@ import (
// RouterChain Router chain
type RouterChain struct {
//full list of addresses from registry, classified by method name.
// Full list of addresses from registry, classified by method name.
invokers []protocol.Invoker
//containing all routers, reconstruct every time 'route://' urls change.
// Containing all routers, reconstruct every time 'route://' urls change.
routers []router.Router
// Fixed router instances: ConfigConditionRouter, TagRouter, e.g., the rule for each instance may change but the
// instance will never delete or recreate.
......
......@@ -45,7 +45,7 @@ var (
routerPatternReg = regexp.MustCompile(`([&!=,]*)\s*([^&!=,\s]+)`)
)
//ConditionRouter condition router struct
// ConditionRouter Condition router struct
type ConditionRouter struct {
Pattern string
url *common.URL
......@@ -289,7 +289,7 @@ func matchCondition(pairs map[string]MatchPair, url *common.URL, param *common.U
return result
}
// MatchPair ...
// MatchPair Match key pair , condition process
type MatchPair struct {
Matches *gxset.HashSet
Mismatches *gxset.HashSet
......
......@@ -21,7 +21,7 @@ import (
"github.com/apache/dubbo-go/cluster/router"
)
// RouterRule
// RouterRule RouterRule config read from config file or config center
type RouterRule struct {
router.BaseRouterRule `yaml:",inline""`
Conditions []string
......
......@@ -24,8 +24,9 @@ import (
// Extension - Router
// RouterFactory ...
// RouterFactory Router create factory
type RouterFactory interface {
// NewRouter Create router instance with URL
NewRouter(*common.URL) (Router, error)
}
......
......@@ -59,7 +59,7 @@ const (
var (
// DubboNodes ...
DubboNodes = [...]string{"consumers", "configurators", "routers", "providers"}
// DubboRole dubbo service role
// DubboRole Dubbo service role
DubboRole = [...]string{"consumer", "", "routers", "provider"}
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment