tianxiaoliang commented on a change in pull request #124: Support parameter 
validation
URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397669847
 
 

 ##########
 File path: pkg/validate/instance.go
 ##########
 @@ -0,0 +1,37 @@
+package validate
+
+import "github.com/go-mesh/openlogging"
+
+var defaultValidator *Validator
+
+// custom validate rules
+// tag names suggested to be "kie*", to distinguish from third party tags
+var customRules = []*RegexValidateRule{
+       NewRule("kieKey", 
`^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$`, &Option{Min: 1, Max: 
256}),
+       NewRule("kieValueType", `^(string|ini|json|text|yaml|properties)$`, 
nil),
+       NewRule("kieKvStatus", `^(enabled|disabled){0,1}$`, nil),
 
 Review comment:
   status为空也是合法的,默认值启用

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to