tianxiaoliang commented on a change in pull request #1205:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1205#discussion_r779351708



##########
File path: api/sync/v1/event_service.proto
##########
@@ -18,6 +18,14 @@ message Result {
   int32  code  = 1; //reuse standard http code
   string message = 2;
 }
+
+message HealthRequest {
+}
+message HealthReply {
+  string status = 1;

Review comment:
       detail message在下一个迭代?

##########
File path: client/set.go
##########
@@ -29,3 +30,21 @@ func NewSetForConfig(c SetConfig) (*Set, error) {
                EventServiceClient: v1sync.NewEventServiceClient(conn),
        }, nil
 }
+
+// NewSetForAddrList dial grpc connection and create all grpc clients
+func NewSetForAddrList(scheme string, addrList []string) (*Set, error) {

Review comment:
       不要新增方法,而是在SetConfig里面加新参数

##########
File path: syncer/health/health_test.go
##########
@@ -0,0 +1,32 @@
+/*
+ * 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 health
+
+import (
+       "testing"
+
+       "github.com/apache/servicecomb-service-center/syncer/config"
+       "github.com/stretchr/testify/assert"
+)
+
+func TestHealth(t *testing.T) {
+       assert.NoError(t, config.Init())

Review comment:
       还需要提供2个test case 一个是非健康的,一个是健康的

##########
File path: syncer/config/config.go
##########
@@ -33,11 +33,24 @@ type Config struct {
 }
 
 type Sync struct {
-       Peers []*Peer `yaml:"peers"`
+       EnableOnStart bool        `yaml:"enableOnStart"`
+       DataCenter    *DataCenter `yaml:"datacenter"`
+       Peers         []*Peer     `yaml:"peers"`
+}
+
+type DataCenter struct {
+       Name          string `yaml:"name"`
+       Region        string `yaml:"region"`
+       AvailableZone string `yaml:"availableZone"`
 }
 
 type Peer struct {
-       // TODO
+       Name      string   `yaml:"name"`
+       Kind      string   `yaml:"kind"`
+       Endpoints []string `yaml:"endpoints"`
+       Mode      []string `yaml:"mode"`
+       CaFile    string   `yaml:"caFile"`
+       Revision  string   `yaml:"revision"`

Review comment:
       Revision是什么

##########
File path: syncer/health/health_test.go
##########
@@ -0,0 +1,32 @@
+/*
+ * 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 health
+
+import (
+       "testing"
+
+       "github.com/apache/servicecomb-service-center/syncer/config"
+       "github.com/stretchr/testify/assert"
+)
+
+func TestHealth(t *testing.T) {
+       assert.NoError(t, config.Init())

Review comment:
       UT需要有test case name




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to