[dubbo-go-samples] 01/01: java service discovery sample

2021-04-22 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch service-discovery-sample
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git

commit 846e23e2043ec372ef04e7eb43bbbf539fc3dab6
Author: Patrick 
AuthorDate: Thu Apr 22 18:06:20 2021 +0800

java service discovery sample
---
 .../zookeeper/go-client/conf/client.yml|   1 +
 .../zookeeper/go-server/conf/server.yml|   1 +
 .../servicediscovery/zookeeper/java-client/pom.xml | 115 +++
 .../main/java/org/apache/dubbo/Application.java|  37 +++
 .../src/main/java/org/apache/dubbo/User.java   |  68 
 .../main/java/org/apache/dubbo/UserProvider.java   |  13 +++
 .../src/main/resources/dubbo.properties|   1 +
 .../src/main/resources/log4j.properties|   7 ++
 .../src/main/resources/spring/dubbo-consumer.xml   |  33 ++
 .../servicediscovery/zookeeper/java-server/pom.xml | 122 +
 .../main/java/org/apache/dubbo/Application.java|  31 ++
 .../src/main/java/org/apache/dubbo/User.java   |  68 
 .../main/java/org/apache/dubbo/UserProvider.java   |  13 +++
 .../java/org/apache/dubbo/UserProviderImpl.java|  21 
 .../src/main/resources/dubbo.properties|   1 +
 .../src/main/resources/log4j.properties|   7 ++
 .../src/main/resources/spring/dubbo-provider.xml   |  38 +++
 17 files changed, 577 insertions(+)

diff --git a/registry/servicediscovery/zookeeper/go-client/conf/client.yml 
b/registry/servicediscovery/zookeeper/go-client/conf/client.yml
index 7cd78f1..50241af 100644
--- a/registry/servicediscovery/zookeeper/go-client/conf/client.yml
+++ b/registry/servicediscovery/zookeeper/go-client/conf/client.yml
@@ -41,6 +41,7 @@ service_discovery:
 references:
   "UserProvider":
 registry: "demoServiceDiscovery"
+provided-by: "UserInfoServer"
 protocol: "dubbo"
 interface: "org.apache.dubbo.UserProvider"
 cluster: "failover"
diff --git a/registry/servicediscovery/zookeeper/go-server/conf/server.yml 
b/registry/servicediscovery/zookeeper/go-server/conf/server.yml
index 3fddf62..f67a386 100644
--- a/registry/servicediscovery/zookeeper/go-server/conf/server.yml
+++ b/registry/servicediscovery/zookeeper/go-server/conf/server.yml
@@ -7,6 +7,7 @@ application:
   module: "dubbo-go user-info server"
   version: "0.0.1"
   environment: "dev"
+  metadataType: "remote"
 
 # registry config
 registries:
diff --git a/registry/servicediscovery/zookeeper/java-client/pom.xml 
b/registry/servicediscovery/zookeeper/java-client/pom.xml
new file mode 100644
index 000..a68afcf
--- /dev/null
+++ b/registry/servicediscovery/zookeeper/java-client/pom.xml
@@ -0,0 +1,115 @@
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+4.0.0
+servicediscovery-consumer
+org.apache.dubbo
+0.0.1
+jar
+${project.artifactId}
+The demo consumer module of dubbo project
+
+true
+true
+
2.1.4.RELEASE
+1.8
+1.8
+true
+3.7.0
+4.3.16.RELEASE
+3.0.0.preview
+4.12
+
+
+
+org.apache.dubbo
+dubbo-registry-multicast
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-registry-nacos
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-registry-zookeeper
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-configcenter-zookeeper
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-configcenter-nacos
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-metadata-report-zookeeper
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-rpc-dubbo
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-config-spring
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-remoting-netty4
+${dubbo.version}
+
+
+org.apache.dubbo
+dubbo-serialization-hessian2
+${dubbo.version}
+
+
+org.springframework
+spring-framework-bom
+${spring.version}
+pom
+import
+
+
+
+
+
+
+org.springframework.boot
+spring-boot-maven-plugin
+${spring-boot-maven-plugin.

[dubbo-go-samples] branch service-discovery-sample created (now 846e23e)

2021-04-22 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch service-discovery-sample
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git.


  at 846e23e  java service discovery sample

This branch includes the following new commits:

 new 846e23e  java service discovery sample

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[dubbo-go] branch 1.5 updated: Revert "goland always format go.mod automatically"

2021-02-20 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.5
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/1.5 by this push:
 new 9c8fc77  Revert "goland always format go.mod automatically"
9c8fc77 is described below

commit 9c8fc77f0381654b7690127c7e61fce09ed2dd73
Author: Patrick 
AuthorDate: Sat Feb 20 22:31:53 2021 +0800

Revert "goland always format go.mod automatically"

This reverts commit 99ed78fbd31d283c1e82d76355eed4119b60e538.
---
 tools/cli/go.mod | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/cli/go.mod b/tools/cli/go.mod
index c71b7cd..070fce1 100644
--- a/tools/cli/go.mod
+++ b/tools/cli/go.mod
@@ -4,7 +4,7 @@ go 1.13
 
 require (
github.com/apache/dubbo-go-hessian2 v1.8.0
-   github.com/dubbogo/gost v1.10.0
github.com/pkg/errors v0.9.1
go.uber.org/atomic v1.7.0
-)
+   github.com/dubbogo/gost v1.10.0
+)
\ No newline at end of file



[dubbo-go] branch 1.5 updated: goland always format go.mod automatically

2021-02-20 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.5
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/1.5 by this push:
 new 99ed78f  goland always format go.mod automatically
 new cf2ffd4  Merge remote-tracking branch 'upstream/1.5' into 1.5
99ed78f is described below

commit 99ed78fbd31d283c1e82d76355eed4119b60e538
Author: Patrick 
AuthorDate: Sat Feb 20 22:16:35 2021 +0800

goland always format go.mod automatically
---
 tools/cli/go.mod | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/cli/go.mod b/tools/cli/go.mod
index 070fce1..c71b7cd 100644
--- a/tools/cli/go.mod
+++ b/tools/cli/go.mod
@@ -4,7 +4,7 @@ go 1.13
 
 require (
github.com/apache/dubbo-go-hessian2 v1.8.0
+   github.com/dubbogo/gost v1.10.0
github.com/pkg/errors v0.9.1
go.uber.org/atomic v1.7.0
-   github.com/dubbogo/gost v1.10.0
-)
\ No newline at end of file
+)



[dubbo-go] branch develop updated: add dmall logo

2021-01-22 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
 new 0cb6edb  add dmall logo
 new f354f90  Merge pull request #1009 from champly/develop
0cb6edb is described below

commit 0cb6edb4dd989696cc56b10259b1e0a146f1c54d
Author: champly 
AuthorDate: Fri Jan 22 21:40:45 2021 +0800

add dmall logo
---
 README.md| 5 +
 README_CN.md | 5 +
 2 files changed, 10 insertions(+)

diff --git a/README.md b/README.md
index 8af021b..cfd1a5a 100644
--- a/README.md
+++ b/README.md
@@ -259,6 +259,11 @@ If you are using 
[apache/dubbo-go](github.com/apache/dubbo-go) and think that it
   https://ugc.hitv.com/platform_oss/F6077F1AA82542CDBDD88FD518E6E727.png;>
 
   
+  
+http://www.dmall.com; target="_blank">
+  https://mosn.io/images/community/duodian.png;>
+
+  
 
 
   
diff --git a/README_CN.md b/README_CN.md
index 079cfa5..64504aa 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -257,6 +257,11 @@ make test
   https://ugc.hitv.com/platform_oss/F6077F1AA82542CDBDD88FD518E6E727.png;>
 
   
+   
+http://www.dmall.com; target="_blank">
+  https://mosn.io/images/community/duodian.png;>
+
+  
 
 
   



[dubbo-go] branch develop updated (016bcce -> 9c40c29)

2021-01-22 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 016bcce  update hessian2 version to v1.8.2
 new 5cb723a  update hessian2 version to v1.8.2
 new aaacf31  Bump github.com/stretchr/testify from 1.6.1 to 1.7.0
 new 982e74c  Merge pull request #1001 from 
apache/dependabot/go_modules/develop/github.com/stretchr/testify-1.7.0
 new 7dd17b3  Bump github.com/alibaba/sentinel-golang from 1.0.1 to 1.0.2
 new 4a721a2  Merge pull request #999 from 
apache/dependabot/go_modules/develop/github.com/alibaba/sentinel-golang-1.0.2
 new 36c0681  Imp: add trim for filter
 new 3111854  merge develop
 new 9c40c29  Merge pull request #1003 from fangyincheng/trim-filter

The 3382 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 go.mod   | 4 ++--
 go.sum   | 6 --
 protocol/protocolwrapper/protocol_filter_wrapper.go  | 2 +-
 protocol/protocolwrapper/protocol_filter_wrapper_test.go | 4 ++--
 4 files changed, 9 insertions(+), 7 deletions(-)



