Skip to content

Commit

Permalink
Merge pull request #495 from cvictory/getty_reactor
Browse files Browse the repository at this point in the history
Imp: refactor the network transport layer
  • Loading branch information
hxmhlt authored Jun 4, 2020
2 parents 8a3c02c + 5ba2307 commit a10ff4d
Show file tree
Hide file tree
Showing 29 changed files with 2,526 additions and 1,231 deletions.
39 changes: 20 additions & 19 deletions common/constant/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,26 @@ const (
)

const (
GROUP_KEY = "group"
VERSION_KEY = "version"
INTERFACE_KEY = "interface"
PATH_KEY = "path"
SERVICE_KEY = "service"
METHODS_KEY = "methods"
TIMEOUT_KEY = "timeout"
CATEGORY_KEY = "category"
CHECK_KEY = "check"
ENABLED_KEY = "enabled"
SIDE_KEY = "side"
OVERRIDE_PROVIDERS_KEY = "providerAddresses"
BEAN_NAME_KEY = "bean.name"
GENERIC_KEY = "generic"
CLASSIFIER_KEY = "classifier"
TOKEN_KEY = "token"
LOCAL_ADDR = "local-addr"
REMOTE_ADDR = "remote-addr"
PATH_SEPARATOR = "/"
GROUP_KEY = "group"
VERSION_KEY = "version"
INTERFACE_KEY = "interface"
PATH_KEY = "path"
SERVICE_KEY = "service"
METHODS_KEY = "methods"
TIMEOUT_KEY = "timeout"
CATEGORY_KEY = "category"
CHECK_KEY = "check"
ENABLED_KEY = "enabled"
SIDE_KEY = "side"
OVERRIDE_PROVIDERS_KEY = "providerAddresses"
BEAN_NAME_KEY = "bean.name"
GENERIC_KEY = "generic"
CLASSIFIER_KEY = "classifier"
TOKEN_KEY = "token"
LOCAL_ADDR = "local-addr"
REMOTE_ADDR = "remote-addr"
PATH_SEPARATOR = "/"
DEFAULT_REMOTING_TIMEOUT = 3000
)

const (
Expand Down
8 changes: 5 additions & 3 deletions common/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,20 +318,22 @@ func (c URL) Key() string {

// ServiceKey ...
func (c URL) ServiceKey() string {
intf := c.GetParam(constant.INTERFACE_KEY, strings.TrimPrefix(c.Path, "/"))
return ServiceKey(c.GetParam(constant.INTERFACE_KEY, strings.TrimPrefix(c.Path, "/")),
c.GetParam(constant.GROUP_KEY, ""), c.GetParam(constant.VERSION_KEY, ""))
}

func ServiceKey(intf string, group string, version string) string {
if intf == "" {
return ""
}
buf := &bytes.Buffer{}
group := c.GetParam(constant.GROUP_KEY, "")
if group != "" {
buf.WriteString(group)
buf.WriteString("/")
}

buf.WriteString(intf)

version := c.GetParam(constant.VERSION_KEY, "")
if version != "" && version != "0.0.0" {
buf.WriteString(":")
buf.WriteString(version)
Expand Down
2 changes: 1 addition & 1 deletion config/application_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (*ApplicationConfig) Prefix() string {
return constant.DUBBO + ".application."
}

// Id ...
// nolint
func (c *ApplicationConfig) Id() string {
return ""
}
Expand Down
Loading

0 comments on commit a10ff4d

Please sign in to comment.