You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/11/10 08:48:15 UTC

[GitHub] [servicecomb-service-center] tianxiaoliang opened a new pull request #1166: user go chassis as service center grpc development framework

tianxiaoliang opened a new pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166


   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
    - [ ] Never comment source code, delete it.
    - [ ] UT should has "context, subject, expected result" result as test case name, when you call t.Run().
   ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-service-center] little-cui commented on a change in pull request #1166: user go chassis as service center grpc development framework

Posted by GitBox <gi...@apache.org>.
little-cui commented on a change in pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166#discussion_r747232041



##########
File path: api/sync/v1/event_service.proto
##########
@@ -0,0 +1,24 @@
+syntax = "proto3";
+package api.sync.v1;
+option go_package="github.com/apache/servicecomb-service-center/api/sync/v1;v1";
+message EventList {
+  repeated Event Events= 1;
+}
+message Event {
+  string id = 1;      //entity id
+  string action = 2;  //create, delete, update
+  string subject = 3; //a entity name such as account, role, service, instance
+  map<string, string> opts = 4; //metadata or options
+  bytes value = 5; // the entity
+  int64 epoch = 6;
+}
+message Results {
+  map<string, Result> results = 4; //id to result

Review comment:
       错误的字段排序




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1166: user go chassis as service center grpc development framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166#discussion_r747307831



##########
File path: api/sync/v1/event_service.proto
##########
@@ -0,0 +1,24 @@
+syntax = "proto3";
+package api.sync.v1;
+option go_package="github.com/apache/servicecomb-service-center/api/sync/v1;v1";
+message EventList {
+  repeated Event Events= 1;
+}
+message Event {
+  string id = 1;      //entity id
+  string action = 2;  //create, delete, update
+  string subject = 3; //a entity name such as account, role, service, instance
+  map<string, string> opts = 4; //metadata or options
+  bytes value = 5; // the entity
+  int64 epoch = 6;

Review comment:
       目前的确没用,我删掉




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1166: user go chassis as service center grpc development framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166#discussion_r747233543



##########
File path: client/set.go
##########
@@ -0,0 +1,31 @@
+package client
+
+import (
+	"fmt"
+
+	v1sync "github.com/apache/servicecomb-service-center/api/sync/v1"
+	"github.com/apache/servicecomb-service-center/pkg/log"
+	"google.golang.org/grpc"
+)
+
+// SetConfig is client configs
+type SetConfig struct {
+	Addr string
+}
+
+// Set is set of grpc clients
+type Set struct {
+	EventServiceClient v1sync.EventServiceClient

Review comment:
       不用,参考了istio的api client编写风格




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-service-center] little-cui merged pull request #1166: user go chassis as service center grpc development framework

Posted by GitBox <gi...@apache.org>.
little-cui merged pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-service-center] robotLJW commented on a change in pull request #1166: user go chassis as service center grpc development framework

Posted by GitBox <gi...@apache.org>.
robotLJW commented on a change in pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166#discussion_r747150230



##########
File path: client/set.go
##########
@@ -0,0 +1,31 @@
+package client
+
+import (
+	"fmt"
+
+	v1sync "github.com/apache/servicecomb-service-center/api/sync/v1"
+	"github.com/apache/servicecomb-service-center/pkg/log"
+	"google.golang.org/grpc"
+)
+
+// SetConfig is client configs
+type SetConfig struct {
+	Addr string
+}
+
+// Set is set of grpc clients
+type Set struct {
+	EventServiceClient v1sync.EventServiceClient
+}
+
+//NewSetForConfig dial grpc connection and create all grpc clients

Review comment:
       这个注释// 后面应该空一格

##########
File path: api/sync/v1/event_service.proto
##########
@@ -0,0 +1,24 @@
+syntax = "proto3";
+package api.sync.v1;
+option go_package="github.com/apache/servicecomb-service-center/api/sync/v1;v1";
+message EventList {
+  repeated Event Events= 1;
+}
+message Event {
+  string id = 1;      //entity id
+  string action = 2;  //create, delete, update
+  string subject = 3; //a entity name such as account, role, service, instance
+  map<string, string> opts = 4; //metadata or options
+  bytes value = 5; // the entity
+  int64 epoch = 6;

Review comment:
       epoch 这个字段用于干啥

##########
File path: client/set.go
##########
@@ -0,0 +1,31 @@
+package client
+
+import (
+	"fmt"
+
+	v1sync "github.com/apache/servicecomb-service-center/api/sync/v1"
+	"github.com/apache/servicecomb-service-center/pkg/log"
+	"google.golang.org/grpc"
+)
+
+// SetConfig is client configs
+type SetConfig struct {
+	Addr string
+}
+
+// Set is set of grpc clients
+type Set struct {
+	EventServiceClient v1sync.EventServiceClient

Review comment:
       这个 set 是不是改成 xxxClient 比较合适 
   
   > type xxxClient struct {
   	addr string
   	conn *ggrpc.ClientConn
   	cli  v1sync.EventServiceClient
   }
   
   
   

##########
File path: etc/conf/app.yaml
##########
@@ -16,6 +16,22 @@
 # environment can specify the sc running env, like dev or prod
 environment: dev
 
+sync:
+  datacenter:

Review comment:
       sync 这边是不是得弄个开关。open : true

##########
File path: server/rpc/sync/sync_server.go
##########
@@ -0,0 +1,18 @@
+package sync
+

Review comment:
       sync_server.go已经在 sync 文件下面了,是不是直接 server.go 会更好

##########
File path: api/README.md
##########
@@ -0,0 +1,12 @@
+# ServiceComb gRPC API
+This go module contains all grpc service definition of service center 

Review comment:
       这边为什么抽一个模块,我的意思是 api 为什么需要单独搞一个 go mod,单独弄成一个模块,后续是想要抽出去吗?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1166: user go chassis as service center grpc development framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166#discussion_r747307328



##########
File path: etc/conf/app.yaml
##########
@@ -16,6 +16,22 @@
 # environment can specify the sc running env, like dev or prod
 environment: dev
 
+sync:
+  datacenter:

Review comment:
       确实需要,以后再加




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1166: user go chassis as service center grpc development framework

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1166:
URL: https://github.com/apache/servicecomb-service-center/pull/1166#discussion_r747308340



##########
File path: api/README.md
##########
@@ -0,0 +1,12 @@
+# ServiceComb gRPC API
+This go module contains all grpc service definition of service center 

Review comment:
       对,契约可以生成各个语言的client SDK




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

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