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