[dubbo-go] branch develop updated: move need watch ns to readConfig func

2021-01-05 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
 new 9d9a13a  move need watch ns to readConfig func
 new ca6b03e  Merge pull request #977 from sxllwx/fix/issue813
9d9a13a is described below

commit 9d9a13a2bebad54aa4bcb87f01dcdf7134db8d05
Author: scott 
AuthorDate: Thu Dec 31 17:59:42 2020 +0800

move need watch ns to readConfig func
---
 remoting/kubernetes/registry_controller.go | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/remoting/kubernetes/registry_controller.go 
b/remoting/kubernetes/registry_controller.go
index f66163d..e659e7e 100644
--- a/remoting/kubernetes/registry_controller.go
+++ b/remoting/kubernetes/registry_controller.go
@@ -203,6 +203,17 @@ func (c *dubboRegistryController) readConfig() error {
if len(c.namespace) == 0 {
return perrors.New("read value from env by key (NAMESPACE)")
}
+
+   // read need watched namespaces list
+   needWatchedNameSpaceList, ok := os.LookupEnv(needWatchedNameSpaceKey)
+   if ok {
+   for _, ns := range strings.Split(needWatchedNameSpaceList, 
",")[1:] {
+   logger.Debugf("adding need watched ns: %s", ns)
+   c.needWatchedNamespace[ns] = struct{}{}
+   }
+   }
+   // current work namespace should be watched
+   c.needWatchedNamespace[c.namespace] = struct{}{}
return nil
 }
 
@@ -242,17 +253,6 @@ func (c *dubboRegistryController) initPodInformer() error {
return nil
}
 
-   // read need watched namespaces list
-   needWatchedNameSpaceList := os.Getenv(needWatchedNameSpaceKey)
-   if len(needWatchedNameSpaceList) == 0 {
-   return perrors.New("read value from env by key 
(DUBBO_NAMESPACE)")
-   }
-   for _, ns := range strings.Split(needWatchedNameSpaceList, ",") {
-   c.needWatchedNamespace[ns] = struct{}{}
-   }
-   // current work namespace should be watched
-   c.needWatchedNamespace[c.namespace] = struct{}{}
-
c.queue = workqueue.New()
 
// init all watch needed pod-informer



[dubbo-go] branch develop updated (244b495 -> ed97c95)

2020-12-24 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 244b495  Merge pull request #954 from beiwei30/del-key-from-url
 new da3d9fc  introduce a export flag to decide if a service should be 
export or not, it is particularly useful with a config-post-processor
 new ea5e28b  Merge branch 'develop' into export-flag
 new 59d4e4e  set export to true as default value when unmarshal
 new ed97c95  Merge pull request #955 from beiwei30/export-flag

The 3312 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 common/constant/key.go   |  1 +
 config/service_config.go | 11 +++
 2 files changed, 12 insertions(+)



[dubbo-go-samples] branch master updated (498e589 -> 7a992b8)

2020-12-11 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git.


from 498e589  Merge pull request #19 from mark4z/master
 new 68f9cb6  add sentinel-filter sample
 new d419676  add integration test
 new a735fdc  add script on integrate
 new 5f5e8e7  fix bug
 new 7a992b8  Merge pull request #16 from pantianying/sentinel-filter

The 147 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../sentinel}/go-client/cmd/client.go  | 37 ++
 .../go-client/conf/client.yml  |  3 ++
 .../sentinel/go-client}/conf/log.yml   |  0
 .../sentinel}/go-client/pkg/user.go|  0
 .../go-server/cmd/server.go| 20 ++--
 .../go-server/conf/client.yml  |  2 ++
 .../sentinel}/go-server/conf/log.yml   |  0
 .../go-server/conf/server.yml  |  2 +-
 .../sentinel}/go-server/docker/docker-compose.yml  |  0
 .../sentinel}/go-server/pkg/user.go|  0
 .../go-server/tests/integration/main_test.go   |  0
 .../tests/integration/userprovider_test.go |  6 ++--
 start_integrate_test.sh|  1 +
 13 files changed, 52 insertions(+), 19 deletions(-)
 copy {metric => filter/sentinel}/go-client/cmd/client.go (73%)
 copy filter/{tpslimit => sentinel}/go-client/conf/client.yml (96%)
 copy {multi-zone/go-server-sh => filter/sentinel/go-client}/conf/log.yml (100%)
 copy {router/condition => filter/sentinel}/go-client/pkg/user.go (100%)
 copy filter/{custom_filter => sentinel}/go-server/cmd/server.go (85%)
 copy filter/{tpslimit => sentinel}/go-server/conf/client.yml (97%)
 copy {multi-registry => filter/sentinel}/go-server/conf/log.yml (100%)
 copy filter/{custom_filter => sentinel}/go-server/conf/server.yml (97%)
 copy {router/condition => filter/sentinel}/go-server/docker/docker-compose.yml 
(100%)
 copy {router/condition => filter/sentinel}/go-server/pkg/user.go (100%)
 copy {metric => filter/sentinel}/go-server/tests/integration/main_test.go 
(100%)
 copy {configcenter/nacos => 
filter/sentinel}/go-server/tests/integration/userprovider_test.go (88%)



[dubbo-go] branch master updated (8dbf73b -> 4b0bdfb)

2020-12-01 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 8dbf73b  Merge pull request #896 from 
apache/dependabot/go_modules/gopkg.in/yaml.v2-2.4.0
 add 9d3fefd  build(deps): bump github.com/mitchellh/mapstructure from 
1.3.3 to 1.4.0
 add 4b0bdfb  Merge pull request #897 from 
apache/dependabot/go_modules/github.com/mitchellh/mapstructure-1.4.0

No new revisions were added by this update.

Summary of changes:
 go.mod | 2 +-
 go.sum | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)



[dubbo-go] 01/01: Merge pull request #843 from apache/dependabot/go_modules/github.com/nacos-group/nacos-sdk-go-1.0.1

2020-11-04 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit f74f3896c3afff1dd68801ada846bdaeb04e2296
Merge: ffe95a2 6e43e84
Author: Patrick Jiang(白泽) 
AuthorDate: Thu Nov 5 13:52:48 2020 +0800

Merge pull request #843 from 
apache/dependabot/go_modules/github.com/nacos-group/nacos-sdk-go-1.0.1

Bump github.com/nacos-group/nacos-sdk-go from 1.0.0 to 1.0.1

 go.mod | 2 +-
 go.sum | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)




[dubbo-go] branch master updated (ffe95a2 -> f74f389)

2020-11-04 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from ffe95a2  Merge pull request #844 from 
apache/dependabot/go_modules/github.com/golang/mock-1.4.4
 add 6e43e84  Bump github.com/nacos-group/nacos-sdk-go from 1.0.0 to 1.0.1
 new f74f389  Merge pull request #843 from 
apache/dependabot/go_modules/github.com/nacos-group/nacos-sdk-go-1.0.1

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 go.mod | 2 +-
 go.sum | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)



[dubbo-go] branch master updated (47e594d -> bd51754)

2020-11-04 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 47e594d  Merge pull request #834 from 
apache/dependabot/go_modules/github.com/dubbogo/gost-1.9.2
 add 9a28d7e  Bump github.com/zouyx/agollo/v3 from 3.4.4 to 3.4.5
 new bd51754  Merge pull request #845 from 
apache/dependabot/go_modules/github.com/zouyx/agollo/v3-3.4.5

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 go.mod | 2 +-
 go.sum | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)



[dubbo-go] 01/01: Merge pull request #845 from apache/dependabot/go_modules/github.com/zouyx/agollo/v3-3.4.5

2020-11-04 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit bd5175491e4672d11d20410a4f87678978215abd
Merge: 47e594d 9a28d7e
Author: Patrick Jiang(白泽) 
AuthorDate: Thu Nov 5 13:51:23 2020 +0800

Merge pull request #845 from 
apache/dependabot/go_modules/github.com/zouyx/agollo/v3-3.4.5

Bump github.com/zouyx/agollo/v3 from 3.4.4 to 3.4.5

 go.mod | 2 +-
 go.sum | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)



[dubbo-go] branch master updated (bd51754 -> ffe95a2)

2020-11-04 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from bd51754  Merge pull request #845 from 
apache/dependabot/go_modules/github.com/zouyx/agollo/v3-3.4.5
 add 31a08f0  Bump github.com/golang/mock from 1.3.1 to 1.4.4
 add ffe95a2  Merge pull request #844 from 
apache/dependabot/go_modules/github.com/golang/mock-1.4.4

No new revisions were added by this update.

Summary of changes:
 go.mod | 2 +-
 go.sum | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)



[dubbo-go] branch develop updated: upgrade sentinel go to v0.6.2 to degrade system module in windows OS.

2020-10-29 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
 new a548cc4  upgrade sentinel go to v0.6.2 to degrade system module in 
windows OS.
 new 9eb7c01  Merge pull request #821 from 
louyuting/20201029-fix-sentinel-windows-issue
a548cc4 is described below

