github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/service/auth/v2/attribute_context.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/service/auth/v2/attribute_context.proto 3 4 package envoy_service_auth_v2 5 6 import ( 7 "bytes" 8 "errors" 9 "fmt" 10 "net" 11 "net/mail" 12 "net/url" 13 "regexp" 14 "strings" 15 "time" 16 "unicode/utf8" 17 18 "google.golang.org/protobuf/types/known/anypb" 19 ) 20 21 // ensure the imports are used 22 var ( 23 _ = bytes.MinRead 24 _ = errors.New("") 25 _ = fmt.Print 26 _ = utf8.UTFMax 27 _ = (*regexp.Regexp)(nil) 28 _ = (*strings.Reader)(nil) 29 _ = net.IPv4len 30 _ = time.Duration(0) 31 _ = (*url.URL)(nil) 32 _ = (*mail.Address)(nil) 33 _ = anypb.Any{} 34 ) 35 36 // Validate checks the field values on AttributeContext with the rules defined 37 // in the proto definition for this message. If any rules are violated, an 38 // error is returned. 39 func (m *AttributeContext) Validate() error { 40 if m == nil { 41 return nil 42 } 43 44 if v, ok := interface{}(m.GetSource()).(interface{ Validate() error }); ok { 45 if err := v.Validate(); err != nil { 46 return AttributeContextValidationError{ 47 field: "Source", 48 reason: "embedded message failed validation", 49 cause: err, 50 } 51 } 52 } 53 54 if v, ok := interface{}(m.GetDestination()).(interface{ Validate() error }); ok { 55 if err := v.Validate(); err != nil { 56 return AttributeContextValidationError{ 57 field: "Destination", 58 reason: "embedded message failed validation", 59 cause: err, 60 } 61 } 62 } 63 64 if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok { 65 if err := v.Validate(); err != nil { 66 return AttributeContextValidationError{ 67 field: "Request", 68 reason: "embedded message failed validation", 69 cause: err, 70 } 71 } 72 } 73 74 // no validation rules for ContextExtensions 75 76 if v, ok := interface{}(m.GetMetadataContext()).(interface{ Validate() error }); ok { 77 if err := v.Validate(); err != nil { 78 return AttributeContextValidationError{ 79 field: "MetadataContext", 80 reason: "embedded message failed validation", 81 cause: err, 82 } 83 } 84 } 85 86 return nil 87 } 88 89 // AttributeContextValidationError is the validation error returned by 90 // AttributeContext.Validate if the designated constraints aren't met. 91 type AttributeContextValidationError struct { 92 field string 93 reason string 94 cause error 95 key bool 96 } 97 98 // Field function returns field value. 99 func (e AttributeContextValidationError) Field() string { return e.field } 100 101 // Reason function returns reason value. 102 func (e AttributeContextValidationError) Reason() string { return e.reason } 103 104 // Cause function returns cause value. 105 func (e AttributeContextValidationError) Cause() error { return e.cause } 106 107 // Key function returns key value. 108 func (e AttributeContextValidationError) Key() bool { return e.key } 109 110 // ErrorName returns error name. 111 func (e AttributeContextValidationError) ErrorName() string { return "AttributeContextValidationError" } 112 113 // Error satisfies the builtin error interface 114 func (e AttributeContextValidationError) Error() string { 115 cause := "" 116 if e.cause != nil { 117 cause = fmt.Sprintf(" | caused by: %v", e.cause) 118 } 119 120 key := "" 121 if e.key { 122 key = "key for " 123 } 124 125 return fmt.Sprintf( 126 "invalid %sAttributeContext.%s: %s%s", 127 key, 128 e.field, 129 e.reason, 130 cause) 131 } 132 133 var _ error = AttributeContextValidationError{} 134 135 var _ interface { 136 Field() string 137 Reason() string 138 Key() bool 139 Cause() error 140 ErrorName() string 141 } = AttributeContextValidationError{} 142 143 // Validate checks the field values on AttributeContext_Peer with the rules 144 // defined in the proto definition for this message. If any rules are 145 // violated, an error is returned. 146 func (m *AttributeContext_Peer) Validate() error { 147 if m == nil { 148 return nil 149 } 150 151 if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok { 152 if err := v.Validate(); err != nil { 153 return AttributeContext_PeerValidationError{ 154 field: "Address", 155 reason: "embedded message failed validation", 156 cause: err, 157 } 158 } 159 } 160 161 // no validation rules for Service 162 163 // no validation rules for Labels 164 165 // no validation rules for Principal 166 167 // no validation rules for Certificate 168 169 return nil 170 } 171 172 // AttributeContext_PeerValidationError is the validation error returned by 173 // AttributeContext_Peer.Validate if the designated constraints aren't met. 174 type AttributeContext_PeerValidationError struct { 175 field string 176 reason string 177 cause error 178 key bool 179 } 180 181 // Field function returns field value. 182 func (e AttributeContext_PeerValidationError) Field() string { return e.field } 183 184 // Reason function returns reason value. 185 func (e AttributeContext_PeerValidationError) Reason() string { return e.reason } 186 187 // Cause function returns cause value. 188 func (e AttributeContext_PeerValidationError) Cause() error { return e.cause } 189 190 // Key function returns key value. 191 func (e AttributeContext_PeerValidationError) Key() bool { return e.key } 192 193 // ErrorName returns error name. 194 func (e AttributeContext_PeerValidationError) ErrorName() string { 195 return "AttributeContext_PeerValidationError" 196 } 197 198 // Error satisfies the builtin error interface 199 func (e AttributeContext_PeerValidationError) Error() string { 200 cause := "" 201 if e.cause != nil { 202 cause = fmt.Sprintf(" | caused by: %v", e.cause) 203 } 204 205 key := "" 206 if e.key { 207 key = "key for " 208 } 209 210 return fmt.Sprintf( 211 "invalid %sAttributeContext_Peer.%s: %s%s", 212 key, 213 e.field, 214 e.reason, 215 cause) 216 } 217 218 var _ error = AttributeContext_PeerValidationError{} 219 220 var _ interface { 221 Field() string 222 Reason() string 223 Key() bool 224 Cause() error 225 ErrorName() string 226 } = AttributeContext_PeerValidationError{} 227 228 // Validate checks the field values on AttributeContext_Request with the rules 229 // defined in the proto definition for this message. If any rules are 230 // violated, an error is returned. 231 func (m *AttributeContext_Request) Validate() error { 232 if m == nil { 233 return nil 234 } 235 236 if v, ok := interface{}(m.GetTime()).(interface{ Validate() error }); ok { 237 if err := v.Validate(); err != nil { 238 return AttributeContext_RequestValidationError{ 239 field: "Time", 240 reason: "embedded message failed validation", 241 cause: err, 242 } 243 } 244 } 245 246 if v, ok := interface{}(m.GetHttp()).(interface{ Validate() error }); ok { 247 if err := v.Validate(); err != nil { 248 return AttributeContext_RequestValidationError{ 249 field: "Http", 250 reason: "embedded message failed validation", 251 cause: err, 252 } 253 } 254 } 255 256 return nil 257 } 258 259 // AttributeContext_RequestValidationError is the validation error returned by 260 // AttributeContext_Request.Validate if the designated constraints aren't met. 261 type AttributeContext_RequestValidationError struct { 262 field string 263 reason string 264 cause error 265 key bool 266 } 267 268 // Field function returns field value. 269 func (e AttributeContext_RequestValidationError) Field() string { return e.field } 270 271 // Reason function returns reason value. 272 func (e AttributeContext_RequestValidationError) Reason() string { return e.reason } 273 274 // Cause function returns cause value. 275 func (e AttributeContext_RequestValidationError) Cause() error { return e.cause } 276 277 // Key function returns key value. 278 func (e AttributeContext_RequestValidationError) Key() bool { return e.key } 279 280 // ErrorName returns error name. 281 func (e AttributeContext_RequestValidationError) ErrorName() string { 282 return "AttributeContext_RequestValidationError" 283 } 284 285 // Error satisfies the builtin error interface 286 func (e AttributeContext_RequestValidationError) Error() string { 287 cause := "" 288 if e.cause != nil { 289 cause = fmt.Sprintf(" | caused by: %v", e.cause) 290 } 291 292 key := "" 293 if e.key { 294 key = "key for " 295 } 296 297 return fmt.Sprintf( 298 "invalid %sAttributeContext_Request.%s: %s%s", 299 key, 300 e.field, 301 e.reason, 302 cause) 303 } 304 305 var _ error = AttributeContext_RequestValidationError{} 306 307 var _ interface { 308 Field() string 309 Reason() string 310 Key() bool 311 Cause() error 312 ErrorName() string 313 } = AttributeContext_RequestValidationError{} 314 315 // Validate checks the field values on AttributeContext_HttpRequest with the 316 // rules defined in the proto definition for this message. If any rules are 317 // violated, an error is returned. 318 func (m *AttributeContext_HttpRequest) Validate() error { 319 if m == nil { 320 return nil 321 } 322 323 // no validation rules for Id 324 325 // no validation rules for Method 326 327 // no validation rules for Headers 328 329 // no validation rules for Path 330 331 // no validation rules for Host 332 333 // no validation rules for Scheme 334 335 // no validation rules for Query 336 337 // no validation rules for Fragment 338 339 // no validation rules for Size 340 341 // no validation rules for Protocol 342 343 // no validation rules for Body 344 345 return nil 346 } 347 348 // AttributeContext_HttpRequestValidationError is the validation error returned 349 // by AttributeContext_HttpRequest.Validate if the designated constraints 350 // aren't met. 351 type AttributeContext_HttpRequestValidationError struct { 352 field string 353 reason string 354 cause error 355 key bool 356 } 357 358 // Field function returns field value. 359 func (e AttributeContext_HttpRequestValidationError) Field() string { return e.field } 360 361 // Reason function returns reason value. 362 func (e AttributeContext_HttpRequestValidationError) Reason() string { return e.reason } 363 364 // Cause function returns cause value. 365 func (e AttributeContext_HttpRequestValidationError) Cause() error { return e.cause } 366 367 // Key function returns key value. 368 func (e AttributeContext_HttpRequestValidationError) Key() bool { return e.key } 369 370 // ErrorName returns error name. 371 func (e AttributeContext_HttpRequestValidationError) ErrorName() string { 372 return "AttributeContext_HttpRequestValidationError" 373 } 374 375 // Error satisfies the builtin error interface 376 func (e AttributeContext_HttpRequestValidationError) Error() string { 377 cause := "" 378 if e.cause != nil { 379 cause = fmt.Sprintf(" | caused by: %v", e.cause) 380 } 381 382 key := "" 383 if e.key { 384 key = "key for " 385 } 386 387 return fmt.Sprintf( 388 "invalid %sAttributeContext_HttpRequest.%s: %s%s", 389 key, 390 e.field, 391 e.reason, 392 cause) 393 } 394 395 var _ error = AttributeContext_HttpRequestValidationError{} 396 397 var _ interface { 398 Field() string 399 Reason() string 400 Key() bool 401 Cause() error 402 ErrorName() string 403 } = AttributeContext_HttpRequestValidationError{}