This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
/
docs.validator.pb.go
176 lines (161 loc) · 7.64 KB
/
docs.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: docs.proto
package documents
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
math "math"
regexp "regexp"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _regex_SignedEnvelope_SignerCID = regexp.MustCompile(`^Q[[:alnum:]]{45}$|^$`)
func (this *SignedEnvelope) Validate() error {
if !(len(this.Signature) > 20) {
return github_com_mwitkow_go_proto_validators.FieldError("Signature", fmt.Errorf(`value '%v' must have a length greater than '20'`, this.Signature))
}
if !_regex_SignedEnvelope_SignerCID.MatchString(this.SignerCID) {
return github_com_mwitkow_go_proto_validators.FieldError("SignerCID", fmt.Errorf(`value '%v' must be a string conforming to regex "^Q[[:alnum:]]{45}$|^$"`, this.SignerCID))
}
return nil
}
func (this *Envelope) Validate() error {
if this.Header != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Header); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Header", err)
}
}
return nil
}
func (this *Header) Validate() error {
if !(this.DateTime > 1564050341) {
return github_com_mwitkow_go_proto_validators.FieldError("DateTime", fmt.Errorf(`value '%v' must be greater than '1564050341'`, this.DateTime))
}
if !(this.DateTime < 32521429541) {
return github_com_mwitkow_go_proto_validators.FieldError("DateTime", fmt.Errorf(`value '%v' must be less than '32521429541'`, this.DateTime))
}
if len(this.Recipients) > 20 {
return github_com_mwitkow_go_proto_validators.FieldError("Recipients", fmt.Errorf(`value '%v' must contain at most 20 elements`, this.Recipients))
}
for _, item := range this.Recipients {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Recipients", err)
}
}
}
return nil
}
var _regex_Recipient_CID = regexp.MustCompile(`^Q[[:alnum:]]{45}$|^$`)
func (this *Recipient) Validate() error {
if !_regex_Recipient_CID.MatchString(this.CID) {
return github_com_mwitkow_go_proto_validators.FieldError("CID", fmt.Errorf(`value '%v' must be a string conforming to regex "^Q[[:alnum:]]{45}$|^$"`, this.CID))
}
return nil
}
func (this *IDDocument) Validate() error {
if !(this.Timestamp > 1564050341) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be greater than '1564050341'`, this.Timestamp))
}
if !(this.Timestamp < 32521429541) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be less than '32521429541'`, this.Timestamp))
}
return nil
}
var _regex_OrderDocument_PrincipalCID = regexp.MustCompile(`^Q[[:alnum:]]{45}$|^$`)
var _regex_OrderDocument_BeneficiaryCID = regexp.MustCompile(`^Q[[:alnum:]]{45}$|^$`)
func (this *OrderDocument) Validate() error {
if !(this.Coin > -1) {
return github_com_mwitkow_go_proto_validators.FieldError("Coin", fmt.Errorf(`value '%v' must be greater than '-1'`, this.Coin))
}
if !(this.Coin < 999) {
return github_com_mwitkow_go_proto_validators.FieldError("Coin", fmt.Errorf(`value '%v' must be less than '999'`, this.Coin))
}
if !_regex_OrderDocument_PrincipalCID.MatchString(this.PrincipalCID) {
return github_com_mwitkow_go_proto_validators.FieldError("PrincipalCID", fmt.Errorf(`value '%v' must be a string conforming to regex "^Q[[:alnum:]]{45}$|^$"`, this.PrincipalCID))
}
if !_regex_OrderDocument_BeneficiaryCID.MatchString(this.BeneficiaryCID) {
return github_com_mwitkow_go_proto_validators.FieldError("BeneficiaryCID", fmt.Errorf(`value '%v' must be a string conforming to regex "^Q[[:alnum:]]{45}$|^$"`, this.BeneficiaryCID))
}
if this.Reference == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Reference", fmt.Errorf(`value '%v' must not be an empty string`, this.Reference))
}
if !(this.Timestamp > 1564050341) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be greater than '1564050341'`, this.Timestamp))
}
if !(this.Timestamp < 32521429541) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be less than '32521429541'`, this.Timestamp))
}
if this.OrderPart2 != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.OrderPart2); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderPart2", err)
}
}
if this.OrderPart3 != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.OrderPart3); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderPart3", err)
}
}
if this.OrderPart4 != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.OrderPart4); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderPart4", err)
}
}
return nil
}
var _regex_OrderPart2_PreviousOrderCID = regexp.MustCompile(`^Q[[:alnum:]]{45}$|^$`)
func (this *OrderPart2) Validate() error {
if !_regex_OrderPart2_PreviousOrderCID.MatchString(this.PreviousOrderCID) {
return github_com_mwitkow_go_proto_validators.FieldError("PreviousOrderCID", fmt.Errorf(`value '%v' must be a string conforming to regex "^Q[[:alnum:]]{45}$|^$"`, this.PreviousOrderCID))
}
if !(this.Timestamp > 1564050341) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be greater than '1564050341'`, this.Timestamp))
}
if !(this.Timestamp < 32521429541) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be less than '32521429541'`, this.Timestamp))
}
return nil
}
var _regex_OrderPart3_PreviousOrderCID = regexp.MustCompile(`^Q[[:alnum:]]{45}$|^$`)
func (this *OrderPart3) Validate() error {
if !_regex_OrderPart3_PreviousOrderCID.MatchString(this.PreviousOrderCID) {
return github_com_mwitkow_go_proto_validators.FieldError("PreviousOrderCID", fmt.Errorf(`value '%v' must be a string conforming to regex "^Q[[:alnum:]]{45}$|^$"`, this.PreviousOrderCID))
}
if !(this.Timestamp > 1564050341) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be greater than '1564050341'`, this.Timestamp))
}
if !(this.Timestamp < 32521429541) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be less than '32521429541'`, this.Timestamp))
}
return nil
}
var _regex_OrderPart4_PreviousOrderCID = regexp.MustCompile(`^Q[[:alnum:]]{45}$|^$`)
func (this *OrderPart4) Validate() error {
if !_regex_OrderPart4_PreviousOrderCID.MatchString(this.PreviousOrderCID) {
return github_com_mwitkow_go_proto_validators.FieldError("PreviousOrderCID", fmt.Errorf(`value '%v' must be a string conforming to regex "^Q[[:alnum:]]{45}$|^$"`, this.PreviousOrderCID))
}
if !(this.Timestamp > 1564050341) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be greater than '1564050341'`, this.Timestamp))
}
if !(this.Timestamp < 32521429541) {
return github_com_mwitkow_go_proto_validators.FieldError("Timestamp", fmt.Errorf(`value '%v' must be less than '32521429541'`, this.Timestamp))
}
return nil
}
func (this *Policy) Validate() error {
return nil
}
func (this *PlainTestMessage1) Validate() error {
return nil
}
func (this *EncryptTestMessage1) Validate() error {
return nil
}
func (this *SimpleString) Validate() error {
return nil
}