You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/12/03 11:13:08 UTC

[GitHub] [dubbo-go] bobtthp commented on a diff in pull request #2140: registry type support all

bobtthp commented on code in PR #2140:
URL: https://github.com/apache/dubbo-go/pull/2140#discussion_r1038764553


##########
config/registry_config.go:
##########
@@ -149,13 +149,57 @@ func (c *RegistryConfig) GetInstance(roleType common.RoleType) (registry.Registr
 func (c *RegistryConfig) toURL(roleType common.RoleType) (*common.URL, error) {
 	address := c.translateRegistryAddress()
 	var registryURLProtocol string
-	if c.RegistryType == "service" {
+	if c.RegistryType == constant.RegistryTypeService {
 		// service discovery protocol
 		registryURLProtocol = constant.ServiceRegistryProtocol
+	} else if c.RegistryType == constant.RegistryTypeInterface {
+		registryURLProtocol = constant.RegistryProtocol
 	} else {
+		// default use interface
 		registryURLProtocol = constant.RegistryProtocol
 	}
-	return common.NewURL(registryURLProtocol+"://"+address,
+	return c.createNewURL(registryURLProtocol, address, roleType)
+}
+
+func (c *RegistryConfig) toURLs(roleType common.RoleType) ([]*common.URL, error) {
+	address := c.translateRegistryAddress()
+	var urls []*common.URL
+	var err error
+	var registryURL *common.URL
+
+	if !isValid(c.Address) {
+		logger.Infof("Empty or N/A registry address found, the process will work with no registry enabled " +
+			"which means that the address of this instance will not be registered and not able to be found by other consumer instances.")
+		return urls, nil
+	}
+
+	if c.RegistryType == constant.RegistryTypeService {

Review Comment:
   是哦,我来修改下



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org