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