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/27 12:20:08 UTC

[GitHub] [dubbo-go] Mulavar opened a new pull request #1491: feat(config): add root config api builder

Mulavar opened a new pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491


   <!--  Thanks for sending a pull request!
   Read https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md before commit pull request.
   -->
   
   **What this PR does**:
   
   **Which issue(s) this PR fixes**:
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
   -->
   Fixes #
   
   **Special notes for your reviewer**:
   
   **Does this PR introduce a user-facing change?**:
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
   -->
   ```release-note
   
   ```


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


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

Posted by GitBox <gi...@apache.org>.
Mulavar commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r718123474



##########
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:
       解释一下上面的问题,
   &ApplicationConfigBuilder{
   key1:value1,
   key2:value2,
   }
   是一种初始化方式,这个builder是另一个问题,是前段时间讨论后针对目前with的config api一个替换做法,我个人理解builder不算是java专有的吧,这个模式go里面也有用,但是java比较普遍,我们也是讨论了觉得这种方式可读性比with更强所以借鉴这种写法。




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


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1491](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b73687a) into [config-api](https://codecov.io/gh/apache/dubbo-go/commit/c164f38e36d637d977012e76a615e7ffcf967187?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c164f38) will **decrease** coverage by `0.30%`.
   > The diff coverage is `14.06%`.
   
   > :exclamation: Current head b73687a differs from pull request most recent head 44fcd27. Consider uploading reports for the commit 44fcd27 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/1491/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff               @@
   ##           config-api    #1491      +/-   ##
   ==============================================
   - Coverage       42.71%   42.40%   -0.31%     
   ==============================================
     Files             261      261              
     Lines           14957    15044      +87     
   ==============================================
   - Hits             6389     6380       -9     
   - Misses           7819     7920     +101     
   + Partials          749      744       -5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/application\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2FwcGxpY2F0aW9uX2NvbmZpZy5nbw==) | `10.76% <0.00%> (-7.66%)` | :arrow_down: |
   | [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `22.22% <0.00%> (ø)` | |
   | [config/metadata\_report\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL21ldGFkYXRhX3JlcG9ydF9jb25maWcuZ28=) | `28.00% <0.00%> (ø)` | |
   | [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `6.14% <0.00%> (-4.47%)` | :arrow_down: |
   | [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `8.92% <ø> (ø)` | |
   | [config/protocol\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3RvY29sX2NvbmZpZy5nbw==) | `8.33% <5.26%> (-26.56%)` | :arrow_down: |
   | [config/dubbo\_bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2R1YmJvX2Jvb3RzdHJhcC5nbw==) | `62.06% <85.00%> (+5.20%)` | :arrow_up: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-7.95%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `54.71% <0.00%> (+1.88%)` | :arrow_up: |
   | [remoting/kubernetes/client.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9jbGllbnQuZ28=) | `74.15% <0.00%> (+2.24%)` | :arrow_up: |
   | ... and [1 more](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c164f38...44fcd27](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1491](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b73687a) into [config-api](https://codecov.io/gh/apache/dubbo-go/commit/c164f38e36d637d977012e76a615e7ffcf967187?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c164f38) will **decrease** coverage by `0.30%`.
   > The diff coverage is `14.06%`.
   
   > :exclamation: Current head b73687a differs from pull request most recent head ca0924a. Consider uploading reports for the commit ca0924a to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/1491/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff               @@
   ##           config-api    #1491      +/-   ##
   ==============================================
   - Coverage       42.71%   42.40%   -0.31%     
   ==============================================
     Files             261      261              
     Lines           14957    15044      +87     
   ==============================================
   - Hits             6389     6380       -9     
   - Misses           7819     7920     +101     
   + Partials          749      744       -5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/application\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2FwcGxpY2F0aW9uX2NvbmZpZy5nbw==) | `10.76% <0.00%> (-7.66%)` | :arrow_down: |
   | [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `22.22% <0.00%> (ø)` | |
   | [config/metadata\_report\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL21ldGFkYXRhX3JlcG9ydF9jb25maWcuZ28=) | `28.00% <0.00%> (ø)` | |
   | [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `6.14% <0.00%> (-4.47%)` | :arrow_down: |
   | [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `8.92% <ø> (ø)` | |
   | [config/protocol\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3RvY29sX2NvbmZpZy5nbw==) | `8.33% <5.26%> (-26.56%)` | :arrow_down: |
   | [config/dubbo\_bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2R1YmJvX2Jvb3RzdHJhcC5nbw==) | `62.06% <85.00%> (+5.20%)` | :arrow_up: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-7.95%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `54.71% <0.00%> (+1.88%)` | :arrow_up: |
   | [remoting/kubernetes/client.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9jbGllbnQuZ28=) | `74.15% <0.00%> (+2.24%)` | :arrow_up: |
   | ... and [1 more](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c164f38...ca0924a](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


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

Posted by GitBox <gi...@apache.org>.
Mulavar commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r717220016



##########
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:
       一般这种builder模式的运用,在链式赋值时都不会使用set。
   我理解是因为这种模式下没有 get 的场景,所以单独的 set 并不会给到更多的语义信息,可忽略。

##########
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:
       可参考 curator,okhttp3 等框架。




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


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

Posted by GitBox <gi...@apache.org>.
Mulavar commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r717220016



##########
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:
       一般这种builder模式的运用,在链式赋值时都不会使用set。
   我理解是因为这种模式下没有 get 的场景,所以单独的 set 并不会给到更多的语义信息,可忽略。




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


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

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-932661911


   I thinks this pr is able to merge, and we would fix TODOs soon.


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


[GitHub] [dubbo-go] LaurenceLiZhixin merged pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin merged pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491


   


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


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1491](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (44fcd27) into [config-api](https://codecov.io/gh/apache/dubbo-go/commit/c164f38e36d637d977012e76a615e7ffcf967187?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c164f38) will **decrease** coverage by `0.47%`.
   > The diff coverage is `11.89%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/1491/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff               @@
   ##           config-api    #1491      +/-   ##
   ==============================================
   - Coverage       42.71%   42.23%   -0.48%     
   ==============================================
     Files             261      261              
     Lines           14957    15091     +134     
   ==============================================
   - Hits             6389     6374      -15     
   - Misses           7819     7972     +153     
   + Partials          749      745       -4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/application\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2FwcGxpY2F0aW9uX2NvbmZpZy5nbw==) | `10.76% <0.00%> (-7.66%)` | :arrow_down: |
   | [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `22.22% <0.00%> (ø)` | |
   | [config/metadata\_report\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL21ldGFkYXRhX3JlcG9ydF9jb25maWcuZ28=) | `28.00% <0.00%> (ø)` | |
   | [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `6.14% <0.00%> (-4.47%)` | :arrow_down: |
   | [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `8.92% <ø> (ø)` | |
   | [config/registry\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3JlZ2lzdHJ5X2NvbmZpZy5nbw==) | `20.71% <1.92%> (-11.29%)` | :arrow_down: |
   | [config/protocol\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3RvY29sX2NvbmZpZy5nbw==) | `8.33% <5.26%> (-26.56%)` | :arrow_down: |
   | [config/dubbo\_bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2R1YmJvX2Jvb3RzdHJhcC5nbw==) | `63.93% <80.00%> (+7.07%)` | :arrow_up: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-7.95%)` | :arrow_down: |
   | [filter/metrics/filter.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL21ldHJpY3MvZmlsdGVyLmdv) | `100.00% <0.00%> (+15.00%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c164f38...44fcd27](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [dubbo-go] codecov-commenter commented on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1491](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e408e9c) into [config-api](https://codecov.io/gh/apache/dubbo-go/commit/c164f38e36d637d977012e76a615e7ffcf967187?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c164f38) will **decrease** coverage by `0.52%`.
   > The diff coverage is `14.75%`.
   
   > :exclamation: Current head e408e9c differs from pull request most recent head 48ce4c8. Consider uploading reports for the commit 48ce4c8 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/1491/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff               @@
   ##           config-api    #1491      +/-   ##
   ==============================================
   - Coverage       42.71%   42.18%   -0.53%     
   ==============================================
     Files             261      261              
     Lines           14957    15038      +81     
   ==============================================
   - Hits             6389     6344      -45     
   - Misses           7819     7945     +126     
     Partials          749      749              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/application\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2FwcGxpY2F0aW9uX2NvbmZpZy5nbw==) | `11.11% <0.00%> (-7.31%)` | :arrow_down: |
   | [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `22.22% <0.00%> (ø)` | |
   | [config/metadata\_report\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL21ldGFkYXRhX3JlcG9ydF9jb25maWcuZ28=) | `28.00% <0.00%> (ø)` | |
   | [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `6.25% <0.00%> (-4.36%)` | :arrow_down: |
   | [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `8.92% <ø> (ø)` | |
   | [config/protocol\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3RvY29sX2NvbmZpZy5nbw==) | `8.69% <5.88%> (-26.19%)` | :arrow_down: |
   | [config/dubbo\_bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2R1YmJvX2Jvb3RzdHJhcC5nbw==) | `62.06% <85.00%> (+5.20%)` | :arrow_up: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `50.00% <0.00%> (-12.77%)` | :arrow_down: |
   | [registry/kubernetes/registry.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVnaXN0cnkva3ViZXJuZXRlcy9yZWdpc3RyeS5nbw==) | `54.28% <0.00%> (-10.48%)` | :arrow_down: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-7.95%)` | :arrow_down: |
   | ... and [5 more](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c164f38...48ce4c8](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


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

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r716702756



##########
File path: config/application_config.go
##########
@@ -113,3 +113,49 @@ func WithMetadataType(metadataType string) ApplicationConfigOpt {
 		ac.MetadataType = metadataType
 	}
 }
+
+type ApplicationConfigBuilder struct {
+	*ApplicationConfig

Review comment:
       config *ApplicationConfig




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


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

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r716702440



##########
File path: config/dubbo_bootstrap.go
##########
@@ -71,16 +72,27 @@ func (rc *RootConfig) Init() error {
 	if err := rc.Application.Init(); err != nil {
 		return err
 	}
-	if err := initProtocolsConfig(rc); err != nil {
-		return err
+
+	// init protocol
+	protocols := rc.Protocols

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


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

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r717219432



##########
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 {
+	rootConfig *RootConfig
+}
+
+func (rb *RootConfigBuilder) Application(application *ApplicationConfig) *RootConfigBuilder {

Review comment:
       加上 Set 前缀




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


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

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r717219283



##########
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:
       赋值函数为啥不在前面加上 Set?

##########
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 {
+	rootConfig *RootConfig
+}
+
+func (rb *RootConfigBuilder) Application(application *ApplicationConfig) *RootConfigBuilder {

Review comment:
       加上 Set 前缀




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


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

Posted by GitBox <gi...@apache.org>.
Mulavar commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r717220418



##########
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:
       可参考 curator,okhttp3 等框架。




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


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1491](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b73687a) into [config-api](https://codecov.io/gh/apache/dubbo-go/commit/c164f38e36d637d977012e76a615e7ffcf967187?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c164f38) will **decrease** coverage by `0.30%`.
   > The diff coverage is `14.06%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/1491/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff               @@
   ##           config-api    #1491      +/-   ##
   ==============================================
   - Coverage       42.71%   42.40%   -0.31%     
   ==============================================
     Files             261      261              
     Lines           14957    15044      +87     
   ==============================================
   - Hits             6389     6380       -9     
   - Misses           7819     7920     +101     
   + Partials          749      744       -5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/application\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2FwcGxpY2F0aW9uX2NvbmZpZy5nbw==) | `10.76% <0.00%> (-7.66%)` | :arrow_down: |
   | [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `22.22% <0.00%> (ø)` | |
   | [config/metadata\_report\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL21ldGFkYXRhX3JlcG9ydF9jb25maWcuZ28=) | `28.00% <0.00%> (ø)` | |
   | [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `6.14% <0.00%> (-4.47%)` | :arrow_down: |
   | [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `8.92% <ø> (ø)` | |
   | [config/protocol\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3RvY29sX2NvbmZpZy5nbw==) | `8.33% <5.26%> (-26.56%)` | :arrow_down: |
   | [config/dubbo\_bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2R1YmJvX2Jvb3RzdHJhcC5nbw==) | `62.06% <85.00%> (+5.20%)` | :arrow_up: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-7.95%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `54.71% <0.00%> (+1.88%)` | :arrow_up: |
   | [remoting/kubernetes/client.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9jbGllbnQuZ28=) | `74.15% <0.00%> (+2.24%)` | :arrow_up: |
   | ... and [1 more](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c164f38...b73687a](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1491](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c5dfcd2) into [config-api](https://codecov.io/gh/apache/dubbo-go/commit/c164f38e36d637d977012e76a615e7ffcf967187?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c164f38) will **decrease** coverage by `0.54%`.
   > The diff coverage is `11.42%`.
   
   > :exclamation: Current head c5dfcd2 differs from pull request most recent head 59ee8ea. Consider uploading reports for the commit 59ee8ea to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/1491/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff               @@
   ##           config-api    #1491      +/-   ##
   ==============================================
   - Coverage       42.71%   42.17%   -0.55%     
   ==============================================
     Files             261      261              
     Lines           14957    15113     +156     
   ==============================================
   - Hits             6389     6374      -15     
   - Misses           7819     7994     +175     
   + Partials          749      745       -4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/application\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2FwcGxpY2F0aW9uX2NvbmZpZy5nbw==) | `10.76% <0.00%> (-7.66%)` | :arrow_down: |
   | [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `22.22% <0.00%> (ø)` | |
   | [config/metadata\_report\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL21ldGFkYXRhX3JlcG9ydF9jb25maWcuZ28=) | `28.00% <0.00%> (ø)` | |
   | [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `6.14% <0.00%> (-4.47%)` | :arrow_down: |
   | [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `8.92% <ø> (ø)` | |
   | [config/service\_discovery\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfZGlzY292ZXJ5X2NvbmZpZy5nbw==) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [config/registry\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3JlZ2lzdHJ5X2NvbmZpZy5nbw==) | `20.34% <1.81%> (-11.66%)` | :arrow_down: |
   | [config/protocol\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3RvY29sX2NvbmZpZy5nbw==) | `8.33% <5.26%> (-26.56%)` | :arrow_down: |
   | [config/dubbo\_bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2R1YmJvX2Jvb3RzdHJhcC5nbw==) | `64.06% <73.33%> (+7.19%)` | :arrow_up: |
   | ... and [2 more](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c164f38...59ee8ea](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
Mulavar commented on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-932264371


   > hi,boy。关于dubboBootstrap 和configLoader我有一点疑问,dubboBootstrap 顾名思义是作为程序的引导类,一般来说引导类只有一个,但是似乎configLoader也是做引导程序使用的,这两个是单独对程序进行加载和启动吗?另外假设我使用api配置和外部化配置混用应该如何使用配置? @Mulavar
   
   目前暂不考虑混用的场景,bootstrap 这块和 loader 的关系确实不太明晰,我们正在讨论,进一步是不是要合并,还是将程序入口拆分得更加合理 @XiaoWeiKIN 


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
XiaoWeiKIN commented on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-929810229


   hi,boy。关于dubboBootstrap 和configLoader我有一点疑问,dubboBootstrap 顾名思义是作为程序的引导类,一般来说引导类只有一个,但是似乎configLoader也是做引导程序使用的,这两个是单独对程序进行加载和启动吗?另外假设我使用api配置和外部化配置混用应该如何使用配置? @Mulavar 


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


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306






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


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #1491: feat(config): add root config api builder

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-927893306


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1491](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e408e9c) into [config-api](https://codecov.io/gh/apache/dubbo-go/commit/c164f38e36d637d977012e76a615e7ffcf967187?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c164f38) will **decrease** coverage by `0.52%`.
   > The diff coverage is `14.75%`.
   
   > :exclamation: Current head e408e9c differs from pull request most recent head b73687a. Consider uploading reports for the commit b73687a to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/1491/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@              Coverage Diff               @@
   ##           config-api    #1491      +/-   ##
   ==============================================
   - Coverage       42.71%   42.18%   -0.53%     
   ==============================================
     Files             261      261              
     Lines           14957    15038      +81     
   ==============================================
   - Hits             6389     6344      -45     
   - Misses           7819     7945     +126     
     Partials          749      749              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [config/application\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2FwcGxpY2F0aW9uX2NvbmZpZy5nbw==) | `11.11% <0.00%> (-7.31%)` | :arrow_down: |
   | [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `22.22% <0.00%> (ø)` | |
   | [config/metadata\_report\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL21ldGFkYXRhX3JlcG9ydF9jb25maWcuZ28=) | `28.00% <0.00%> (ø)` | |
   | [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `6.25% <0.00%> (-4.36%)` | :arrow_down: |
   | [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `8.92% <ø> (ø)` | |
   | [config/protocol\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Byb3RvY29sX2NvbmZpZy5nbw==) | `8.69% <5.88%> (-26.19%)` | :arrow_down: |
   | [config/dubbo\_bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2R1YmJvX2Jvb3RzdHJhcC5nbw==) | `62.06% <85.00%> (+5.20%)` | :arrow_up: |
   | [cluster/cluster\_impl/base\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvYmFzZV9jbHVzdGVyX2ludm9rZXIuZ28=) | `50.00% <0.00%> (-12.77%)` | :arrow_down: |
   | [registry/kubernetes/registry.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVnaXN0cnkva3ViZXJuZXRlcy9yZWdpc3RyeS5nbw==) | `54.28% <0.00%> (-10.48%)` | :arrow_down: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-7.95%)` | :arrow_down: |
   | ... and [5 more](https://codecov.io/gh/apache/dubbo-go/pull/1491/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c164f38...b73687a](https://codecov.io/gh/apache/dubbo-go/pull/1491?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


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

Posted by GitBox <gi...@apache.org>.
XiaoWeiKIN commented on pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#issuecomment-929810229


   hi,boy。关于dubboBootstrap 和configLoader我有一点疑问,dubboBootstrap 顾名思义是作为程序的引导类,一般来说引导类只有一个,但是似乎configLoader也是做引导程序使用的,这两个是单独对程序进行加载和启动吗?另外假设我使用api配置和外部化配置混用应该如何使用配置? @Mulavar 


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


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

Posted by GitBox <gi...@apache.org>.
Mulavar commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r718123474



##########
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:
       解释一下上面的问题,
   &ApplicationConfigBuilder{
   key1:value1,
   key2:value2,
   }
   是一种初始化方式,这个builder是另一个问题,是前段时间讨论后针对目前with的config api一个替换做法,我个人理解builder不算是java专有的吧,这个模式go里面也有用,但是java比较普遍,我们也是讨论了觉得这种方式可读性比with更强所以借鉴这种写法。




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


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

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #1491:
URL: https://github.com/apache/dubbo-go/pull/1491#discussion_r717219283



##########
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:
       赋值函数为啥不在前面加上 Set?




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