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