1// Code generated by protoc-gen-validate. DO NOT EDIT. 2// source: envoy/api/v2/lds.proto 3 4package envoy_api_v2 5 6import ( 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 "github.com/golang/protobuf/ptypes" 19) 20 21// ensure the imports are used 22var ( 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 _ = ptypes.DynamicAny{} 34) 35 36// define the regex for a UUID once up-front 37var _lds_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") 38 39// Validate checks the field values on LdsDummy with the rules defined in the 40// proto definition for this message. If any rules are violated, an error is returned. 41func (m *LdsDummy) Validate() error { 42 if m == nil { 43 return nil 44 } 45 46 return nil 47} 48 49// LdsDummyValidationError is the validation error returned by 50// LdsDummy.Validate if the designated constraints aren't met. 51type LdsDummyValidationError struct { 52 field string 53 reason string 54 cause error 55 key bool 56} 57 58// Field function returns field value. 59func (e LdsDummyValidationError) Field() string { return e.field } 60 61// Reason function returns reason value. 62func (e LdsDummyValidationError) Reason() string { return e.reason } 63 64// Cause function returns cause value. 65func (e LdsDummyValidationError) Cause() error { return e.cause } 66 67// Key function returns key value. 68func (e LdsDummyValidationError) Key() bool { return e.key } 69 70// ErrorName returns error name. 71func (e LdsDummyValidationError) ErrorName() string { return "LdsDummyValidationError" } 72 73// Error satisfies the builtin error interface 74func (e LdsDummyValidationError) Error() string { 75 cause := "" 76 if e.cause != nil { 77 cause = fmt.Sprintf(" | caused by: %v", e.cause) 78 } 79 80 key := "" 81 if e.key { 82 key = "key for " 83 } 84 85 return fmt.Sprintf( 86 "invalid %sLdsDummy.%s: %s%s", 87 key, 88 e.field, 89 e.reason, 90 cause) 91} 92 93var _ error = LdsDummyValidationError{} 94 95var _ interface { 96 Field() string 97 Reason() string 98 Key() bool 99 Cause() error 100 ErrorName() string 101} = LdsDummyValidationError{} 102