GuoYL123 commented on a change in pull request #766:
URL:
https://github.com/apache/servicecomb-service-center/pull/766#discussion_r532333664
##########
File path: server/service/gov/kie/kie_distributor.go
##########
@@ -0,0 +1,202 @@
+package kie
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "github.com/apache/servicecomb-service-center/pkg/gov"
+ "github.com/apache/servicecomb-service-center/server/config"
+ svc "github.com/apache/servicecomb-service-center/server/service/gov"
+ "github.com/ghodss/yaml"
+ "github.com/go-chassis/kie-client"
+ "log"
+ "strings"
+)
+
+type Distributor struct {
+ lbPolicies map[string]*gov.LoadBalancer
+ name string
+ client *kie.Client
+}
+
+const PREFIX = "servicecomb."
+
+const EnableStatus = "enabled"
+
+const ValueType = "text"
+
+const AppKey = "app"
+
+const EnvironmentKey = "environment"
+
+var rule = Validator{}
+
+func (d *Distributor) Create(kind, project string, spec []byte) error {
+ p := &gov.LoadBalancer{}
Review comment:
进行参数校验时解析逻辑封装在rule.Validate(kind, p.Spec)里面。
调用kie创建时不需要进行解析,直接转化yaml。
----------------------------------------------------------------
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:
[email protected]