You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/01/19 05:29:56 UTC

[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1232: Feature: support customize the sc registry endpoint

tianxiaoliang commented on a change in pull request #1232:
URL: https://github.com/apache/servicecomb-service-center/pull/1232#discussion_r787360461



##########
File path: server/core/microservice.go
##########
@@ -86,6 +88,19 @@ func InitRegistration() {
 	}
 }
 
+func getEndpoints() []string {
+	hostPort := config.GetString("registry.instance.endpoint",
+		config.GetString("server.host", "127.0.0.1", config.WithStandby("httpaddr")))
+	if strings.LastIndex(hostPort, ":") < 0 {
+		hostPort += ":" + config.GetString("server.port", "30100", config.WithStandby("httpport"))
+	}
+	endpoint := fmt.Sprintf("rest://%s/", hostPort)
+	if config.GetSSL().SslEnabled {
+		endpoint += "?sslEnabled=true"
+	}
+	return []string{endpoint}

Review comment:
       为何返回slice?




-- 
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: commits-unsubscribe@servicecomb.apache.org

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