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/02/23 07:24:31 UTC

[GitHub] [dubbo-go-samples] yakecanlee opened a new pull request #52: feat: add readme for samples

yakecanlee opened a new pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52


   add readme for generic, helloworld, group and rest.


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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-b/tests/integration/userprovider_test.go
##########
@@ -0,0 +1,38 @@
+// +build integration
+
+/*
+ * 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 integration
+
+import (
+	"context"
+	"testing"
+)
+import (

Review comment:
       add a blank line above to split the two import blocks.




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-b/tests/integration/main_test.go
##########
@@ -0,0 +1,71 @@
+// +build integration
+
+/*
+ * 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 integration
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"
+	"github.com/apache/dubbo-go/config"
+
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/metadata/service/inmemory"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+import (
+	"context"
+	"os"
+	"testing"
+	"time"
+)
+
+var userProvider = new(UserProvider)
+
+func TestMain(m *testing.M) {
+	config.SetConsumerService(userProvider)
+	hessian.RegisterPOJO(&User{})
+	config.Load()
+	time.Sleep(3 * time.Second)
+
+	os.Exit(m.Run())
+}
+
+type User struct {
+	Id   string

Review comment:
       Id -> ID




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-a/cmd/server.go
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"syscall"
+	"time"
+)
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"
+	"github.com/apache/dubbo-go-samples/group/go-server-group-a/pkg"

Review comment:
       move this pkg to another import block as the 3rd import group.




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

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-samples] yakecanlee commented on pull request #52: feat: add readme for samples

Posted by GitBox <gi...@apache.org>.
yakecanlee commented on pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52#issuecomment-796572678


   > fix conflicts pls
   
   done


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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-b/pkg/user.go
##########
@@ -0,0 +1,63 @@
+/*
+ * 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 pkg
+
+import (
+	"context"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log"
+)
+
+import (

Review comment:
       merge it to the 2rd import group.




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-client/pkg/user.go
##########
@@ -0,0 +1,50 @@
+/*
+ * 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 pkg
+
+import (
+	"context"
+	"time"
+)
+
+type User struct {
+	Id   string

Review comment:
       using ID pls.




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: helloworld/README.md
##########
@@ -0,0 +1,135 @@
+## Hello World Example
+
+### Configuration
+
+registy config
+
+```yaml
+# registry config
+registries:
+  "demoZk":
+    protocol: "zookeeper"
+    timeout: "3s"
+    address: "127.0.0.1:2181"
+
+```
+
+provider config
+
+```yaml
+# service config
+services:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 1
+```
+
+consumer config
+
+```yaml
+# reference config
+references:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 3
+```
+
+### Code
+
+provider
+
+```go
+// init 
+func init() {
+	config.SetProviderService(new(UserProvider))
+	// ------for hessian2------
+	hessian.RegisterPOJO(&User{})
+}
+
+// define dto
+type User struct {
+	Id   string
+	Name string
+	Age  int32
+	Time time.Time
+}
+
+// implement POJO interface for hessian2
+func (u User) JavaClassName() string {
+	return "org.apache.dubbo.User"
+}
+
+// service define
+type UserProvider struct {
+}
+
+// interface define
+func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User, error) {
+	//biz code...
+}
+
+// implement RPCService interface
+func (u *UserProvider) Reference() string {
+	return "UserProvider"
+}
+```
+
+consumer
+
+```go
+var userProvider = new(pkg.UserProvider)
+
+// init 
+func init() {
+	config.SetConsumerService(userProvider)
+	hessian.RegisterPOJO(&pkg.User{})
+}
+
+// define dto
+type User struct {
+	Id   string

Review comment:
       Id -> ID




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-b/tests/integration/main_test.go
##########
@@ -0,0 +1,71 @@
+// +build integration
+
+/*
+ * 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 integration
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"
+	"github.com/apache/dubbo-go/config"
+
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/metadata/service/inmemory"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+import (

Review comment:
       move it above as the 1st import group.




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

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-samples] yakecanlee removed a comment on pull request #52: feat: add readme for samples

Posted by GitBox <gi...@apache.org>.
yakecanlee removed a comment on pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52#issuecomment-796572549


   > fix conflicts pls
   
   i can merge this branch into master without conflicts 😂
   
   > fix conflicts pls
   
   done


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

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-samples] beiwei30 commented on pull request #52: feat: add readme for samples

Posted by GitBox <gi...@apache.org>.
beiwei30 commented on pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52#issuecomment-789757541


   @yakecanlee pls. check my review comments. 


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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: helloworld/README_zh.md
##########
@@ -0,0 +1,135 @@
+## Hello World 实例
+
+### 配置
+
+注册中心配置
+
+```yaml
+# registry config
+registries:
+  "demoZk":
+    protocol: "zookeeper"
+    timeout: "3s"
+    address: "127.0.0.1:2181"
+
+```
+
+服务提供者配置
+
+```yaml
+# service config
+services:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 1
+```
+
+服务消费者配置
+
+```yaml
+# reference config
+references:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 3
+```
+
+### 代码示例
+
+生产者示例
+
+```go
+// init 
+func init() {
+	config.SetProviderService(new(UserProvider))
+	// ------for hessian2------
+	hessian.RegisterPOJO(&User{})
+}
+
+// define dto
+type User struct {
+	Id   string

Review comment:
       Id -> ID




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

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-samples] beiwei30 commented on a change in pull request #52: feat: add readme for samples

Posted by GitBox <gi...@apache.org>.
beiwei30 commented on a change in pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52#discussion_r586464311



##########
File path: general/rest/go-client/cmd/client.go
##########
@@ -20,6 +20,7 @@ package main
 import (
 	"context"
 	"fmt"
+	"github.com/apache/dubbo-go-samples/general/rest/go-client/pkg"

Review comment:
       pls. group the import




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-a/pkg/user.go
##########
@@ -0,0 +1,63 @@
+/*
+ * 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 pkg
+
+import (
+	"context"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log"
+)
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"

Review comment:
       the two pkgs should be placed into the 2rd import group because they are not belongs to "github.com/apache/dubbo-go-samples".




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

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-samples] beiwei30 commented on a change in pull request #52: feat: add readme for samples

Posted by GitBox <gi...@apache.org>.
beiwei30 commented on a change in pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52#discussion_r586465116



##########
File path: general/rest/go-server/cmd/server.go
##########
@@ -31,9 +31,11 @@ import (
 )
 
 import (
+	_ "github.com/apache/dubbo-go-samples/general/rest/go-server/pkg"

Review comment:
       pls. group the imports.




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-b/cmd/server.go
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"syscall"
+	"time"
+)
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"
+	"github.com/apache/dubbo-go-samples/group/go-server-group-b/pkg"

Review comment:
       move it out to another import block as the 3rd import group.




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

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-samples] yakecanlee commented on pull request #52: feat: add readme for samples

Posted by GitBox <gi...@apache.org>.
yakecanlee commented on pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52#issuecomment-789772301


   > @yakecanlee pls. check my review comments.
   
   done. pls review.


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

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-samples] beiwei30 merged pull request #52: feat: add readme for samples

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


   


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

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-samples] yakecanlee commented on pull request #52: feat: add readme for samples

Posted by GitBox <gi...@apache.org>.
yakecanlee commented on pull request #52:
URL: https://github.com/apache/dubbo-go-samples/pull/52#issuecomment-796572549


   > fix conflicts pls
   
   i can merge this branch into master without conflicts 😂
   
   > fix conflicts pls
   
   done


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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: helloworld/README_zh.md
##########
@@ -0,0 +1,135 @@
+## Hello World 实例
+
+### 配置
+
+注册中心配置
+
+```yaml
+# registry config
+registries:
+  "demoZk":
+    protocol: "zookeeper"
+    timeout: "3s"
+    address: "127.0.0.1:2181"
+
+```
+
+服务提供者配置
+
+```yaml
+# service config
+services:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 1
+```
+
+服务消费者配置
+
+```yaml
+# reference config
+references:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 3
+```
+
+### 代码示例
+
+生产者示例
+
+```go
+// init 
+func init() {
+	config.SetProviderService(new(UserProvider))
+	// ------for hessian2------
+	hessian.RegisterPOJO(&User{})
+}
+
+// define dto
+type User struct {
+	Id   string
+	Name string
+	Age  int32
+	Time time.Time
+}
+
+// implement POJO interface for hessian2
+func (u User) JavaClassName() string {
+	return "org.apache.dubbo.User"
+}
+
+// service define
+type UserProvider struct {
+}
+
+// interface define
+func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User, error) {
+	//biz code...
+}
+
+// implement RPCService interface
+func (u *UserProvider) Reference() string {
+	return "UserProvider"
+}
+```
+
+消费者示例
+
+```go
+var userProvider = new(pkg.UserProvider)
+
+// init 
+func init() {
+	config.SetConsumerService(userProvider)
+	hessian.RegisterPOJO(&pkg.User{})
+}
+
+// define dto
+type User struct {
+	Id   string

Review comment:
       Id -> ID




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: helloworld/README.md
##########
@@ -0,0 +1,135 @@
+## Hello World Example
+
+### Configuration
+
+registy config
+
+```yaml
+# registry config
+registries:
+  "demoZk":
+    protocol: "zookeeper"
+    timeout: "3s"
+    address: "127.0.0.1:2181"
+
+```
+
+provider config
+
+```yaml
+# service config
+services:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 1
+```
+
+consumer config
+
+```yaml
+# reference config
+references:
+  # Reference ID
+  "UserProvider":
+    registry: "demoZk"
+    protocol: "dubbo"
+    interface: "org.apache.dubbo.UserProvider"
+    cluster: "failover"
+    methods:
+      - name: "GetUser"
+        retries: 3
+```
+
+### Code
+
+provider
+
+```go
+// init 
+func init() {
+	config.SetProviderService(new(UserProvider))
+	// ------for hessian2------
+	hessian.RegisterPOJO(&User{})
+}
+
+// define dto
+type User struct {
+	Id   string

Review comment:
       Id -> ID




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

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-samples] AlexStocks commented on a change in pull request #52: feat: add readme for samples

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



##########
File path: group/go-server-group-a/tests/integration/main_test.go
##########
@@ -0,0 +1,71 @@
+// +build integration
+
+/*
+ * 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 integration
+
+import (
+	hessian "github.com/apache/dubbo-go-hessian2"
+	"github.com/apache/dubbo-go/config"
+
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/metadata/service/inmemory"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+import (

Review comment:
       move it above as the 1st import group.




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

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