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 2021/09/29 03:20:48 UTC

[GitHub] [dubbo-go] zouyx commented on a change in pull request #1491: feat(config): add root config api builder

zouyx commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r718121834



##########
File path: config/config_loader.go
##########
@@ -188,19 +188,19 @@ func RPCService(service common.RPCService) {
 // So you don't need to worry about the race condition
 func GetMetricConfig() *MetricConfig {
 	// todo
-	//if GetBaseConfig().MetricConfig == nil {
+	//if GetBaseConfig().Metric == nil {

Review comment:
       todo 要不干掉?

##########
File path: config/protocol_config.go
##########
@@ -108,3 +90,38 @@ func WithProtocolPort(port string) ProtocolConfigOpt {
 		return config
 	}
 }
+
+func NewProtocolConfigBuilder() *ProtocolConfigBuilder {
+	return &ProtocolConfigBuilder{protocolConfig: &ProtocolConfig{}}
+}
+
+type ProtocolConfigBuilder struct {

Review comment:
       这里也是。。。感觉写成了 java

##########
File path: config/registry_config.go
##########
@@ -284,3 +272,98 @@ func WithRegistryParams(params map[string]string) RegistryConfigOpt {
 		return config
 	}
 }
+
+func NewRegistryConfigBuilder() *RegistryConfigBuilder {

Review comment:
       这里也是 java

##########
File path: config/service_discovery_config.go
##########
@@ -37,6 +37,38 @@ func (ServiceDiscoveryConfig) Prefix() string {
 	return constant.ServiceDiscPrefix
 }
 
-func initServiceDiscoveryConfig(rc *RootConfig) error {
+func (ServiceDiscoveryConfig) Init() error {
 	return nil
 }
+
+func NewServiceDiscoveryConfigBuilder() *ServiceDiscoveryConfigBuilder {

Review comment:
       这里也 java

##########
File path: config/root_config.go
##########
@@ -278,3 +278,88 @@ func WithRootCenterConfig(centerConfig *CenterConfig) RootConfigOpt {
 		rc.ConfigCenter = centerConfig
 	}
 }
+
+func NewRootConfigBuilder() *RootConfigBuilder {
+	return &RootConfigBuilder{rootConfig: &RootConfig{}}
+}
+
+type RootConfigBuilder struct {

Review comment:
       这里也是 java

##########
File path: config/application_config.go
##########
@@ -113,3 +113,53 @@ func WithMetadataType(metadataType string) ApplicationConfigOpt {
 		ac.MetadataType = metadataType
 	}
 }
+
+func NewApplicationConfigBuilder() *ApplicationConfigBuilder {
+	return &ApplicationConfigBuilder{application: &ApplicationConfig{}}
+}
+
+type ApplicationConfigBuilder struct {
+	application *ApplicationConfig
+}
+
+func (acb *ApplicationConfigBuilder) Organization(organization string) *ApplicationConfigBuilder {

Review comment:
       感觉写成了 java。。。。。。。。。。。go 不是用以下形式吗?
   ```go
   &ApplicationConfigBuilder{
   key1:value1,
   key2:value2,
   }
   ```




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