github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/extensions/transport_sockets/quic/v3/quic_transport.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/extensions/transport_sockets/quic/v3/quic_transport.proto 3 4 package envoy_extensions_transport_sockets_quic_v3 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 QuicDownstreamTransport 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 *QuicDownstreamTransport) Validate() error { 40 if m == nil { 41 return nil 42 } 43 44 if m.GetDownstreamTlsContext() == nil { 45 return QuicDownstreamTransportValidationError{ 46 field: "DownstreamTlsContext", 47 reason: "value is required", 48 } 49 } 50 51 if v, ok := interface{}(m.GetDownstreamTlsContext()).(interface{ Validate() error }); ok { 52 if err := v.Validate(); err != nil { 53 return QuicDownstreamTransportValidationError{ 54 field: "DownstreamTlsContext", 55 reason: "embedded message failed validation", 56 cause: err, 57 } 58 } 59 } 60 61 return nil 62 } 63 64 // QuicDownstreamTransportValidationError is the validation error returned by 65 // QuicDownstreamTransport.Validate if the designated constraints aren't met. 66 type QuicDownstreamTransportValidationError struct { 67 field string 68 reason string 69 cause error 70 key bool 71 } 72 73 // Field function returns field value. 74 func (e QuicDownstreamTransportValidationError) Field() string { return e.field } 75 76 // Reason function returns reason value. 77 func (e QuicDownstreamTransportValidationError) Reason() string { return e.reason } 78 79 // Cause function returns cause value. 80 func (e QuicDownstreamTransportValidationError) Cause() error { return e.cause } 81 82 // Key function returns key value. 83 func (e QuicDownstreamTransportValidationError) Key() bool { return e.key } 84 85 // ErrorName returns error name. 86 func (e QuicDownstreamTransportValidationError) ErrorName() string { 87 return "QuicDownstreamTransportValidationError" 88 } 89 90 // Error satisfies the builtin error interface 91 func (e QuicDownstreamTransportValidationError) Error() string { 92 cause := "" 93 if e.cause != nil { 94 cause = fmt.Sprintf(" | caused by: %v", e.cause) 95 } 96 97 key := "" 98 if e.key { 99 key = "key for " 100 } 101 102 return fmt.Sprintf( 103 "invalid %sQuicDownstreamTransport.%s: %s%s", 104 key, 105 e.field, 106 e.reason, 107 cause) 108 } 109 110 var _ error = QuicDownstreamTransportValidationError{} 111 112 var _ interface { 113 Field() string 114 Reason() string 115 Key() bool 116 Cause() error 117 ErrorName() string 118 } = QuicDownstreamTransportValidationError{} 119 120 // Validate checks the field values on QuicUpstreamTransport with the rules 121 // defined in the proto definition for this message. If any rules are 122 // violated, an error is returned. 123 func (m *QuicUpstreamTransport) Validate() error { 124 if m == nil { 125 return nil 126 } 127 128 if m.GetUpstreamTlsContext() == nil { 129 return QuicUpstreamTransportValidationError{ 130 field: "UpstreamTlsContext", 131 reason: "value is required", 132 } 133 } 134 135 if v, ok := interface{}(m.GetUpstreamTlsContext()).(interface{ Validate() error }); ok { 136 if err := v.Validate(); err != nil { 137 return QuicUpstreamTransportValidationError{ 138 field: "UpstreamTlsContext", 139 reason: "embedded message failed validation", 140 cause: err, 141 } 142 } 143 } 144 145 return nil 146 } 147 148 // QuicUpstreamTransportValidationError is the validation error returned by 149 // QuicUpstreamTransport.Validate if the designated constraints aren't met. 150 type QuicUpstreamTransportValidationError struct { 151 field string 152 reason string 153 cause error 154 key bool 155 } 156 157 // Field function returns field value. 158 func (e QuicUpstreamTransportValidationError) Field() string { return e.field } 159 160 // Reason function returns reason value. 161 func (e QuicUpstreamTransportValidationError) Reason() string { return e.reason } 162 163 // Cause function returns cause value. 164 func (e QuicUpstreamTransportValidationError) Cause() error { return e.cause } 165 166 // Key function returns key value. 167 func (e QuicUpstreamTransportValidationError) Key() bool { return e.key } 168 169 // ErrorName returns error name. 170 func (e QuicUpstreamTransportValidationError) ErrorName() string { 171 return "QuicUpstreamTransportValidationError" 172 } 173 174 // Error satisfies the builtin error interface 175 func (e QuicUpstreamTransportValidationError) Error() string { 176 cause := "" 177 if e.cause != nil { 178 cause = fmt.Sprintf(" | caused by: %v", e.cause) 179 } 180 181 key := "" 182 if e.key { 183 key = "key for " 184 } 185 186 return fmt.Sprintf( 187 "invalid %sQuicUpstreamTransport.%s: %s%s", 188 key, 189 e.field, 190 e.reason, 191 cause) 192 } 193 194 var _ error = QuicUpstreamTransportValidationError{} 195 196 var _ interface { 197 Field() string 198 Reason() string 199 Key() bool 200 Cause() error 201 ErrorName() string 202 } = QuicUpstreamTransportValidationError{}