This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.validator.pb.go
106 lines (100 loc) · 4 KB
/
schema.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: schema.proto
package eventgate
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "github.com/golang/protobuf/ptypes/struct"
_ "github.com/golang/protobuf/ptypes/timestamp"
_ "github.com/golang/protobuf/ptypes/any"
_ "github.com/golang/protobuf/ptypes/empty"
_ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/genproto/googleapis/api/annotations"
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
func (this *ObjectRef) Validate() error {
if this.Type == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Type", fmt.Errorf(`value '%v' must not be an empty string`, this.Type))
}
if this.Key == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Key", fmt.Errorf(`value '%v' must not be an empty string`, this.Key))
}
return nil
}
func (this *Object) Validate() error {
if this.Type == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Type", fmt.Errorf(`value '%v' must not be an empty string`, this.Type))
}
if this.Key == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Key", fmt.Errorf(`value '%v' must not be an empty string`, this.Key))
}
if nil == this.Values {
return github_com_mwitkow_go_proto_validators.FieldError("Values", fmt.Errorf("message must exist"))
}
if this.Values != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Values); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Values", err)
}
}
return nil
}
func (this *SearchOpts) Validate() error {
if this.Type == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Type", fmt.Errorf(`value '%v' must not be an empty string`, this.Type))
}
if this.Key == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Key", fmt.Errorf(`value '%v' must not be an empty string`, this.Key))
}
if !(this.Limit > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Limit", fmt.Errorf(`value '%v' must be greater than '0'`, this.Limit))
}
return nil
}
func (this *StreamOpts) Validate() error {
if this.Type == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Type", fmt.Errorf(`value '%v' must not be an empty string`, this.Type))
}
return nil
}
var _regex_Event_Id = regexp.MustCompile(`^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12})?$`)
func (this *Event) Validate() error {
if !_regex_Event_Id.MatchString(this.Id) {
return github_com_mwitkow_go_proto_validators.FieldError("Id", fmt.Errorf(`value '%v' must be a string conforming to regex "^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12})?$"`, this.Id))
}
if nil == this.Object {
return github_com_mwitkow_go_proto_validators.FieldError("Object", fmt.Errorf("message must exist"))
}
if this.Object != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Object); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Object", err)
}
}
if nil == this.Claims {
return github_com_mwitkow_go_proto_validators.FieldError("Claims", fmt.Errorf("message must exist"))
}
if this.Claims != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Claims); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Claims", err)
}
}
if !(this.Time > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Time", fmt.Errorf(`value '%v' must be greater than '0'`, this.Time))
}
return nil
}
func (this *Events) Validate() error {
for _, item := range this.Events {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Events", err)
}
}
}
return nil
}