commit a548cc45067865a6a6317b64a2ae505b8a7a8d33
Author: louyuting <1849491...@qq.com>
AuthorDate: Thu Oct 29 20:16:17 2020 +0800

upgrade sentinel go to v0.6.2 to degrade system module in windows OS.
---
 go.mod | 2 +-
 go.sum | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/go.mod b/go.mod
index 6e06e03..8b5b7dd 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ require (
github.com/RoaringBitmap/roaring v0.4.23
github.com/Workiva/go-datastructures v1.0.50
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
-   github.com/alibaba/sentinel-golang v0.6.1
+   github.com/alibaba/sentinel-golang v0.6.2
github.com/apache/dubbo-getty v1.3.10
github.com/apache/dubbo-go-hessian2 v1.7.0
github.com/coreos/etcd v3.3.25+incompatible
diff --git a/go.sum b/go.sum
index f35b6c5..684df9b 100644
--- a/go.sum
+++ b/go.sum
@@ -95,6 +95,8 @@ github.com/alecthomas/template 
v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod 
h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/alibaba/sentinel-golang v0.6.1 
h1:Pxyw2X7ryklvToF40KG9l4uuO90jRZA2MWb8Z3d1wPo=
 github.com/alibaba/sentinel-golang v0.6.1/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
+github.com/alibaba/sentinel-golang v0.6.2 
h1:1OjjpljJbNKWp9p5RJKxOqS1gHGZPUWPlCcokv5xYJs=
+github.com/alibaba/sentinel-golang v0.6.2/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
 github.com/aliyun/alibaba-cloud-sdk-go 
v0.0.0-20190808125512-07798873deee/go.mod 
h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 
h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod 
h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk=



[dubbo-go] branch develop updated: upgrade sentinel go to v0.6.2 to degrade system module in windows OS.

2020-10-29 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
 new a548cc4  upgrade sentinel go to v0.6.2 to degrade system module in 
windows OS.
 new 9eb7c01  Merge pull request #821 from 
louyuting/20201029-fix-sentinel-windows-issue
a548cc4 is described below

commit a548cc45067865a6a6317b64a2ae505b8a7a8d33
Author: louyuting <1849491...@qq.com>
AuthorDate: Thu Oct 29 20:16:17 2020 +0800

upgrade sentinel go to v0.6.2 to degrade system module in windows OS.
---
 go.mod | 2 +-
 go.sum | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/go.mod b/go.mod
index 6e06e03..8b5b7dd 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ require (
github.com/RoaringBitmap/roaring v0.4.23
github.com/Workiva/go-datastructures v1.0.50
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
-   github.com/alibaba/sentinel-golang v0.6.1
+   github.com/alibaba/sentinel-golang v0.6.2
github.com/apache/dubbo-getty v1.3.10
github.com/apache/dubbo-go-hessian2 v1.7.0
github.com/coreos/etcd v3.3.25+incompatible
diff --git a/go.sum b/go.sum
index f35b6c5..684df9b 100644
--- a/go.sum
+++ b/go.sum
@@ -95,6 +95,8 @@ github.com/alecthomas/template 
v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod 
h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/alibaba/sentinel-golang v0.6.1 
h1:Pxyw2X7ryklvToF40KG9l4uuO90jRZA2MWb8Z3d1wPo=
 github.com/alibaba/sentinel-golang v0.6.1/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
+github.com/alibaba/sentinel-golang v0.6.2 
h1:1OjjpljJbNKWp9p5RJKxOqS1gHGZPUWPlCcokv5xYJs=
+github.com/alibaba/sentinel-golang v0.6.2/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
 github.com/aliyun/alibaba-cloud-sdk-go 
v0.0.0-20190808125512-07798873deee/go.mod 
h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 
h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod 
h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk=



[dubbo-go] branch develop updated: upgrade sentinel go to v0.6.2 to degrade system module in windows OS.

2020-10-29 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
 new a548cc4  upgrade sentinel go to v0.6.2 to degrade system module in 
windows OS.
 new 9eb7c01  Merge pull request #821 from 
louyuting/20201029-fix-sentinel-windows-issue
a548cc4 is described below

commit a548cc45067865a6a6317b64a2ae505b8a7a8d33
Author: louyuting <1849491...@qq.com>
AuthorDate: Thu Oct 29 20:16:17 2020 +0800

upgrade sentinel go to v0.6.2 to degrade system module in windows OS.
---
 go.mod | 2 +-
 go.sum | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/go.mod b/go.mod
index 6e06e03..8b5b7dd 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ require (
github.com/RoaringBitmap/roaring v0.4.23
github.com/Workiva/go-datastructures v1.0.50
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
-   github.com/alibaba/sentinel-golang v0.6.1
+   github.com/alibaba/sentinel-golang v0.6.2
github.com/apache/dubbo-getty v1.3.10
github.com/apache/dubbo-go-hessian2 v1.7.0
github.com/coreos/etcd v3.3.25+incompatible
diff --git a/go.sum b/go.sum
index f35b6c5..684df9b 100644
--- a/go.sum
+++ b/go.sum
@@ -95,6 +95,8 @@ github.com/alecthomas/template 
v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod 
h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/alibaba/sentinel-golang v0.6.1 
h1:Pxyw2X7ryklvToF40KG9l4uuO90jRZA2MWb8Z3d1wPo=
 github.com/alibaba/sentinel-golang v0.6.1/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
+github.com/alibaba/sentinel-golang v0.6.2 
h1:1OjjpljJbNKWp9p5RJKxOqS1gHGZPUWPlCcokv5xYJs=
+github.com/alibaba/sentinel-golang v0.6.2/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
 github.com/aliyun/alibaba-cloud-sdk-go 
v0.0.0-20190808125512-07798873deee/go.mod 
h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 
h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod 
h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk=



[dubbo-go] branch develop updated: upgrade sentinel go to v0.6.2 to degrade system module in windows OS.

2020-10-29 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
 new a548cc4  upgrade sentinel go to v0.6.2 to degrade system module in 
windows OS.
 new 9eb7c01  Merge pull request #821 from 
louyuting/20201029-fix-sentinel-windows-issue
a548cc4 is described below

commit a548cc45067865a6a6317b64a2ae505b8a7a8d33
Author: louyuting <1849491...@qq.com>
AuthorDate: Thu Oct 29 20:16:17 2020 +0800

upgrade sentinel go to v0.6.2 to degrade system module in windows OS.
---
 go.mod | 2 +-
 go.sum | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/go.mod b/go.mod
index 6e06e03..8b5b7dd 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ require (
github.com/RoaringBitmap/roaring v0.4.23
github.com/Workiva/go-datastructures v1.0.50
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
-   github.com/alibaba/sentinel-golang v0.6.1
+   github.com/alibaba/sentinel-golang v0.6.2
github.com/apache/dubbo-getty v1.3.10
github.com/apache/dubbo-go-hessian2 v1.7.0
github.com/coreos/etcd v3.3.25+incompatible
diff --git a/go.sum b/go.sum
index f35b6c5..684df9b 100644
--- a/go.sum
+++ b/go.sum
@@ -95,6 +95,8 @@ github.com/alecthomas/template 
v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod 
h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/alibaba/sentinel-golang v0.6.1 
h1:Pxyw2X7ryklvToF40KG9l4uuO90jRZA2MWb8Z3d1wPo=
 github.com/alibaba/sentinel-golang v0.6.1/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
+github.com/alibaba/sentinel-golang v0.6.2 
h1:1OjjpljJbNKWp9p5RJKxOqS1gHGZPUWPlCcokv5xYJs=
+github.com/alibaba/sentinel-golang v0.6.2/go.mod 
h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc=
 github.com/aliyun/alibaba-cloud-sdk-go 
v0.0.0-20190808125512-07798873deee/go.mod 
h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 
h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA=
 github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod 
h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk=



[dubbo-go] branch develop updated (49c005a -> 837f41f)

2020-09-07 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 49c005a  Ftr: [refer dubbo 2.7.6] attachment type from 
map[string]stiring to map[string]interface{}  (#713)
 new aa4d36a  Fix: integration testing problems
 new 94fe6c6  Fix: integration testing problems
 new 93cb0ac  Fix: integration testing problems
 new bff2cd6  Fix: integration testing problems
 new 4cd2487  Fix: integration testing problems
 new 27a8dc7  Fix: integration testing problems
 new c3adeae  Fix: integration testing problems
 new a15d6af  Fix: integration testing problems
 new 04b35ea  Fix: integration testing problems
 new 9f50dc2  delete useless file
 new 837f41f  Merge pull request #740 from zouyx/feature/fixTestProblmes

The 2815 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 integrate_test.sh | 4 
 test/integrate/dubbo/go-client/Dockerfile | 4 +++-
 test/integrate/dubbo/go-client/go.mod | 4 
 test/integrate/dubbo/go-server/Dockerfile | 5 -
 test/integrate/dubbo/go-server/go.mod | 4 
 5 files changed, 11 insertions(+), 10 deletions(-)



[dubbo-go] branch 1.5 updated: Change file name to the same as interface name

2020-08-23 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.5
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/1.5 by this push:
 new 7d1f424  Change file name to the same as interface name
 new 489e795  Merge pull request #726 from zouyx/addChange
7d1f424 is described below

commit 7d1f424a18d077f9c3292d4de8213848ca16f26e
Author: Joe Zou 
AuthorDate: Sat Aug 22 22:16:22 2020 +0800

Change file name to the same as interface name
---
 registry/{service_discovery_factory.go => service_discovery_holder.go} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/registry/service_discovery_factory.go 
b/registry/service_discovery_holder.go
similarity index 100%
rename from registry/service_discovery_factory.go
rename to registry/service_discovery_holder.go



[dubbo-go] branch 1.5.1 updated: revert commit "fix subscribe url wrong"

2020-08-21 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.5.1
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/1.5.1 by this push:
 new b7ae2ce  revert commit "fix subscribe url wrong"
b7ae2ce is described below

commit b7ae2ce4263ee85e4f2492dc6b465d2ac7474e55
Author: Patrick 
AuthorDate: Fri Aug 21 15:19:03 2020 +0800

revert commit "fix subscribe url wrong"
---
 registry/servicediscovery/service_discovery_registry.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/registry/servicediscovery/service_discovery_registry.go 
b/registry/servicediscovery/service_discovery_registry.go
index 7576804..cdb586c 100644
--- a/registry/servicediscovery/service_discovery_registry.go
+++ b/registry/servicediscovery/service_discovery_registry.go
@@ -632,7 +632,7 @@ func (icn *InstanceChangeNotify) Notify(event 
observer.Event) {
 
if se, ok := event.(*registry.ServiceInstancesChangedEvent); ok {
sdr := icn.serviceDiscoveryRegistry
-   sdr.subscribe(sdr.url.SubURL, icn.notify, se.ServiceName, 
se.Instances)
+   sdr.subscribe(sdr.url, icn.notify, se.ServiceName, se.Instances)
}
 }
 



[dubbo-go] branch 1.5.1 updated: fix subscribe url wrong

2020-08-21 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.5.1
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/1.5.1 by this push:
 new 6835365  fix subscribe url wrong
6835365 is described below

commit 6835365de698f8d1a4b82d19b45053ad1bb5cee2
Author: Patrick 
AuthorDate: Fri Aug 21 15:09:15 2020 +0800

fix subscribe url wrong
---
 registry/servicediscovery/service_discovery_registry.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/registry/servicediscovery/service_discovery_registry.go 
b/registry/servicediscovery/service_discovery_registry.go
index cdb586c..7576804 100644
--- a/registry/servicediscovery/service_discovery_registry.go
+++ b/registry/servicediscovery/service_discovery_registry.go
@@ -632,7 +632,7 @@ func (icn *InstanceChangeNotify) Notify(event 
observer.Event) {
 
if se, ok := event.(*registry.ServiceInstancesChangedEvent); ok {
sdr := icn.serviceDiscoveryRegistry
-   sdr.subscribe(sdr.url, icn.notify, se.ServiceName, se.Instances)
+   sdr.subscribe(sdr.url.SubURL, icn.notify, se.ServiceName, 
se.Instances)
}
 }
 



[dubbo-go] branch 1.4 updated (0686ca9 -> ea86567)

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 0686ca9  Merge pull request #670 from zouyx/hotfix/fix1.4
 new 8e85afd  optimized code
 new 13369bf  use adapter model to modify restServer
 new 9a9b3a7  remove adapter
 new bcb0100  optimize header transmit in RestClient and RestServer
 new f2949db  add some comments
 new 79bd56c  modify some comments and when parsing parameters occurred 
error, return error immediately
 new 6540c89  modify comments
 new 4736cdc  remove new function
 new f580ed0  modify some comments
 new d469144  modify some comments and modify some logger's message
 new ca2538a  optimized code
 new a7174c3  let go_restful_server support same url and different 
methodType
 new ea86567  format code

The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 protocol/rest/client/client_impl/resty_client.go   |  16 +-
 protocol/rest/client/rest_client.go|  12 +-
 protocol/rest/rest_invoker.go  |  26 +-
 protocol/rest/rest_protocol.go |   4 +-
 protocol/rest/server/rest_server.go| 297 +++-
 .../rest/server/server_impl/go_restful_server.go   | 305 ++---
 .../server_impl/go_restful_server_test.go} |  43 +--
 7 files changed, 436 insertions(+), 267 deletions(-)
 copy protocol/rest/{config/reader/rest_config_reader_test.go => 
server/server_impl/go_restful_server_test.go} (57%)



[dubbo-go] 09/13: modify some comments

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit f580ed0b8a080ceed6cff930b2bedbe826df8d0c
Author: Patrick 
AuthorDate: Wed Apr 1 23:45:21 2020 +0800

modify some comments
---
 .../rest/server/server_impl/go_restful_server.go   | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/protocol/rest/server/server_impl/go_restful_server.go 
b/protocol/rest/server/server_impl/go_restful_server.go
index 667d58c..7f5e353 100644
--- a/protocol/rest/server/server_impl/go_restful_server.go
+++ b/protocol/rest/server/server_impl/go_restful_server.go
@@ -115,59 +115,59 @@ func (grs *GoRestfulServer) Destroy() {
logger.Infof("[Go Restful] Server exiting")
 }
 
-// Let user add the http server of go-restful
+// AddGoRestfulServerFilter let user add the http server of go-restful
 // addFilter should before config.Load()
 func AddGoRestfulServerFilter(filterFuc restful.FilterFunction) {
filterSlice = append(filterSlice, filterFuc)
 }
 
-// Adapter about RestServerRequest
+// GoRestfulRequestAdapter a adapter struct about RestServerRequest
 type GoRestfulRequestAdapter struct {
server.RestServerRequest
request *restful.Request
 }
 
-// A constructor of GoRestfulRequestAdapter
+// NewGoRestfulRequestAdapter a constructor of GoRestfulRequestAdapter
 func NewGoRestfulRequestAdapter(request *restful.Request) 
*GoRestfulRequestAdapter {
return {request: request}
 }
 
-// A adapter function of server.RestServerRequest's RawRequest
+// RawRequest a adapter function of server.RestServerRequest's RawRequest
 func (grra *GoRestfulRequestAdapter) RawRequest() *http.Request {
return grra.request.Request
 }
 
-// A adapter function of server.RestServerRequest's PathParameter
+// PathParameter a adapter function of server.RestServerRequest's PathParameter
 func (grra *GoRestfulRequestAdapter) PathParameter(name string) string {
return grra.request.PathParameter(name)
 }
 
-// A adapter function of server.RestServerRequest's QueryParameter
+// PathParameters a adapter function of server.RestServerRequest's 
QueryParameter
 func (grra *GoRestfulRequestAdapter) PathParameters() map[string]string {
return grra.request.PathParameters()
 }
 
-// A adapter function of server.RestServerRequest's QueryParameters
+// QueryParameter a adapter function of server.RestServerRequest's 
QueryParameters
 func (grra *GoRestfulRequestAdapter) QueryParameter(name string) string {
return grra.request.QueryParameter(name)
 }
 
-// A adapter function of server.RestServerRequest's QueryParameters
+// QueryParameters a adapter function of server.RestServerRequest's 
QueryParameters
 func (grra *GoRestfulRequestAdapter) QueryParameters(name string) []string {
return grra.request.QueryParameters(name)
 }
 
-// A adapter function of server.RestServerRequest's BodyParameter
+// BodyParameter a adapter function of server.RestServerRequest's BodyParameter
 func (grra *GoRestfulRequestAdapter) BodyParameter(name string) (string, 
error) {
return grra.request.BodyParameter(name)
 }
 
-// A adapter function of server.RestServerRequest's HeaderParameter
+// HeaderParameter a adapter function of server.RestServerRequest's 
HeaderParameter
 func (grra *GoRestfulRequestAdapter) HeaderParameter(name string) string {
return grra.request.HeaderParameter(name)
 }
 
-// A adapter func of server.RestServerRequest's ReadEntity
+// ReadEntity a adapter func of server.RestServerRequest's ReadEntity
 func (grra *GoRestfulRequestAdapter) ReadEntity(entityPointer interface{}) 
error {
return grra.request.ReadEntity(entityPointer)
 }



[dubbo-go] 06/13: modify some comments and when parsing parameters occurred error, return error immediately

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit 79bd56cfefefb2431c36ab4ffecd81e37f3e13c7
Author: Patrick 
AuthorDate: Wed Apr 1 23:38:08 2020 +0800

modify some comments and when parsing parameters occurred error, return 
error immediately
---
 protocol/rest/client/client_impl/resty_client.go |   4 +-
 protocol/rest/client/rest_client.go  |   6 +-
 protocol/rest/server/rest_server.go  | 114 +--
 3 files changed, 71 insertions(+), 53 deletions(-)

diff --git a/protocol/rest/client/client_impl/resty_client.go 
b/protocol/rest/client/client_impl/resty_client.go
index bfd7445..b60f50a 100644
--- a/protocol/rest/client/client_impl/resty_client.go
+++ b/protocol/rest/client/client_impl/resty_client.go
@@ -40,11 +40,12 @@ func init() {
extension.SetRestClient(constant.DEFAULT_REST_CLIENT, NewRestyClient)
 }
 
-// A rest client implement by Resty
+// RestyClient a rest client implement by Resty
 type RestyClient struct {
client *resty.Client
 }
 
+// NewRestyClient a constructor of RestyClient
 func NewRestyClient(restOption *client.RestOptions) client.RestClient {
client := resty.New()
client.SetTransport(
@@ -66,6 +67,7 @@ func NewRestyClient(restOption *client.RestOptions) 
client.RestClient {
}
 }
 
+// Do send request by RestyClient
 func (rc *RestyClient) Do(restRequest *client.RestClientRequest, res 
interface{}) error {
req := rc.client.R()
req.Header = restRequest.Header
diff --git a/protocol/rest/client/rest_client.go 
b/protocol/rest/client/rest_client.go
index 47d17c6..d63c5e0 100644
--- a/protocol/rest/client/rest_client.go
+++ b/protocol/rest/client/rest_client.go
@@ -22,13 +22,13 @@ import (
"time"
 )
 
-// Some rest options
+// RestOptions
 type RestOptions struct {
RequestTimeout time.Duration
ConnectTimeout time.Duration
 }
 
-// Client request
+// RestClientRequest
 type RestClientRequest struct {
Header  http.Header
Locationstring
@@ -39,7 +39,7 @@ type RestClientRequest struct {
Bodyinterface{}
 }
 
-// User can implement this client interface to send request
+// RestClient user can implement this client interface to send request
 type RestClient interface {
Do(request *RestClientRequest, res interface{}) error
 }
diff --git a/protocol/rest/server/rest_server.go 
b/protocol/rest/server/rest_server.go
index 60f0dab..60cac9a 100644
--- a/protocol/rest/server/rest_server.go
+++ b/protocol/rest/server/rest_server.go
@@ -19,6 +19,7 @@ package server
 
 import (
"context"
+   "errors"
"net/http"
"reflect"
"strconv"
@@ -37,6 +38,8 @@ import (
rest_config "github.com/apache/dubbo-go/protocol/rest/config"
 )
 
+const parseParameterErrorStr = "An error occurred while parsing parameters on 
the server"
+
 type RestServer interface {
// start rest server
Start(url common.URL)
@@ -50,19 +53,19 @@ type RestServer interface {
 
 // RestServerRequest interface
 type RestServerRequest interface {
-   // Get the Ptr of http.Request
+   // RawRequest get the Ptr of http.Request
RawRequest() *http.Request
-   // Get the path parameter by name
+   // PathParameter get the path parameter by name
PathParameter(name string) string
-   // Get the map of the path parameters
+   // PathParameters get the map of the path parameters
PathParameters() map[string]string
-   // Get the query parameter by name
+   // QueryParameter get the query parameter by name
QueryParameter(name string) string
-   // Get the map of query parameters
+   // QueryParameters get the map of query parameters
QueryParameters(name string) []string
-   // Get the body parameter of name
+   // BodyParameter get the body parameter of name
BodyParameter(name string) (string, error)
-   // Get the header parameter of name
+   // HeaderParameter get the header parameter of name
HeaderParameter(name string) string
// ReadEntity checks the Accept header and reads the content into the 
entityPointer.
ReadEntity(entityPointer interface{}) error
@@ -72,12 +75,13 @@ type RestServerRequest interface {
 type RestServerResponse interface {
http.ResponseWriter
// WriteError writes the http status and the error string on the 
response. err can be nil.
-   // Return an error if writing was not succesful.
+   // Return an error if writing was not successful.
WriteError(httpStatus int, err error) (writeErr error)
// WriteEntity marshals the value using the representation denoted by 
the Accept Header.
WriteEntity(value interface{}) error
 }
 
+// GetRouteFun

[dubbo-go] 12/13: let go_restful_server support same url and different methodType

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit a7174c3922ca3deb2a8c5515ea5468efd7aaac21
Author: Patrick 
AuthorDate: Tue Jul 28 21:49:59 2020 +0800

let go_restful_server support same url and different methodType
---
 .../rest/server/server_impl/go_restful_server.go   | 24 -
 .../server/server_impl/go_restful_server_test.go   | 57 ++
 2 files changed, 70 insertions(+), 11 deletions(-)

diff --git a/protocol/rest/server/server_impl/go_restful_server.go 
b/protocol/rest/server/server_impl/go_restful_server.go
index c7d971f..6fb9ee8 100644
--- a/protocol/rest/server/server_impl/go_restful_server.go
+++ b/protocol/rest/server/server_impl/go_restful_server.go
@@ -48,8 +48,8 @@ var filterSlice []restful.FilterFunction
 
 // GoRestfulServer a rest server implement by go-restful
 type GoRestfulServer struct {
-   srv   *http.Server
-   container *restful.Container
+   srv *http.Server
+   ws  *restful.WebService
 }
 
 // NewGoRestfulServer a constructor of GoRestfulServer
@@ -60,13 +60,17 @@ func NewGoRestfulServer() server.RestServer {
 // Start go-restful server
 // It will add all go-restful filters
 func (grs *GoRestfulServer) Start(url common.URL) {
-   grs.container = restful.NewContainer()
+   container := restful.NewContainer()
for _, filter := range filterSlice {
-   grs.container.Filter(filter)
+   container.Filter(filter)
}
grs.srv = {
-   Handler: grs.container,
+   Handler: container,
}
+   grs.ws = {}
+   grs.ws.Path("/")
+   grs.ws.SetDynamicRoutes(true)
+   container.Add(grs.ws)
ln, err := net.Listen("tcp", url.Location)
if err != nil {
panic(perrors.New(fmt.Sprintf("Restful Server start error:%v", 
err)))
@@ -83,23 +87,21 @@ func (grs *GoRestfulServer) Start(url common.URL) {
 // Publish a http api in go-restful server
 // The routeFunc should be invoked when the server receive a request
 func (grs *GoRestfulServer) Deploy(restMethodConfig *config.RestMethodConfig, 
routeFunc func(request server.RestServerRequest, response 
server.RestServerResponse)) {
-   ws := {}
+
rf := func(req *restful.Request, resp *restful.Response) {
routeFunc(NewGoRestfulRequestAdapter(req), resp)
}
-   ws.Path(restMethodConfig.Path).
+   grs.ws.Route(grs.ws.Method(restMethodConfig.MethodType).
Produces(strings.Split(restMethodConfig.Produces, ",")...).
Consumes(strings.Split(restMethodConfig.Consumes, ",")...).
-   Route(ws.Method(restMethodConfig.MethodType).To(rf))
-   grs.container.Add(ws)
-
+   Path(restMethodConfig.Path).To(rf))
 }
 
 // Delete a http api in go-restful server
 func (grs *GoRestfulServer) UnDeploy(restMethodConfig 
*config.RestMethodConfig) {
ws := new(restful.WebService)
ws.Path(restMethodConfig.Path)
-   err := grs.container.Remove(ws)
+   err := grs.ws.RemoveRoute(restMethodConfig.Path, 
restMethodConfig.MethodType)
if err != nil {
logger.Warnf("[Go restful] Remove web service error:%v", err)
}
diff --git a/protocol/rest/server/server_impl/go_restful_server_test.go 
b/protocol/rest/server/server_impl/go_restful_server_test.go
new file mode 100644
index 000..29a9ef8
--- /dev/null
+++ b/protocol/rest/server/server_impl/go_restful_server_test.go
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package server_impl
+
+import (
+   "testing"
+)
+
+import (
+   "github.com/stretchr/testify/assert"
+)
+
+import (
+   "github.com/apache/dubbo-go/common"
+   "github.com/apache/dubbo-go/protocol/rest/config"
+   "github.com/apache/dubbo-go/protocol/rest/server"
+)
+
+func TestGoRestfulServerDeploySameUrl(t *testing.T) {
+   grs := NewGoRestfulServer()
+   url, err := commo

[dubbo-go] 13/13: format code

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit ea865671c530c7fd3a2a5bae4c75af177bba8684
Author: Patrick 
AuthorDate: Thu Jul 30 19:27:45 2020 +0800

format code
---
 .../rest/server/server_impl/go_restful_server_test.go| 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/protocol/rest/server/server_impl/go_restful_server_test.go 
b/protocol/rest/server/server_impl/go_restful_server_test.go
index 29a9ef8..b1e6606 100644
--- a/protocol/rest/server/server_impl/go_restful_server_test.go
+++ b/protocol/rest/server/server_impl/go_restful_server_test.go
@@ -37,18 +37,18 @@ func TestGoRestfulServerDeploySameUrl(t *testing.T) {
assert.NoError(t, err)
grs.Start(url)
rmc := {
-   Produces:   "*/*",
-   Consumes:   "*/*",
-   MethodType: "POST",
-   Path: "/test",
+   Produces:   "*/*",
+   Consumes:   "*/*",
+   MethodType: "POST",
+   Path:   "/test",
}
f := func(request server.RestServerRequest, response 
server.RestServerResponse) {}
grs.Deploy(rmc, f)
rmc1 := {
-   Produces:   "*/*",
-   Consumes:   "*/*",
-   MethodType: "GET",
-   Path: "/test",
+   Produces:   "*/*",
+   Consumes:   "*/*",
+   MethodType: "GET",
+   Path:   "/test",
}
grs.Deploy(rmc1, f)
grs.UnDeploy(rmc)



[dubbo-go] 04/13: optimize header transmit in RestClient and RestServer

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit bcb01004337eb1a3baf4390f905f649e4477ad85
Author: Patrick 
AuthorDate: Wed Apr 1 19:05:58 2020 +0800

optimize header transmit in RestClient and RestServer
---
 protocol/rest/client/client_impl/resty_client.go   | 11 +++---
 protocol/rest/client/rest_client.go|  5 +--
 protocol/rest/rest_invoker.go  | 23 ---
 protocol/rest/server/rest_server.go|  4 ++
 .../rest/server/server_impl/go_restful_server.go   | 44 +-
 5 files changed, 72 insertions(+), 15 deletions(-)

diff --git a/protocol/rest/client/client_impl/resty_client.go 
b/protocol/rest/client/client_impl/resty_client.go
index af9637e..9e0c80c 100644
--- a/protocol/rest/client/client_impl/resty_client.go
+++ b/protocol/rest/client/client_impl/resty_client.go
@@ -66,20 +66,19 @@ func NewRestyClient(restOption *client.RestOptions) 
client.RestClient {
 }
 
 func (rc *RestyClient) Do(restRequest *client.RestClientRequest, res 
interface{}) error {
-   r, err := rc.client.R().
-   SetHeader("Content-Type", restRequest.Consumes).
-   SetHeader("Accept", restRequest.Produces).
+   req := rc.client.R()
+   req.Header = restRequest.Header
+   resp, err := req.
SetPathParams(restRequest.PathParams).
SetQueryParams(restRequest.QueryParams).
-   SetHeaders(restRequest.Headers).
SetBody(restRequest.Body).
SetResult(res).
Execute(restRequest.Method, 
"http://"+path.Join(restRequest.Location, restRequest.Path))
if err != nil {
return perrors.WithStack(err)
}
-   if r.IsError() {
-   return perrors.New(r.String())
+   if resp.IsError() {
+   return perrors.New(resp.String())
}
return nil
 }
diff --git a/protocol/rest/client/rest_client.go 
b/protocol/rest/client/rest_client.go
index 3acccb5..5be4bb3 100644
--- a/protocol/rest/client/rest_client.go
+++ b/protocol/rest/client/rest_client.go
@@ -18,6 +18,7 @@
 package client
 
 import (
+   "net/http"
"time"
 )
 
@@ -27,15 +28,13 @@ type RestOptions struct {
 }
 
 type RestClientRequest struct {
+   Header  http.Header
Locationstring
Pathstring
-   Producesstring
-   Consumesstring
Method  string
PathParams  map[string]string
QueryParams map[string]string
Bodyinterface{}
-   Headers map[string]string
 }
 
 type RestClient interface {
diff --git a/protocol/rest/rest_invoker.go b/protocol/rest/rest_invoker.go
index c8e3fea..121d121 100644
--- a/protocol/rest/rest_invoker.go
+++ b/protocol/rest/rest_invoker.go
@@ -20,6 +20,7 @@ package rest
 import (
"context"
"fmt"
+   "net/http"
 )
 
 import (
@@ -56,7 +57,7 @@ func (ri *RestInvoker) Invoke(ctx context.Context, invocation 
protocol.Invocatio
bodyinterface{}
pathParams  map[string]string
queryParams map[string]string
-   headers map[string]string
+   header  http.Header
err error
)
if methodConfig == nil {
@@ -71,7 +72,7 @@ func (ri *RestInvoker) Invoke(ctx context.Context, invocation 
protocol.Invocatio
result.Err = err
return 
}
-   if headers, err = restStringMapTransform(methodConfig.HeadersMap, 
inv.Arguments()); err != nil {
+   if header, err = getRestHttpHeader(methodConfig, inv.Arguments()); err 
!= nil {
result.Err = err
return 
}
@@ -80,14 +81,12 @@ func (ri *RestInvoker) Invoke(ctx context.Context, 
invocation protocol.Invocatio
}
req := {
Location:ri.GetUrl().Location,
-   Produces:methodConfig.Produces,
-   Consumes:methodConfig.Consumes,
Method:  methodConfig.MethodType,
Path:methodConfig.Path,
PathParams:  pathParams,
QueryParams: queryParams,
Body:body,
-   Headers: headers,
+   Header:  header,
}
result.Err = ri.client.Do(req, inv.Reply())
if result.Err == nil {
@@ -106,3 +105,17 @@ func restStringMapTransform(paramsMap map[int]string, args 
[]interface{}) (map[s
}
return resMap, nil
 }
+
+func getRestHttpHeader(methodConfig *config.RestMethodConfig, args 
[]interface{}) (http.Header, error) {
+   header := http.Header{}
+   headersMap := methodConfig.HeadersMap
+   header.Set("Content-Type", methodConf

[dubbo-go] 07/13: modify comments

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit 6540c8907da701dd1d7d4cf84a4de3dd6208ebbd
Author: Patrick 
AuthorDate: Wed Apr 1 23:40:10 2020 +0800

modify comments
---
 protocol/rest/server/rest_server.go | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/protocol/rest/server/rest_server.go 
b/protocol/rest/server/rest_server.go
index 60cac9a..8bc32e8 100644
--- a/protocol/rest/server/rest_server.go
+++ b/protocol/rest/server/rest_server.go
@@ -40,14 +40,15 @@ import (
 
 const parseParameterErrorStr = "An error occurred while parsing parameters on 
the server"
 
+// RestServer user can implement this server interface
 type RestServer interface {
-   // start rest server
+   // Start rest server
Start(url common.URL)
-   // deploy a http api
+   // Deploy a http api
Deploy(restMethodConfig *rest_config.RestMethodConfig, routeFunc 
func(request RestServerRequest, response RestServerResponse))
-   // unDeploy a http api
+   // UnDeploy a http api
UnDeploy(restMethodConfig *rest_config.RestMethodConfig)
-   // destroy rest server
+   // Destroy rest server
Destroy()
 }
 



[dubbo-go] 03/13: remove adapter

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit 9a9b3a7e264ad8811ba2e9f21987e526e92118d9
Author: Patrick 
AuthorDate: Wed Apr 1 01:40:18 2020 +0800

remove adapter
---
 .../rest/server/server_impl/go_restful_server.go   | 58 +-
 1 file changed, 1 insertion(+), 57 deletions(-)

diff --git a/protocol/rest/server/server_impl/go_restful_server.go 
b/protocol/rest/server/server_impl/go_restful_server.go
index 3c81fe0..81043c8 100644
--- a/protocol/rest/server/server_impl/go_restful_server.go
+++ b/protocol/rest/server/server_impl/go_restful_server.go
@@ -79,9 +79,7 @@ func (grs *GoRestfulServer) Start(url common.URL) {
 func (grs *GoRestfulServer) Deploy(restMethodConfig *config.RestMethodConfig, 
routeFunc func(request server.RestServerRequest, response 
server.RestServerResponse)) {
ws := new(restful.WebService)
rf := func(req *restful.Request, resp *restful.Response) {
-   respAdapter := NewGoRestfulResponseAdapter(resp)
-   reqAdapter := NewGoRestfulRequestAdapter(req)
-   routeFunc(reqAdapter, respAdapter)
+   routeFunc(req, resp)
}
ws.Path(restMethodConfig.Path).
Produces(strings.Split(restMethodConfig.Produces, ",")...).
@@ -118,57 +116,3 @@ func GetNewGoRestfulServer() server.RestServer {
 func AddGoRestfulServerFilter(filterFuc restful.FilterFunction) {
filterSlice = append(filterSlice, filterFuc)
 }
-
-// Go Restful Request adapt to RestServerRequest
-type GoRestfulRequestAdapter struct {
-   rawRequest *restful.Request
-}
-
-func (gra *GoRestfulRequestAdapter) PathParameter(name string) string {
-   return gra.rawRequest.PathParameter(name)
-}
-
-func (gra *GoRestfulRequestAdapter) PathParameters() map[string]string {
-   return gra.rawRequest.PathParameters()
-}
-
-func (gra *GoRestfulRequestAdapter) QueryParameter(name string) string {
-   return gra.rawRequest.QueryParameter(name)
-}
-
-func (gra *GoRestfulRequestAdapter) QueryParameters(name string) []string {
-   return gra.rawRequest.QueryParameters(name)
-}
-
-func (gra *GoRestfulRequestAdapter) BodyParameter(name string) (string, error) 
{
-   return gra.rawRequest.BodyParameter(name)
-}
-
-func (gra *GoRestfulRequestAdapter) HeaderParameter(name string) string {
-   return gra.rawRequest.HeaderParameter(name)
-}
-
-func (gra *GoRestfulRequestAdapter) ReadEntity(entityPointer interface{}) 
error {
-   return gra.rawRequest.ReadEntity(entityPointer)
-}
-
-func NewGoRestfulRequestAdapter(rawRequest *restful.Request) 
server.RestServerRequest {
-   return {rawRequest: rawRequest}
-}
-
-// Go Restful Request adapt to RestClientRequest
-type GoRestfulResponseAdapter struct {
-   rawResponse *restful.Response
-}
-
-func (grsa *GoRestfulResponseAdapter) WriteError(httpStatus int, err error) 
(writeErr error) {
-   return grsa.rawResponse.WriteError(httpStatus, err)
-}
-
-func (grsa *GoRestfulResponseAdapter) WriteEntity(value interface{}) error {
-   return grsa.rawResponse.WriteEntity(value)
-}
-
-func NewGoRestfulResponseAdapter(rawResponse *restful.Response) 
server.RestServerResponse {
-   return {rawResponse: rawResponse}
-}



[dubbo-go] 02/13: use adapter model to modify restServer

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit 13369bf9a72e16ef657ccf6b27d269367dc37776
Author: Patrick 
AuthorDate: Tue Mar 31 23:10:40 2020 +0800

use adapter model to modify restServer
---
 protocol/rest/client/client_impl/resty_client.go   |   2 +-
 protocol/rest/client/rest_client.go|   4 +-
 protocol/rest/rest_invoker.go  |   3 +-
 protocol/rest/rest_protocol.go |   4 +-
 protocol/rest/server/rest_server.go| 261 ++-
 .../rest/server/server_impl/go_restful_server.go   | 287 +
 6 files changed, 335 insertions(+), 226 deletions(-)

diff --git a/protocol/rest/client/client_impl/resty_client.go 
b/protocol/rest/client/client_impl/resty_client.go
index aa6c231..af9637e 100644
--- a/protocol/rest/client/client_impl/resty_client.go
+++ b/protocol/rest/client/client_impl/resty_client.go
@@ -65,7 +65,7 @@ func NewRestyClient(restOption *client.RestOptions) 
client.RestClient {
}
 }
 
-func (rc *RestyClient) Do(restRequest *client.RestRequest, res interface{}) 
error {
+func (rc *RestyClient) Do(restRequest *client.RestClientRequest, res 
interface{}) error {
r, err := rc.client.R().
SetHeader("Content-Type", restRequest.Consumes).
SetHeader("Accept", restRequest.Produces).
diff --git a/protocol/rest/client/rest_client.go 
b/protocol/rest/client/rest_client.go
index 7d020ab..3acccb5 100644
--- a/protocol/rest/client/rest_client.go
+++ b/protocol/rest/client/rest_client.go
@@ -26,7 +26,7 @@ type RestOptions struct {
ConnectTimeout time.Duration
 }
 
-type RestRequest struct {
+type RestClientRequest struct {
Locationstring
Pathstring
Producesstring
@@ -39,5 +39,5 @@ type RestRequest struct {
 }
 
 type RestClient interface {
-   Do(request *RestRequest, res interface{}) error
+   Do(request *RestClientRequest, res interface{}) error
 }
diff --git a/protocol/rest/rest_invoker.go b/protocol/rest/rest_invoker.go
index 0c82035..c8e3fea 100644
--- a/protocol/rest/rest_invoker.go
+++ b/protocol/rest/rest_invoker.go
@@ -78,8 +78,7 @@ func (ri *RestInvoker) Invoke(ctx context.Context, invocation 
protocol.Invocatio
if len(inv.Arguments()) > methodConfig.Body && methodConfig.Body >= 0 {
body = inv.Arguments()[methodConfig.Body]
}
-
-   req := {
+   req := {
Location:ri.GetUrl().Location,
Produces:methodConfig.Produces,
Consumes:methodConfig.Consumes,
diff --git a/protocol/rest/rest_protocol.go b/protocol/rest/rest_protocol.go
index 47ecb60..e15eeb3 100644
--- a/protocol/rest/rest_protocol.go
+++ b/protocol/rest/rest_protocol.go
@@ -75,7 +75,9 @@ func (rp *RestProtocol) Export(invoker protocol.Invoker) 
protocol.Exporter {
}
rp.SetExporterMap(serviceKey, exporter)
restServer := rp.getServer(url, restServiceConfig.Server)
-   restServer.Deploy(invoker, restServiceConfig.RestMethodConfigsMap)
+   for _, methodConfig := range restServiceConfig.RestMethodConfigsMap {
+   restServer.Deploy(methodConfig, server.GetRouteFunc(invoker, 
methodConfig))
+   }
return exporter
 }
 
diff --git a/protocol/rest/server/rest_server.go 
b/protocol/rest/server/rest_server.go
index c10c98a..b7eb555 100644
--- a/protocol/rest/server/rest_server.go
+++ b/protocol/rest/server/rest_server.go
@@ -18,14 +18,269 @@
 package server
 
 import (
+   "context"
+   "net/http"
+   "reflect"
+   "strconv"
+   "strings"
+)
+
+import (
+   perrors "github.com/pkg/errors"
+)
+
+import (
"github.com/apache/dubbo-go/common"
+   "github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/protocol"
-   "github.com/apache/dubbo-go/protocol/rest/config"
+   "github.com/apache/dubbo-go/protocol/invocation"
+   rest_config "github.com/apache/dubbo-go/protocol/rest/config"
 )
 
 type RestServer interface {
Start(url common.URL)
-   Deploy(invoker protocol.Invoker, restMethodConfig 
map[string]*config.RestMethodConfig)
-   UnDeploy(restMethodConfig map[string]*config.RestMethodConfig)
+   Deploy(restMethodConfig *rest_config.RestMethodConfig, routeFunc 
func(request RestServerRequest, response RestServerResponse))
+   UnDeploy(restMethodConfig *rest_config.RestMethodConfig)
Destroy()
 }
+
+// RestServerRequest interface
+type RestServerRequest interface {
+   PathParameter(name string) string
+   PathParameters() map[string]string
+   QueryParameter(name string) string
+   QueryParameters(name string) [

[dubbo-go] 08/13: remove new function

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit 4736cdcdf005405c9c4d5c07979a6733c454053d
Author: Patrick 
AuthorDate: Wed Apr 1 23:43:15 2020 +0800

remove new function
---
 protocol/rest/server/server_impl/go_restful_server.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/protocol/rest/server/server_impl/go_restful_server.go 
b/protocol/rest/server/server_impl/go_restful_server.go
index 00b644f..667d58c 100644
--- a/protocol/rest/server/server_impl/go_restful_server.go
+++ b/protocol/rest/server/server_impl/go_restful_server.go
@@ -83,7 +83,7 @@ func (grs *GoRestfulServer) Start(url common.URL) {
 // Publish a http api in go-restful server
 // The routeFunc should be invoked when the server receive a request
 func (grs *GoRestfulServer) Deploy(restMethodConfig *config.RestMethodConfig, 
routeFunc func(request server.RestServerRequest, response 
server.RestServerResponse)) {
-   ws := new(restful.WebService)
+   ws := {}
rf := func(req *restful.Request, resp *restful.Response) {
routeFunc(NewGoRestfulRequestAdapter(req), resp)
}



[dubbo-go] 11/13: optimized code

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit ca2538a7e8c374678fda25b13f892eaee9112803
Author: Patrick 
AuthorDate: Sat Apr 4 18:33:01 2020 +0800

optimized code
---
 protocol/rest/server/rest_server.go | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/protocol/rest/server/rest_server.go 
b/protocol/rest/server/rest_server.go
index 60a75bc..fbd6fb7 100644
--- a/protocol/rest/server/rest_server.go
+++ b/protocol/rest/server/rest_server.go
@@ -160,11 +160,10 @@ func getArgsInterfaceFromRequest(req RestServerRequest, 
methodConfig *rest_confi
}
m := make(map[string]interface{})
// TODO read as a slice
-   if err := req.ReadEntity(); err == nil {
-   argsMap[methodConfig.Body] = m
-   } else {
+   if err := req.ReadEntity(); err != nil {
return nil, perrors.Errorf("[Go restful] Read body 
entity as map[string]interface{} error:%v", err)
}
+   argsMap[methodConfig.Body] = m
}
args := make([]interface{}, maxKey+1)
for k, v := range argsMap {
@@ -236,11 +235,10 @@ func assembleArgsFromBody(methodConfig 
*rest_config.RestMethodConfig, argsTypes
ni = n.Interface()
}
}
-   if err := req.ReadEntity(); err == nil {
-   args[methodConfig.Body] = ni
-   } else {
+   if err := req.ReadEntity(); err != nil {
return perrors.Errorf("[Go restful] Read body entity 
error, error is %v", perrors.WithStack(err))
}
+   args[methodConfig.Body] = ni
}
return nil
 }



[dubbo-go] 10/13: modify some comments and modify some logger's message

2020-08-09 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git

commit d469144cecfd283bbaf85721f4412585ac8b7f77
Author: Patrick 
AuthorDate: Thu Apr 2 00:17:07 2020 +0800

modify some comments and modify some logger's message
---
 protocol/rest/server/rest_server.go   | 17 ++---
 protocol/rest/server/server_impl/go_restful_server.go |  4 ++--
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/protocol/rest/server/rest_server.go 
b/protocol/rest/server/rest_server.go
index 8bc32e8..60a75bc 100644
--- a/protocol/rest/server/rest_server.go
+++ b/protocol/rest/server/rest_server.go
@@ -95,6 +95,9 @@ func GetRouteFunc(invoker protocol.Invoker, methodConfig 
*rest_config.RestMethod
method := svc.Method()[methodConfig.MethodName]
argsTypes := method.ArgsType()
replyType := method.ReplyType()
+   // two ways to prepare arguments
+   // if method like this 'func1(req []interface{}, rsp *User) 
error'
+   // we don't have arguments type
if (len(argsTypes) == 1 || len(argsTypes) == 2 && replyType == 
nil) &&
argsTypes[0].String() == "[]interface {}" {
args, err = getArgsInterfaceFromRequest(req, 
methodConfig)
@@ -102,7 +105,7 @@ func GetRouteFunc(invoker protocol.Invoker, methodConfig 
*rest_config.RestMethod
args, err = getArgsFromRequest(req, argsTypes, 
methodConfig)
}
if err != nil {
-   logger.Errorf("[Go Restful] parsing parameters 
error:%v", err)
+   logger.Errorf("[Go Restful] parsing http parameters 
error:%v", err)
err = resp.WriteError(http.StatusInternalServerError, 
errors.New(parseParameterErrorStr))
if err != nil {
logger.Errorf("[Go Restful] WriteErrorString 
error:%v", err)
@@ -199,7 +202,7 @@ func assembleArgsFromHeaders(methodConfig 
*rest_config.RestMethodConfig, req Res
for k, v := range methodConfig.HeadersMap {
param := req.HeaderParameter(v)
if k < 0 || k >= argsLength {
-   return perrors.Errorf("[Go restful] Header param parse 
error, the args:%v doesn't exist", k)
+   return perrors.Errorf("[Go restful] Header param parse 
error, the index %v args of method:%v doesn't exist", k, 
methodConfig.MethodName)
}
t := argsTypes[k]
if t.Kind() == reflect.Ptr {
@@ -208,7 +211,7 @@ func assembleArgsFromHeaders(methodConfig 
*rest_config.RestMethodConfig, req Res
if t.Kind() == reflect.String {
args[k] = param
} else {
-   return perrors.Errorf("[Go restful] Header param parse 
error, the args:%v of type isn't string", k)
+   return perrors.Errorf("[Go restful] Header param parse 
error, the index %v args's type isn't string", k)
}
}
return nil
@@ -251,7 +254,7 @@ func assembleArgsFromQueryParams(methodConfig 
*rest_config.RestMethodConfig, arg
)
for k, v := range methodConfig.QueryParamsMap {
if k < 0 || k >= argsLength {
-   return perrors.Errorf("[Go restful] Query param parse 
error, the args:%v doesn't exist", k)
+   return perrors.Errorf("[Go restful] Query param parse 
error, the index %v args of method:%v doesn't exist", k, 
methodConfig.MethodName)
}
t := argsTypes[k]
kind := t.Kind()
@@ -272,7 +275,7 @@ func assembleArgsFromQueryParams(methodConfig 
*rest_config.RestMethodConfig, arg
} else if kind == reflect.Int64 {
param, err = strconv.ParseInt(req.QueryParameter(v), 
10, 64)
} else {
-   return perrors.Errorf("[Go restful] Query param parse 
error, the args:%v of type isn't int or string or slice", k)
+   return perrors.Errorf("[Go restful] Query param parse 
error, the index %v args's type isn't int or string or slice", k)
}
if err != nil {
return perrors.Errorf("[Go restful] Query param parse 
error, error:%v", perrors.WithStack(err))
@@ -291,7 +294,7 @@ func assembleArgsFromPathParams(methodConfig 
*rest_config.RestMethodConfig, args
)
for k, v := range methodConfig.PathParamsMap {
if k < 0 || k >= argsLength {
-   return perrors.Errorf("[Go restful] Path param parse 
er

[dubbo-go] branch master updated: Mod: ignore vim temporary files

2020-06-17 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/master by this push:
 new 7bde7d9  Mod: ignore vim temporary files
 new 88dc291  Merge pull request #614 from asheux/chore/modify-gitignore
7bde7d9 is described below

commit 7bde7d9c7499f6c1d48b0154ae567d4e8cedd5e5
Author: asheux 
AuthorDate: Thu Jun 18 02:33:08 2020 +0300

Mod: ignore vim temporary files
---
 .gitignore | 4 
 1 file changed, 4 insertions(+)

diff --git a/.gitignore b/.gitignore
index 568e9f2..5a0a4f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,7 @@ config_center/zookeeper/zookeeper-4unittest/
 registry/zookeeper/zookeeper-4unittest/
 registry/consul/agent*
 config_center/apollo/mockDubbog.properties.json
+
+# vim stuff
+*~
+.*.sw?



[dubbo-go] branch develop updated (0a08cda -> 6eca640)

2020-06-03 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 0a08cda  Merge pull request #583 from ZYB-J/dev
 new c8d1158  modify unit test improving code coverage
 new 169744e  Merge remote-tracking branch 'upstream/develop' into 
config-center-zk-test-cover
 new 4a0f73e  fix imports
 new 6eca640  Merge pull request #549 from 
Patrick0308/config-center-zk-test-cover

The 2116 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 config_center/zookeeper/impl.go  | 28 ---
 config_center/zookeeper/impl_test.go | 37 +++-
 2 files changed, 28 insertions(+), 37 deletions(-)



[dubbo-go] branch develop updated (4af26b9 -> 962025b)

2020-06-02 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 4af26b9  Merge pull request #547 from 
williamfeng323/feature/metrics-comment-optimise
 new a70ca54  Add: add comments for config directory
 new 91a8d34  Merge branch 'develop' into featue/addCommentForConfig
 new b8502aa  Merge branch 'develop' into featue/addCommentForConfig
 new da4a02f  Merge branch 'featue/addCommentForConfig' of 
https://github.com/watermelo/dubbo-go into featue/addCommentForConfig
 new bada632  Mod: modify inappropriate comments after review
 new 962025b  Merge pull request #579 from 
watermelo/featue/addCommentForConfig

The 2109 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 config/application_config.go   | 18 --
 config/base_config.go  |  3 +--
 config/config_center_config.go | 12 +---
 config/consumer_config.go  | 10 +-
 config/generic_service.go  |  6 +++---
 config/graceful_shutdown.go| 14 +-
 config/graceful_shutdown_config.go |  8 
 config/graceful_shutdown_signal_darwin.go  |  4 ++--
 config/graceful_shutdown_signal_linux.go   |  4 ++--
 config/graceful_shutdown_signal_windows.go |  4 ++--
 config/instance/metadata_report.go |  2 +-
 config/interfaces/config_reader.go |  2 +-
 config/metadata_report_config.go   |  8 
 config/method_config.go|  4 ++--
 config/mock_rpcservice.go  |  8 
 config/protocol_config.go  |  4 ++--
 config/provider_config.go  | 10 +-
 config/reference_config.go |  8 
 config/registry_config.go  |  6 +++---
 config/service.go  |  6 +++---
 config/service_config.go   |  6 +++---
 21 files changed, 69 insertions(+), 78 deletions(-)



[dubbo-go] branch feature/dubbo-2.7.5 updated: change test case method

2020-05-25 Thread baze
This is an automated email from the ASF dual-hosted git repository.

baze pushed a commit to branch feature/dubbo-2.7.5
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/feature/dubbo-2.7.5 by this 
push:
 new b364f31  change test case method
 new 9578fc0  Merge pull request #542 from zouyx/feature/addRegistryUnpub
b364f31 is described below

commit b364f31815af8067cee14b6e7f618011f59b95de
Author: Joe Zou 
AuthorDate: Tue May 26 00:42:20 2020 +0800

change test case method
---
 registry/zookeeper/registry_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/registry/zookeeper/registry_test.go 
b/registry/zookeeper/registry_test.go
index 2e2602e..d915fc2 100644
--- a/registry/zookeeper/registry_test.go
+++ b/registry/zookeeper/registry_test.go
@@ -126,7 +126,7 @@ func Test_UnSubscribe(t *testing.T) {
}
assert.Regexp(t, ".*ServiceEvent{Action{add}.*", serviceEvent.String())
 
-   reg2.DoUnsubscribe()
+   reg2.UnSubscribe(, nil)
assert.Nil(t, reg2.listener)
 
defer ts.Stop()