/
service.validator.pb.go
68 lines (61 loc) · 2.49 KB
/
service.validator.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: service.proto
package instances
import (
fmt "fmt"
math "math"
proto "github.com/gogo/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
_ "github.com/easyops-cn/go-proto-giraffe"
_ "github.com/gogo/protobuf/types"
regexp "regexp"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _regex_InstanceID_XObjectId = regexp.MustCompile(`.*`)
var _regex_InstanceID_InstanceId = regexp.MustCompile(`.*`)
func (this *InstanceID) Validate() error {
if !_regex_InstanceID_XObjectId.MatchString(this.XObjectId) {
return github_com_mwitkow_go_proto_validators.FieldError("XObjectId", fmt.Errorf(`value '%v' must be a string conforming to regex ".*"`, this.XObjectId))
}
if !_regex_InstanceID_InstanceId.MatchString(this.InstanceId) {
return github_com_mwitkow_go_proto_validators.FieldError("InstanceId", fmt.Errorf(`value '%v' must be a string conforming to regex ".*"`, this.InstanceId))
}
return nil
}
var _regex_Instance_ObjectId = regexp.MustCompile(`.*`)
func (this *Instance) Validate() error {
if !_regex_Instance_ObjectId.MatchString(this.ObjectId) {
return github_com_mwitkow_go_proto_validators.FieldError("ObjectId", fmt.Errorf(`value '%v' must be a string conforming to regex ".*"`, this.ObjectId))
}
if nil == this.Data {
return github_com_mwitkow_go_proto_validators.FieldError("Data", fmt.Errorf("message must exist"))
}
if this.Data != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
return nil
}
func (this *SkipLimit) Validate() error {
if !(this.Skip > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Skip", fmt.Errorf(`value '%v' must be greater than '0'`, this.Skip))
}
if !(this.Skip < 3000) {
return github_com_mwitkow_go_proto_validators.FieldError("Skip", fmt.Errorf(`value '%v' must be less than '3000'`, this.Skip))
}
if !(this.Limit > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Limit", fmt.Errorf(`value '%v' must be greater than '0'`, this.Limit))
}
if !(this.Limit < 100) {
return github_com_mwitkow_go_proto_validators.FieldError("Limit", fmt.Errorf(`value '%v' must be less than '100'`, this.Limit))
}
return nil
}
func (this *Count) Validate() error {
return nil
}