gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-control-plane/envoy/service/discovery/v2/rtds.pb.validate.go (about) 1 // Code generated by protoc-gen-validate. DO NOT EDIT. 2 // source: envoy/service/discovery/v2/rtds.proto 3 4 package envoy_service_discovery_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 RtdsDummy with the rules defined in the 37 // proto definition for this message. If any rules are violated, an error is returned. 38 func (m *RtdsDummy) Validate() error { 39 if m == nil { 40 return nil 41 } 42 43 return nil 44 } 45 46 // RtdsDummyValidationError is the validation error returned by 47 // RtdsDummy.Validate if the designated constraints aren't met. 48 type RtdsDummyValidationError struct { 49 field string 50 reason string 51 cause error 52 key bool 53 } 54 55 // Field function returns field value. 56 func (e RtdsDummyValidationError) Field() string { return e.field } 57 58 // Reason function returns reason value. 59 func (e RtdsDummyValidationError) Reason() string { return e.reason } 60 61 // Cause function returns cause value. 62 func (e RtdsDummyValidationError) Cause() error { return e.cause } 63 64 // Key function returns key value. 65 func (e RtdsDummyValidationError) Key() bool { return e.key } 66 67 // ErrorName returns error name. 68 func (e RtdsDummyValidationError) ErrorName() string { return "RtdsDummyValidationError" } 69 70 // Error satisfies the builtin error interface 71 func (e RtdsDummyValidationError) Error() string { 72 cause := "" 73 if e.cause != nil { 74 cause = fmt.Sprintf(" | caused by: %v", e.cause) 75 } 76 77 key := "" 78 if e.key { 79 key = "key for " 80 } 81 82 return fmt.Sprintf( 83 "invalid %sRtdsDummy.%s: %s%s", 84 key, 85 e.field, 86 e.reason, 87 cause) 88 } 89 90 var _ error = RtdsDummyValidationError{} 91 92 var _ interface { 93 Field() string 94 Reason() string 95 Key() bool 96 Cause() error 97 ErrorName() string 98 } = RtdsDummyValidationError{} 99 100 // Validate checks the field values on Runtime with the rules defined in the 101 // proto definition for this message. If any rules are violated, an error is returned. 102 func (m *Runtime) Validate() error { 103 if m == nil { 104 return nil 105 } 106 107 if len(m.GetName()) < 1 { 108 return RuntimeValidationError{ 109 field: "Name", 110 reason: "value length must be at least 1 bytes", 111 } 112 } 113 114 if v, ok := interface{}(m.GetLayer()).(interface{ Validate() error }); ok { 115 if err := v.Validate(); err != nil { 116 return RuntimeValidationError{ 117 field: "Layer", 118 reason: "embedded message failed validation", 119 cause: err, 120 } 121 } 122 } 123 124 return nil 125 } 126 127 // RuntimeValidationError is the validation error returned by Runtime.Validate 128 // if the designated constraints aren't met. 129 type RuntimeValidationError struct { 130 field string 131 reason string 132 cause error 133 key bool 134 } 135 136 // Field function returns field value. 137 func (e RuntimeValidationError) Field() string { return e.field } 138 139 // Reason function returns reason value. 140 func (e RuntimeValidationError) Reason() string { return e.reason } 141 142 // Cause function returns cause value. 143 func (e RuntimeValidationError) Cause() error { return e.cause } 144 145 // Key function returns key value. 146 func (e RuntimeValidationError) Key() bool { return e.key } 147 148 // ErrorName returns error name. 149 func (e RuntimeValidationError) ErrorName() string { return "RuntimeValidationError" } 150 151 // Error satisfies the builtin error interface 152 func (e RuntimeValidationError) Error() string { 153 cause := "" 154 if e.cause != nil { 155 cause = fmt.Sprintf(" | caused by: %v", e.cause) 156 } 157 158 key := "" 159 if e.key { 160 key = "key for " 161 } 162 163 return fmt.Sprintf( 164 "invalid %sRuntime.%s: %s%s", 165 key, 166 e.field, 167 e.reason, 168 cause) 169 } 170 171 var _ error = RuntimeValidationError{} 172 173 var _ interface { 174 Field() string 175 Reason() string 176 Key() bool 177 Cause() error 178 ErrorName() string 179 } = RuntimeValidationError{}