1// Code generated by protoc-gen-validate. DO NOT EDIT. 2// source: xds/core/v3/extension.proto 3 4package v3 5 6import ( 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 22var ( 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 TypedExtensionConfig with the rules 37// defined in the proto definition for this message. If any rules are 38// violated, an error is returned. 39func (m *TypedExtensionConfig) Validate() error { 40 if m == nil { 41 return nil 42 } 43 44 if utf8.RuneCountInString(m.GetName()) < 1 { 45 return TypedExtensionConfigValidationError{ 46 field: "Name", 47 reason: "value length must be at least 1 runes", 48 } 49 } 50 51 if m.GetTypedConfig() == nil { 52 return TypedExtensionConfigValidationError{ 53 field: "TypedConfig", 54 reason: "value is required", 55 } 56 } 57 58 if a := m.GetTypedConfig(); a != nil { 59 60 } 61 62 return nil 63} 64 65// TypedExtensionConfigValidationError is the validation error returned by 66// TypedExtensionConfig.Validate if the designated constraints aren't met. 67type TypedExtensionConfigValidationError struct { 68 field string 69 reason string 70 cause error 71 key bool 72} 73 74// Field function returns field value. 75func (e TypedExtensionConfigValidationError) Field() string { return e.field } 76 77// Reason function returns reason value. 78func (e TypedExtensionConfigValidationError) Reason() string { return e.reason } 79 80// Cause function returns cause value. 81func (e TypedExtensionConfigValidationError) Cause() error { return e.cause } 82 83// Key function returns key value. 84func (e TypedExtensionConfigValidationError) Key() bool { return e.key } 85 86// ErrorName returns error name. 87func (e TypedExtensionConfigValidationError) ErrorName() string { 88 return "TypedExtensionConfigValidationError" 89} 90 91// Error satisfies the builtin error interface 92func (e TypedExtensionConfigValidationError) Error() string { 93 cause := "" 94 if e.cause != nil { 95 cause = fmt.Sprintf(" | caused by: %v", e.cause) 96 } 97 98 key := "" 99 if e.key { 100 key = "key for " 101 } 102 103 return fmt.Sprintf( 104 "invalid %sTypedExtensionConfig.%s: %s%s", 105 key, 106 e.field, 107 e.reason, 108 cause) 109} 110 111var _ error = TypedExtensionConfigValidationError{} 112 113var _ interface { 114 Field() string 115 Reason() string 116 Key() bool 117 Cause() error 118 ErrorName() string 119} = TypedExtensionConfigValidationError{} 120