github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/extensions/cache/simple_http_cache/v3alpha/config.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/extensions/cache/simple_http_cache/v3alpha/config.proto 3 4 package envoy_extensions_cache_simple_http_cache_v3alpha 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 SimpleHttpCacheConfig with the rules 37 // defined in the proto definition for this message. If any rules are 38 // violated, an error is returned. 39 func (m *SimpleHttpCacheConfig) Validate() error { 40 if m == nil { 41 return nil 42 } 43 44 return nil 45 } 46 47 // SimpleHttpCacheConfigValidationError is the validation error returned by 48 // SimpleHttpCacheConfig.Validate if the designated constraints aren't met. 49 type SimpleHttpCacheConfigValidationError struct { 50 field string 51 reason string 52 cause error 53 key bool 54 } 55 56 // Field function returns field value. 57 func (e SimpleHttpCacheConfigValidationError) Field() string { return e.field } 58 59 // Reason function returns reason value. 60 func (e SimpleHttpCacheConfigValidationError) Reason() string { return e.reason } 61 62 // Cause function returns cause value. 63 func (e SimpleHttpCacheConfigValidationError) Cause() error { return e.cause } 64 65 // Key function returns key value. 66 func (e SimpleHttpCacheConfigValidationError) Key() bool { return e.key } 67 68 // ErrorName returns error name. 69 func (e SimpleHttpCacheConfigValidationError) ErrorName() string { 70 return "SimpleHttpCacheConfigValidationError" 71 } 72 73 // Error satisfies the builtin error interface 74 func (e SimpleHttpCacheConfigValidationError) Error() string { 75 cause := "" 76 if e.cause != nil { 77 cause = fmt.Sprintf(" | caused by: %v", e.cause) 78 } 79 80 key := "" 81 if e.key { 82 key = "key for " 83 } 84 85 return fmt.Sprintf( 86 "invalid %sSimpleHttpCacheConfig.%s: %s%s", 87 key, 88 e.field, 89 e.reason, 90 cause) 91 } 92 93 var _ error = SimpleHttpCacheConfigValidationError{} 94 95 var _ interface { 96 Field() string 97 Reason() string 98 Key() bool 99 Cause() error 100 ErrorName() string 101 } = SimpleHttpCacheConfigValidationError{}