refactor: update go mod library (#210)

refactor: update go mod library and refactor dev logic

Co-authored-by: wencaiwulue <895703375@qq.com>
This commit is contained in:
naison
2024-04-04 12:04:02 +08:00
committed by GitHub
parent 91b3a2fbdf
commit 87166494c0
1336 changed files with 51428 additions and 57404 deletions

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: udpa/annotations/migrate.proto
package annotations
@@ -299,9 +299,10 @@ var file_udpa_annotations_migrate_proto_rawDesc = []byte{
0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x69, 0x6c,
0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x42,
0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61,
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,57 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on MigrateAnnotation with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *MigrateAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on MigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// MigrateAnnotationMultiError, or nil if none found.
func (m *MigrateAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *MigrateAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Rename
if len(errors) > 0 {
return MigrateAnnotationMultiError(errors)
}
return nil
}
// MigrateAnnotationMultiError is an error wrapping multiple validation errors
// returned by MigrateAnnotation.ValidateAll() if the designated constraints
// aren't met.
type MigrateAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m MigrateAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m MigrateAnnotationMultiError) AllErrors() []error { return m }
// MigrateAnnotationValidationError is the validation error returned by
// MigrateAnnotation.Validate if the designated constraints aren't met.
type MigrateAnnotationValidationError struct {
@@ -104,19 +141,54 @@ var _ interface {
// Validate checks the field values on FieldMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FieldMigrateAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FieldMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FieldMigrateAnnotationMultiError, or nil if none found.
func (m *FieldMigrateAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FieldMigrateAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Rename
// no validation rules for OneofPromotion
if len(errors) > 0 {
return FieldMigrateAnnotationMultiError(errors)
}
return nil
}
// FieldMigrateAnnotationMultiError is an error wrapping multiple validation
// errors returned by FieldMigrateAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FieldMigrateAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FieldMigrateAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FieldMigrateAnnotationMultiError) AllErrors() []error { return m }
// FieldMigrateAnnotationValidationError is the validation error returned by
// FieldMigrateAnnotation.Validate if the designated constraints aren't met.
type FieldMigrateAnnotationValidationError struct {
@@ -175,17 +247,52 @@ var _ interface {
// Validate checks the field values on FileMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FileMigrateAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FileMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FileMigrateAnnotationMultiError, or nil if none found.
func (m *FileMigrateAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FileMigrateAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for MoveToPackage
if len(errors) > 0 {
return FileMigrateAnnotationMultiError(errors)
}
return nil
}
// FileMigrateAnnotationMultiError is an error wrapping multiple validation
// errors returned by FileMigrateAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FileMigrateAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FileMigrateAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FileMigrateAnnotationMultiError) AllErrors() []error { return m }
// FileMigrateAnnotationValidationError is the validation error returned by
// FileMigrateAnnotation.Validate if the designated constraints aren't met.
type FileMigrateAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: udpa/annotations/security.proto
package annotations
@@ -121,10 +121,10 @@ var file_udpa_annotations_security_proto_rawDesc = []byte{
0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x69,
0x65, 0x6c, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x42,
0x2c, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x31, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x08, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67,
0x6f, 0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,23 +32,59 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on FieldSecurityAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FieldSecurityAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FieldSecurityAnnotation with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FieldSecurityAnnotationMultiError, or nil if none found.
func (m *FieldSecurityAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FieldSecurityAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for ConfigureForUntrustedDownstream
// no validation rules for ConfigureForUntrustedUpstream
if len(errors) > 0 {
return FieldSecurityAnnotationMultiError(errors)
}
return nil
}
// FieldSecurityAnnotationMultiError is an error wrapping multiple validation
// errors returned by FieldSecurityAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FieldSecurityAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FieldSecurityAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FieldSecurityAnnotationMultiError) AllErrors() []error { return m }
// FieldSecurityAnnotationValidationError is the validation error returned by
// FieldSecurityAnnotation.Validate if the designated constraints aren't met.
type FieldSecurityAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: udpa/annotations/sensitive.proto
package annotations
@@ -49,10 +49,10 @@ var file_udpa_annotations_sensitive_proto_rawDesc = []byte{
0x69, 0x76, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x18, 0xf7, 0xb6, 0xc1, 0x24, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e,
0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_udpa_annotations_sensitive_proto_goTypes = []interface{}{

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,4 +32,5 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: udpa/annotations/status.proto
package annotations
@@ -175,10 +175,10 @@ var file_udpa_annotations_status_proto_rawDesc = []byte{
0x6a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x64, 0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x41,
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f,
0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,23 +32,59 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on StatusAnnotation with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *StatusAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on StatusAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// StatusAnnotationMultiError, or nil if none found.
func (m *StatusAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *StatusAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for WorkInProgress
// no validation rules for PackageVersionStatus
if len(errors) > 0 {
return StatusAnnotationMultiError(errors)
}
return nil
}
// StatusAnnotationMultiError is an error wrapping multiple validation errors
// returned by StatusAnnotation.ValidateAll() if the designated constraints
// aren't met.
type StatusAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m StatusAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m StatusAnnotationMultiError) AllErrors() []error { return m }
// StatusAnnotationValidationError is the validation error returned by
// StatusAnnotation.Validate if the designated constraints aren't met.
type StatusAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: udpa/annotations/versioning.proto
package annotations
@@ -105,9 +105,10 @@ var file_udpa_annotations_versioning_proto_rawDesc = []byte{
0x70, 0x61, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x42,
0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61,
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,57 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on VersioningAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *VersioningAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on VersioningAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// VersioningAnnotationMultiError, or nil if none found.
func (m *VersioningAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *VersioningAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for PreviousMessageType
if len(errors) > 0 {
return VersioningAnnotationMultiError(errors)
}
return nil
}
// VersioningAnnotationMultiError is an error wrapping multiple validation
// errors returned by VersioningAnnotation.ValidateAll() if the designated
// constraints aren't met.
type VersioningAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m VersioningAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m VersioningAnnotationMultiError) AllErrors() []error { return m }
// VersioningAnnotationValidationError is the validation error returned by
// VersioningAnnotation.Validate if the designated constraints aren't met.
type VersioningAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/annotations/v3/migrate.proto
package v3

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,57 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on MigrateAnnotation with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *MigrateAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on MigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// MigrateAnnotationMultiError, or nil if none found.
func (m *MigrateAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *MigrateAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Rename
if len(errors) > 0 {
return MigrateAnnotationMultiError(errors)
}
return nil
}
// MigrateAnnotationMultiError is an error wrapping multiple validation errors
// returned by MigrateAnnotation.ValidateAll() if the designated constraints
// aren't met.
type MigrateAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m MigrateAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m MigrateAnnotationMultiError) AllErrors() []error { return m }
// MigrateAnnotationValidationError is the validation error returned by
// MigrateAnnotation.Validate if the designated constraints aren't met.
type MigrateAnnotationValidationError struct {
@@ -104,19 +141,54 @@ var _ interface {
// Validate checks the field values on FieldMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FieldMigrateAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FieldMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FieldMigrateAnnotationMultiError, or nil if none found.
func (m *FieldMigrateAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FieldMigrateAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Rename
// no validation rules for OneofPromotion
if len(errors) > 0 {
return FieldMigrateAnnotationMultiError(errors)
}
return nil
}
// FieldMigrateAnnotationMultiError is an error wrapping multiple validation
// errors returned by FieldMigrateAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FieldMigrateAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FieldMigrateAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FieldMigrateAnnotationMultiError) AllErrors() []error { return m }
// FieldMigrateAnnotationValidationError is the validation error returned by
// FieldMigrateAnnotation.Validate if the designated constraints aren't met.
type FieldMigrateAnnotationValidationError struct {
@@ -175,17 +247,52 @@ var _ interface {
// Validate checks the field values on FileMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FileMigrateAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FileMigrateAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FileMigrateAnnotationMultiError, or nil if none found.
func (m *FileMigrateAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FileMigrateAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for MoveToPackage
if len(errors) > 0 {
return FileMigrateAnnotationMultiError(errors)
}
return nil
}
// FileMigrateAnnotationMultiError is an error wrapping multiple validation
// errors returned by FileMigrateAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FileMigrateAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FileMigrateAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FileMigrateAnnotationMultiError) AllErrors() []error { return m }
// FileMigrateAnnotationValidationError is the validation error returned by
// FileMigrateAnnotation.Validate if the designated constraints aren't met.
type FileMigrateAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/annotations/v3/security.proto
package v3
@@ -121,10 +121,10 @@ var file_xds_annotations_v3_security_proto_rawDesc = []byte{
0x32, 0x2b, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72,
0x69, 0x74, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73,
0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x42, 0x33, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67,
0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72,
0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x42, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08,
0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,23 +32,59 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on FieldSecurityAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FieldSecurityAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FieldSecurityAnnotation with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FieldSecurityAnnotationMultiError, or nil if none found.
func (m *FieldSecurityAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FieldSecurityAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for ConfigureForUntrustedDownstream
// no validation rules for ConfigureForUntrustedUpstream
if len(errors) > 0 {
return FieldSecurityAnnotationMultiError(errors)
}
return nil
}
// FieldSecurityAnnotationMultiError is an error wrapping multiple validation
// errors returned by FieldSecurityAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FieldSecurityAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FieldSecurityAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FieldSecurityAnnotationMultiError) AllErrors() []error { return m }
// FieldSecurityAnnotationValidationError is the validation error returned by
// FieldSecurityAnnotation.Validate if the designated constraints aren't met.
type FieldSecurityAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/annotations/v3/sensitive.proto
package v3

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,4 +32,5 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/annotations/v3/status.proto
package v3

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,57 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on FileStatusAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FileStatusAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FileStatusAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FileStatusAnnotationMultiError, or nil if none found.
func (m *FileStatusAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FileStatusAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for WorkInProgress
if len(errors) > 0 {
return FileStatusAnnotationMultiError(errors)
}
return nil
}
// FileStatusAnnotationMultiError is an error wrapping multiple validation
// errors returned by FileStatusAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FileStatusAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FileStatusAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FileStatusAnnotationMultiError) AllErrors() []error { return m }
// FileStatusAnnotationValidationError is the validation error returned by
// FileStatusAnnotation.Validate if the designated constraints aren't met.
type FileStatusAnnotationValidationError struct {
@@ -104,17 +141,52 @@ var _ interface {
// Validate checks the field values on MessageStatusAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *MessageStatusAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on MessageStatusAnnotation with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// MessageStatusAnnotationMultiError, or nil if none found.
func (m *MessageStatusAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *MessageStatusAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for WorkInProgress
if len(errors) > 0 {
return MessageStatusAnnotationMultiError(errors)
}
return nil
}
// MessageStatusAnnotationMultiError is an error wrapping multiple validation
// errors returned by MessageStatusAnnotation.ValidateAll() if the designated
// constraints aren't met.
type MessageStatusAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m MessageStatusAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m MessageStatusAnnotationMultiError) AllErrors() []error { return m }
// MessageStatusAnnotationValidationError is the validation error returned by
// MessageStatusAnnotation.Validate if the designated constraints aren't met.
type MessageStatusAnnotationValidationError struct {
@@ -173,17 +245,52 @@ var _ interface {
// Validate checks the field values on FieldStatusAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *FieldStatusAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on FieldStatusAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// FieldStatusAnnotationMultiError, or nil if none found.
func (m *FieldStatusAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *FieldStatusAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for WorkInProgress
if len(errors) > 0 {
return FieldStatusAnnotationMultiError(errors)
}
return nil
}
// FieldStatusAnnotationMultiError is an error wrapping multiple validation
// errors returned by FieldStatusAnnotation.ValidateAll() if the designated
// constraints aren't met.
type FieldStatusAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m FieldStatusAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m FieldStatusAnnotationMultiError) AllErrors() []error { return m }
// FieldStatusAnnotationValidationError is the validation error returned by
// FieldStatusAnnotation.Validate if the designated constraints aren't met.
type FieldStatusAnnotationValidationError struct {
@@ -241,20 +348,55 @@ var _ interface {
} = FieldStatusAnnotationValidationError{}
// Validate checks the field values on StatusAnnotation with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *StatusAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on StatusAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// StatusAnnotationMultiError, or nil if none found.
func (m *StatusAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *StatusAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for WorkInProgress
// no validation rules for PackageVersionStatus
if len(errors) > 0 {
return StatusAnnotationMultiError(errors)
}
return nil
}
// StatusAnnotationMultiError is an error wrapping multiple validation errors
// returned by StatusAnnotation.ValidateAll() if the designated constraints
// aren't met.
type StatusAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m StatusAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m StatusAnnotationMultiError) AllErrors() []error { return m }
// StatusAnnotationValidationError is the validation error returned by
// StatusAnnotation.Validate if the designated constraints aren't met.
type StatusAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/annotations/v3/versioning.proto
package v3

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,57 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on VersioningAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *VersioningAnnotation) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on VersioningAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// VersioningAnnotationMultiError, or nil if none found.
func (m *VersioningAnnotation) ValidateAll() error {
return m.validate(true)
}
func (m *VersioningAnnotation) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for PreviousMessageType
if len(errors) > 0 {
return VersioningAnnotationMultiError(errors)
}
return nil
}
// VersioningAnnotationMultiError is an error wrapping multiple validation
// errors returned by VersioningAnnotation.ValidateAll() if the designated
// constraints aren't met.
type VersioningAnnotationMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m VersioningAnnotationMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m VersioningAnnotationMultiError) AllErrors() []error { return m }
// VersioningAnnotationValidationError is the validation error returned by
// VersioningAnnotation.Validate if the designated constraints aren't met.
type VersioningAnnotationValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/authority.proto
package v3
@@ -81,12 +81,12 @@ var file_xds_core_v3_authority_proto_rawDesc = []byte{
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74,
0x79, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x56,
0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73,
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f,
0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0xd2, 0xc6,
0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
0x42, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63,
0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63,
0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,25 +32,65 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on Authority with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Authority) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Authority with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AuthorityMultiError, or nil
// if none found.
func (m *Authority) ValidateAll() error {
return m.validate(true)
}
func (m *Authority) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetName()) < 1 {
return AuthorityValidationError{
err := AuthorityValidationError{
field: "Name",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return AuthorityMultiError(errors)
}
return nil
}
// AuthorityMultiError is an error wrapping multiple validation errors returned
// by Authority.ValidateAll() if the designated constraints aren't met.
type AuthorityMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m AuthorityMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m AuthorityMultiError) AllErrors() []error { return m }
// AuthorityValidationError is the validation error returned by
// Authority.Validate if the designated constraints aren't met.
type AuthorityValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/cidr.proto
package v3
@@ -9,9 +9,9 @@ package v3
import (
_ "github.com/cncf/xds/go/xds/annotations/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
reflect "reflect"
sync "sync"
)
@@ -28,8 +28,8 @@ type CidrRange struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AddressPrefix string `protobuf:"bytes,1,opt,name=address_prefix,json=addressPrefix,proto3" json:"address_prefix,omitempty"`
PrefixLen *wrappers.UInt32Value `protobuf:"bytes,2,opt,name=prefix_len,json=prefixLen,proto3" json:"prefix_len,omitempty"`
AddressPrefix string `protobuf:"bytes,1,opt,name=address_prefix,json=addressPrefix,proto3" json:"address_prefix,omitempty"`
PrefixLen *wrapperspb.UInt32Value `protobuf:"bytes,2,opt,name=prefix_len,json=prefixLen,proto3" json:"prefix_len,omitempty"`
}
func (x *CidrRange) Reset() {
@@ -71,7 +71,7 @@ func (x *CidrRange) GetAddressPrefix() string {
return ""
}
func (x *CidrRange) GetPrefixLen() *wrappers.UInt32Value {
func (x *CidrRange) GetPrefixLen() *wrapperspb.UInt32Value {
if x != nil {
return x.PrefixLen
}
@@ -97,12 +97,12 @@ var file_xds_core_v3_cidr_proto_rawDesc = []byte{
0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42,
0x08, 0xfa, 0x42, 0x05, 0x2a, 0x03, 0x18, 0x80, 0x01, 0x52, 0x09, 0x70, 0x72, 0x65, 0x66, 0x69,
0x78, 0x4c, 0x65, 0x6e, 0x42, 0x56, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x0e,
0x43, 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63,
0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72,
0x65, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72,
0x78, 0x4c, 0x65, 0x6e, 0x42, 0x56, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16,
0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63,
0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x43, 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67,
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
@@ -120,8 +120,8 @@ func file_xds_core_v3_cidr_proto_rawDescGZIP() []byte {
var file_xds_core_v3_cidr_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_xds_core_v3_cidr_proto_goTypes = []interface{}{
(*CidrRange)(nil), // 0: xds.core.v3.CidrRange
(*wrappers.UInt32Value)(nil), // 1: google.protobuf.UInt32Value
(*CidrRange)(nil), // 0: xds.core.v3.CidrRange
(*wrapperspb.UInt32Value)(nil), // 1: google.protobuf.UInt32Value
}
var file_xds_core_v3_cidr_proto_depIdxs = []int32{
1, // 0: xds.core.v3.CidrRange.prefix_len:type_name -> google.protobuf.UInt32Value

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,36 +32,80 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on CidrRange with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *CidrRange) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CidrRange with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in CidrRangeMultiError, or nil
// if none found.
func (m *CidrRange) ValidateAll() error {
return m.validate(true)
}
func (m *CidrRange) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetAddressPrefix()) < 1 {
return CidrRangeValidationError{
err := CidrRangeValidationError{
field: "AddressPrefix",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if wrapper := m.GetPrefixLen(); wrapper != nil {
if wrapper.GetValue() > 128 {
return CidrRangeValidationError{
err := CidrRangeValidationError{
field: "PrefixLen",
reason: "value must be less than or equal to 128",
}
if !all {
return err
}
errors = append(errors, err)
}
}
if len(errors) > 0 {
return CidrRangeMultiError(errors)
}
return nil
}
// CidrRangeMultiError is an error wrapping multiple validation errors returned
// by CidrRange.ValidateAll() if the designated constraints aren't met.
type CidrRangeMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CidrRangeMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CidrRangeMultiError) AllErrors() []error { return m }
// CidrRangeValidationError is the validation error returned by
// CidrRange.Validate if the designated constraints aren't met.
type CidrRangeValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/collection_entry.proto
package v3
@@ -9,9 +9,9 @@ package v3
import (
_ "github.com/cncf/xds/go/xds/annotations/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
any1 "github.com/golang/protobuf/ptypes/any"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
sync "sync"
)
@@ -109,9 +109,9 @@ type CollectionEntry_InlineEntry struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
Resource *any1.Any `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
Resource *anypb.Any `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
}
func (x *CollectionEntry_InlineEntry) Reset() {
@@ -160,7 +160,7 @@ func (x *CollectionEntry_InlineEntry) GetVersion() string {
return ""
}
func (x *CollectionEntry_InlineEntry) GetResource() *any1.Any {
func (x *CollectionEntry_InlineEntry) GetResource() *anypb.Any {
if x != nil {
return x.Resource
}
@@ -201,12 +201,12 @@ var file_xds_core_v3_collection_entry_proto_rawDesc = []byte{
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x19, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01,
0x42, 0x5c, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78,
0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x14, 0x43, 0x6f, 0x6c, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63,
0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63,
0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06,
0x42, 0x5c, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x76, 0x33, 0x42, 0x14, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f,
0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
@@ -227,7 +227,7 @@ var file_xds_core_v3_collection_entry_proto_goTypes = []interface{}{
(*CollectionEntry)(nil), // 0: xds.core.v3.CollectionEntry
(*CollectionEntry_InlineEntry)(nil), // 1: xds.core.v3.CollectionEntry.InlineEntry
(*ResourceLocator)(nil), // 2: xds.core.v3.ResourceLocator
(*any1.Any)(nil), // 3: google.protobuf.Any
(*anypb.Any)(nil), // 3: google.protobuf.Any
}
var file_xds_core_v3_collection_entry_proto_depIdxs = []int32{
2, // 0: xds.core.v3.CollectionEntry.locator:type_name -> xds.core.v3.ResourceLocator

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,66 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on CollectionEntry with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *CollectionEntry) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CollectionEntry with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CollectionEntryMultiError, or nil if none found.
func (m *CollectionEntry) ValidateAll() error {
return m.validate(true)
}
func (m *CollectionEntry) validate(all bool) error {
if m == nil {
return nil
}
switch m.ResourceSpecifier.(type) {
var errors []error
oneofResourceSpecifierPresent := false
switch v := m.ResourceSpecifier.(type) {
case *CollectionEntry_Locator:
if v == nil {
err := CollectionEntryValidationError{
field: "ResourceSpecifier",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofResourceSpecifierPresent = true
if v, ok := interface{}(m.GetLocator()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetLocator()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CollectionEntryValidationError{
field: "Locator",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CollectionEntryValidationError{
field: "Locator",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetLocator()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CollectionEntryValidationError{
field: "Locator",
@@ -56,8 +102,38 @@ func (m *CollectionEntry) Validate() error {
}
case *CollectionEntry_InlineEntry_:
if v == nil {
err := CollectionEntryValidationError{
field: "ResourceSpecifier",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofResourceSpecifierPresent = true
if v, ok := interface{}(m.GetInlineEntry()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetInlineEntry()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CollectionEntryValidationError{
field: "InlineEntry",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CollectionEntryValidationError{
field: "InlineEntry",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetInlineEntry()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CollectionEntryValidationError{
field: "InlineEntry",
@@ -68,16 +144,43 @@ func (m *CollectionEntry) Validate() error {
}
default:
return CollectionEntryValidationError{
_ = v // ensures v is used
}
if !oneofResourceSpecifierPresent {
err := CollectionEntryValidationError{
field: "ResourceSpecifier",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CollectionEntryMultiError(errors)
}
return nil
}
// CollectionEntryMultiError is an error wrapping multiple validation errors
// returned by CollectionEntry.ValidateAll() if the designated constraints
// aren't met.
type CollectionEntryMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CollectionEntryMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CollectionEntryMultiError) AllErrors() []error { return m }
// CollectionEntryValidationError is the validation error returned by
// CollectionEntry.Validate if the designated constraints aren't met.
type CollectionEntryValidationError struct {
@@ -134,22 +237,59 @@ var _ interface {
// Validate checks the field values on CollectionEntry_InlineEntry with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *CollectionEntry_InlineEntry) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CollectionEntry_InlineEntry with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CollectionEntry_InlineEntryMultiError, or nil if none found.
func (m *CollectionEntry_InlineEntry) ValidateAll() error {
return m.validate(true)
}
func (m *CollectionEntry_InlineEntry) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if !_CollectionEntry_InlineEntry_Name_Pattern.MatchString(m.GetName()) {
return CollectionEntry_InlineEntryValidationError{
err := CollectionEntry_InlineEntryValidationError{
field: "Name",
reason: "value does not match regex pattern \"^[0-9a-zA-Z_\\\\-\\\\.~:]+$\"",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Version
if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetResource()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CollectionEntry_InlineEntryValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CollectionEntry_InlineEntryValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CollectionEntry_InlineEntryValidationError{
field: "Resource",
@@ -159,9 +299,30 @@ func (m *CollectionEntry_InlineEntry) Validate() error {
}
}
if len(errors) > 0 {
return CollectionEntry_InlineEntryMultiError(errors)
}
return nil
}
// CollectionEntry_InlineEntryMultiError is an error wrapping multiple
// validation errors returned by CollectionEntry_InlineEntry.ValidateAll() if
// the designated constraints aren't met.
type CollectionEntry_InlineEntryMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CollectionEntry_InlineEntryMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CollectionEntry_InlineEntryMultiError) AllErrors() []error { return m }
// CollectionEntry_InlineEntryValidationError is the validation error returned
// by CollectionEntry_InlineEntry.Validate if the designated constraints
// aren't met.

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/context_params.proto
package v3
@@ -84,13 +84,13 @@ var file_xds_core_v3_context_params_proto_rawDesc = []byte{
0x6d, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x5a, 0x0a,
0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x12, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78,
0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76,
0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x5a, 0xd2,
0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42,
0x12, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72,
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64,
0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,57 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on ContextParams with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *ContextParams) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ContextParams with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in ContextParamsMultiError, or
// nil if none found.
func (m *ContextParams) ValidateAll() error {
return m.validate(true)
}
func (m *ContextParams) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Params
if len(errors) > 0 {
return ContextParamsMultiError(errors)
}
return nil
}
// ContextParamsMultiError is an error wrapping multiple validation errors
// returned by ContextParams.ValidateAll() if the designated constraints
// aren't met.
type ContextParamsMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ContextParamsMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ContextParamsMultiError) AllErrors() []error { return m }
// ContextParamsValidationError is the validation error returned by
// ContextParams.Validate if the designated constraints aren't met.
type ContextParamsValidationError struct {

View File

@@ -1,16 +1,16 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/extension.proto
package v3
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
any1 "github.com/golang/protobuf/ptypes/any"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
sync "sync"
)
@@ -27,8 +27,8 @@ type TypedExtensionConfig struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
TypedConfig *any1.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
TypedConfig *anypb.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"`
}
func (x *TypedExtensionConfig) Reset() {
@@ -70,7 +70,7 @@ func (x *TypedExtensionConfig) GetName() string {
return ""
}
func (x *TypedExtensionConfig) GetTypedConfig() *any1.Any {
func (x *TypedExtensionConfig) GetTypedConfig() *anypb.Any {
if x != nil {
return x.TypedConfig
}
@@ -116,7 +116,7 @@ func file_xds_core_v3_extension_proto_rawDescGZIP() []byte {
var file_xds_core_v3_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_xds_core_v3_extension_proto_goTypes = []interface{}{
(*TypedExtensionConfig)(nil), // 0: xds.core.v3.TypedExtensionConfig
(*any1.Any)(nil), // 1: google.protobuf.Any
(*anypb.Any)(nil), // 1: google.protobuf.Any
}
var file_xds_core_v3_extension_proto_depIdxs = []int32{
1, // 0: xds.core.v3.TypedExtensionConfig.typed_config:type_name -> google.protobuf.Any

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,37 +32,81 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on TypedExtensionConfig with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *TypedExtensionConfig) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on TypedExtensionConfig with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// TypedExtensionConfigMultiError, or nil if none found.
func (m *TypedExtensionConfig) ValidateAll() error {
return m.validate(true)
}
func (m *TypedExtensionConfig) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetName()) < 1 {
return TypedExtensionConfigValidationError{
err := TypedExtensionConfigValidationError{
field: "Name",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetTypedConfig() == nil {
return TypedExtensionConfigValidationError{
err := TypedExtensionConfigValidationError{
field: "TypedConfig",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if a := m.GetTypedConfig(); a != nil {
}
if len(errors) > 0 {
return TypedExtensionConfigMultiError(errors)
}
return nil
}
// TypedExtensionConfigMultiError is an error wrapping multiple validation
// errors returned by TypedExtensionConfig.ValidateAll() if the designated
// constraints aren't met.
type TypedExtensionConfigMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m TypedExtensionConfigMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m TypedExtensionConfigMultiError) AllErrors() []error { return m }
// TypedExtensionConfigValidationError is the validation error returned by
// TypedExtensionConfig.Validate if the designated constraints aren't met.
type TypedExtensionConfigValidationError struct {

View File

@@ -1,16 +1,16 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/resource.proto
package v3
import (
_ "github.com/cncf/xds/go/xds/annotations/v3"
any1 "github.com/golang/protobuf/ptypes/any"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
sync "sync"
)
@@ -29,7 +29,7 @@ type Resource struct {
Name *ResourceName `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
Resource *any1.Any `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
Resource *anypb.Any `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
}
func (x *Resource) Reset() {
@@ -78,7 +78,7 @@ func (x *Resource) GetVersion() string {
return ""
}
func (x *Resource) GetResource() *any1.Any {
func (x *Resource) GetResource() *anypb.Any {
if x != nil {
return x.Resource
}
@@ -105,12 +105,12 @@ var file_xds_core_v3_resource_proto_rawDesc = []byte{
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x55,
0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73,
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67,
0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4,
0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f,
0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -129,7 +129,7 @@ var file_xds_core_v3_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_xds_core_v3_resource_proto_goTypes = []interface{}{
(*Resource)(nil), // 0: xds.core.v3.Resource
(*ResourceName)(nil), // 1: xds.core.v3.ResourceName
(*any1.Any)(nil), // 2: google.protobuf.Any
(*anypb.Any)(nil), // 2: google.protobuf.Any
}
var file_xds_core_v3_resource_proto_depIdxs = []int32{
1, // 0: xds.core.v3.Resource.name:type_name -> xds.core.v3.ResourceName

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,16 +32,51 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on Resource with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Resource) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Resource with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in ResourceMultiError, or nil
// if none found.
func (m *Resource) ValidateAll() error {
return m.validate(true)
}
func (m *Resource) validate(all bool) error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetName()).(interface{ Validate() error }); ok {
var errors []error
if all {
switch v := interface{}(m.GetName()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ResourceValidationError{
field: "Name",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ResourceValidationError{
field: "Name",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetName()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceValidationError{
field: "Name",
@@ -52,7 +88,26 @@ func (m *Resource) Validate() error {
// no validation rules for Version
if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetResource()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ResourceValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ResourceValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceValidationError{
field: "Resource",
@@ -62,9 +117,29 @@ func (m *Resource) Validate() error {
}
}
if len(errors) > 0 {
return ResourceMultiError(errors)
}
return nil
}
// ResourceMultiError is an error wrapping multiple validation errors returned
// by Resource.ValidateAll() if the designated constraints aren't met.
type ResourceMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ResourceMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ResourceMultiError) AllErrors() []error { return m }
// ResourceValidationError is the validation error returned by
// Resource.Validate if the designated constraints aren't met.
type ResourceValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/resource_locator.proto
package v3
@@ -304,12 +304,12 @@ var file_xds_core_v3_resource_locator_proto_rawDesc = []byte{
0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x49, 0x4c,
0x45, 0x10, 0x02, 0x42, 0x19, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x42, 0x5c,
0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73,
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63,
0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72,
0x65, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72,
0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f,
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,40 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on ResourceLocator with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *ResourceLocator) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ResourceLocator with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ResourceLocatorMultiError, or nil if none found.
func (m *ResourceLocator) ValidateAll() error {
return m.validate(true)
}
func (m *ResourceLocator) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if _, ok := ResourceLocator_Scheme_name[int32(m.GetScheme())]; !ok {
return ResourceLocatorValidationError{
err := ResourceLocatorValidationError{
field: "Scheme",
reason: "value must be one of the defined enum values",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Id
@@ -53,16 +73,39 @@ func (m *ResourceLocator) Validate() error {
// no validation rules for Authority
if utf8.RuneCountInString(m.GetResourceType()) < 1 {
return ResourceLocatorValidationError{
err := ResourceLocatorValidationError{
field: "ResourceType",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
for idx, item := range m.GetDirectives() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ResourceLocatorValidationError{
field: fmt.Sprintf("Directives[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ResourceLocatorValidationError{
field: fmt.Sprintf("Directives[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceLocatorValidationError{
field: fmt.Sprintf("Directives[%v]", idx),
@@ -74,11 +117,39 @@ func (m *ResourceLocator) Validate() error {
}
switch m.ContextParamSpecifier.(type) {
switch v := m.ContextParamSpecifier.(type) {
case *ResourceLocator_ExactContext:
if v == nil {
err := ResourceLocatorValidationError{
field: "ContextParamSpecifier",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetExactContext()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetExactContext()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ResourceLocatorValidationError{
field: "ExactContext",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ResourceLocatorValidationError{
field: "ExactContext",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetExactContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceLocatorValidationError{
field: "ExactContext",
@@ -88,11 +159,34 @@ func (m *ResourceLocator) Validate() error {
}
}
default:
_ = v // ensures v is used
}
if len(errors) > 0 {
return ResourceLocatorMultiError(errors)
}
return nil
}
// ResourceLocatorMultiError is an error wrapping multiple validation errors
// returned by ResourceLocator.ValidateAll() if the designated constraints
// aren't met.
type ResourceLocatorMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ResourceLocatorMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ResourceLocatorMultiError) AllErrors() []error { return m }
// ResourceLocatorValidationError is the validation error returned by
// ResourceLocator.Validate if the designated constraints aren't met.
type ResourceLocatorValidationError struct {
@@ -149,17 +243,61 @@ var _ interface {
// Validate checks the field values on ResourceLocator_Directive with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *ResourceLocator_Directive) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ResourceLocator_Directive with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ResourceLocator_DirectiveMultiError, or nil if none found.
func (m *ResourceLocator_Directive) ValidateAll() error {
return m.validate(true)
}
func (m *ResourceLocator_Directive) validate(all bool) error {
if m == nil {
return nil
}
switch m.Directive.(type) {
var errors []error
oneofDirectivePresent := false
switch v := m.Directive.(type) {
case *ResourceLocator_Directive_Alt:
if v == nil {
err := ResourceLocator_DirectiveValidationError{
field: "Directive",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofDirectivePresent = true
if v, ok := interface{}(m.GetAlt()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetAlt()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ResourceLocator_DirectiveValidationError{
field: "Alt",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ResourceLocator_DirectiveValidationError{
field: "Alt",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetAlt()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceLocator_DirectiveValidationError{
field: "Alt",
@@ -170,32 +308,78 @@ func (m *ResourceLocator_Directive) Validate() error {
}
case *ResourceLocator_Directive_Entry:
if v == nil {
err := ResourceLocator_DirectiveValidationError{
field: "Directive",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofDirectivePresent = true
if utf8.RuneCountInString(m.GetEntry()) < 1 {
return ResourceLocator_DirectiveValidationError{
err := ResourceLocator_DirectiveValidationError{
field: "Entry",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if !_ResourceLocator_Directive_Entry_Pattern.MatchString(m.GetEntry()) {
return ResourceLocator_DirectiveValidationError{
err := ResourceLocator_DirectiveValidationError{
field: "Entry",
reason: "value does not match regex pattern \"^[0-9a-zA-Z_\\\\-\\\\./~:]+$\"",
}
if !all {
return err
}
errors = append(errors, err)
}
default:
return ResourceLocator_DirectiveValidationError{
_ = v // ensures v is used
}
if !oneofDirectivePresent {
err := ResourceLocator_DirectiveValidationError{
field: "Directive",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return ResourceLocator_DirectiveMultiError(errors)
}
return nil
}
// ResourceLocator_DirectiveMultiError is an error wrapping multiple validation
// errors returned by ResourceLocator_Directive.ValidateAll() if the
// designated constraints aren't met.
type ResourceLocator_DirectiveMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ResourceLocator_DirectiveMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ResourceLocator_DirectiveMultiError) AllErrors() []error { return m }
// ResourceLocator_DirectiveValidationError is the validation error returned by
// ResourceLocator_Directive.Validate if the designated constraints aren't met.
type ResourceLocator_DirectiveValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/core/v3/resource_name.proto
package v3
@@ -114,13 +114,13 @@ var file_xds_core_v3_resource_name_proto_rawDesc = []byte{
0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63,
0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61,
0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x59, 0x0a,
0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64,
0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33,
0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x59, 0xd2,
0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42,
0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73,
0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,28 +32,66 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on ResourceName with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *ResourceName) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ResourceName with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in ResourceNameMultiError, or
// nil if none found.
func (m *ResourceName) ValidateAll() error {
return m.validate(true)
}
func (m *ResourceName) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Id
// no validation rules for Authority
if utf8.RuneCountInString(m.GetResourceType()) < 1 {
return ResourceNameValidationError{
err := ResourceNameValidationError{
field: "ResourceType",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetContext()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ResourceNameValidationError{
field: "Context",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ResourceNameValidationError{
field: "Context",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceNameValidationError{
field: "Context",
@@ -62,9 +101,29 @@ func (m *ResourceName) Validate() error {
}
}
if len(errors) > 0 {
return ResourceNameMultiError(errors)
}
return nil
}
// ResourceNameMultiError is an error wrapping multiple validation errors
// returned by ResourceName.ValidateAll() if the designated constraints aren't met.
type ResourceNameMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ResourceNameMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ResourceNameMultiError) AllErrors() []error { return m }
// ResourceNameValidationError is the validation error returned by
// ResourceName.Validate if the designated constraints aren't met.
type ResourceNameValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/cel.proto
package v3
@@ -96,13 +96,13 @@ var file_xds_type_matcher_v3_cel_proto_rawDesc = []byte{
0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x65,
0x78, 0x70, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x60, 0x0a, 0x1e, 0x63, 0x6f,
0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x08, 0x43, 0x65,
0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f,
0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
0x72, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x60, 0xd2, 0xc6, 0xa4, 0xe1,
0x06, 0x02, 0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
0x72, 0x2e, 0x76, 0x33, 0x42, 0x08, 0x43, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63,
0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70,
0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,23 +32,62 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on CelMatcher with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *CelMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CelMatcher with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in CelMatcherMultiError, or
// nil if none found.
func (m *CelMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *CelMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if m.GetExprMatch() == nil {
return CelMatcherValidationError{
err := CelMatcherValidationError{
field: "ExprMatch",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetExprMatch()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetExprMatch()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CelMatcherValidationError{
field: "ExprMatch",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CelMatcherValidationError{
field: "ExprMatch",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetExprMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CelMatcherValidationError{
field: "ExprMatch",
@@ -59,9 +99,29 @@ func (m *CelMatcher) Validate() error {
// no validation rules for Description
if len(errors) > 0 {
return CelMatcherMultiError(errors)
}
return nil
}
// CelMatcherMultiError is an error wrapping multiple validation errors
// returned by CelMatcher.ValidateAll() if the designated constraints aren't met.
type CelMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CelMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CelMatcherMultiError) AllErrors() []error { return m }
// CelMatcherValidationError is the validation error returned by
// CelMatcher.Validate if the designated constraints aren't met.
type CelMatcherValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/domain.proto
package v3
@@ -151,13 +151,13 @@ var file_xds_type_matcher_v3_domain_proto_rawDesc = []byte{
0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f,
0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42,
0x6e, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64,
0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76,
0x33, 0x42, 0x16, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74,
0x63, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73,
0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74,
0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62,
0x6e, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x16, 0x53, 0x65, 0x72, 0x76, 0x65,
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f,
0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,20 +32,54 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on ServerNameMatcher with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *ServerNameMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ServerNameMatcher with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ServerNameMatcherMultiError, or nil if none found.
func (m *ServerNameMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *ServerNameMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetDomainMatchers() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ServerNameMatcherValidationError{
field: fmt.Sprintf("DomainMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ServerNameMatcherValidationError{
field: fmt.Sprintf("DomainMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ServerNameMatcherValidationError{
field: fmt.Sprintf("DomainMatchers[%v]", idx),
@@ -56,9 +91,30 @@ func (m *ServerNameMatcher) Validate() error {
}
if len(errors) > 0 {
return ServerNameMatcherMultiError(errors)
}
return nil
}
// ServerNameMatcherMultiError is an error wrapping multiple validation errors
// returned by ServerNameMatcher.ValidateAll() if the designated constraints
// aren't met.
type ServerNameMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ServerNameMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ServerNameMatcherMultiError) AllErrors() []error { return m }
// ServerNameMatcherValidationError is the validation error returned by
// ServerNameMatcher.Validate if the designated constraints aren't met.
type ServerNameMatcherValidationError struct {
@@ -117,20 +173,57 @@ var _ interface {
// Validate checks the field values on ServerNameMatcher_DomainMatcher with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *ServerNameMatcher_DomainMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ServerNameMatcher_DomainMatcher with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// ServerNameMatcher_DomainMatcherMultiError, or nil if none found.
func (m *ServerNameMatcher_DomainMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *ServerNameMatcher_DomainMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetDomains()) < 1 {
return ServerNameMatcher_DomainMatcherValidationError{
err := ServerNameMatcher_DomainMatcherValidationError{
field: "Domains",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetOnMatch()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ServerNameMatcher_DomainMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ServerNameMatcher_DomainMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ServerNameMatcher_DomainMatcherValidationError{
field: "OnMatch",
@@ -140,9 +233,30 @@ func (m *ServerNameMatcher_DomainMatcher) Validate() error {
}
}
if len(errors) > 0 {
return ServerNameMatcher_DomainMatcherMultiError(errors)
}
return nil
}
// ServerNameMatcher_DomainMatcherMultiError is an error wrapping multiple
// validation errors returned by ServerNameMatcher_DomainMatcher.ValidateAll()
// if the designated constraints aren't met.
type ServerNameMatcher_DomainMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ServerNameMatcher_DomainMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ServerNameMatcher_DomainMatcherMultiError) AllErrors() []error { return m }
// ServerNameMatcher_DomainMatcherValidationError is the validation error
// returned by ServerNameMatcher_DomainMatcher.Validate if the designated
// constraints aren't met.

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/http_inputs.proto
package v3
@@ -69,14 +69,14 @@ var file_xds_type_matcher_v3_http_inputs_proto_rawDesc = []byte{
0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33,
0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1d, 0x0a,
0x1b, 0x48, 0x74, 0x74, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43,
0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x67, 0x0a, 0x1e,
0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0f,
0x48, 0x74, 0x74, 0x70, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e,
0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4,
0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x67, 0xd2, 0xc6,
0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0f, 0x48, 0x74, 0x74, 0x70, 0x49, 0x6e, 0x70, 0x75,
0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67,
0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,19 +32,55 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on HttpAttributesCelMatchInput with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *HttpAttributesCelMatchInput) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on HttpAttributesCelMatchInput with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// HttpAttributesCelMatchInputMultiError, or nil if none found.
func (m *HttpAttributesCelMatchInput) ValidateAll() error {
return m.validate(true)
}
func (m *HttpAttributesCelMatchInput) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return HttpAttributesCelMatchInputMultiError(errors)
}
return nil
}
// HttpAttributesCelMatchInputMultiError is an error wrapping multiple
// validation errors returned by HttpAttributesCelMatchInput.ValidateAll() if
// the designated constraints aren't met.
type HttpAttributesCelMatchInputMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m HttpAttributesCelMatchInputMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m HttpAttributesCelMatchInputMultiError) AllErrors() []error { return m }
// HttpAttributesCelMatchInputValidationError is the validation error returned
// by HttpAttributesCelMatchInput.Validate if the designated constraints
// aren't met.

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/ip.proto
package v3
@@ -163,13 +163,13 @@ var file_xds_type_matcher_v3_ip_proto_rawDesc = []byte{
0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78,
0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65,
0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x42, 0x66, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x49, 0x50, 0x4d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64,
0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01,
0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x42, 0x66, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02,
0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78,
0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e,
0x76, 0x33, 0x42, 0x0e, 0x49, 0x50, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73,
0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,19 +32,54 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on IPMatcher with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *IPMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on IPMatcher with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in IPMatcherMultiError, or nil
// if none found.
func (m *IPMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *IPMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetRangeMatchers() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, IPMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, IPMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return IPMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
@@ -55,9 +91,29 @@ func (m *IPMatcher) Validate() error {
}
if len(errors) > 0 {
return IPMatcherMultiError(errors)
}
return nil
}
// IPMatcherMultiError is an error wrapping multiple validation errors returned
// by IPMatcher.ValidateAll() if the designated constraints aren't met.
type IPMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m IPMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m IPMatcherMultiError) AllErrors() []error { return m }
// IPMatcherValidationError is the validation error returned by
// IPMatcher.Validate if the designated constraints aren't met.
type IPMatcherValidationError struct {
@@ -114,23 +170,60 @@ var _ interface {
// Validate checks the field values on IPMatcher_IPRangeMatcher with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *IPMatcher_IPRangeMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on IPMatcher_IPRangeMatcher with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// IPMatcher_IPRangeMatcherMultiError, or nil if none found.
func (m *IPMatcher_IPRangeMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *IPMatcher_IPRangeMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetRanges()) < 1 {
return IPMatcher_IPRangeMatcherValidationError{
err := IPMatcher_IPRangeMatcherValidationError{
field: "Ranges",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
for idx, item := range m.GetRanges() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return IPMatcher_IPRangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
@@ -142,7 +235,26 @@ func (m *IPMatcher_IPRangeMatcher) Validate() error {
}
if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetOnMatch()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, IPMatcher_IPRangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return IPMatcher_IPRangeMatcherValidationError{
field: "OnMatch",
@@ -154,9 +266,30 @@ func (m *IPMatcher_IPRangeMatcher) Validate() error {
// no validation rules for Exclusive
if len(errors) > 0 {
return IPMatcher_IPRangeMatcherMultiError(errors)
}
return nil
}
// IPMatcher_IPRangeMatcherMultiError is an error wrapping multiple validation
// errors returned by IPMatcher_IPRangeMatcher.ValidateAll() if the designated
// constraints aren't met.
type IPMatcher_IPRangeMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m IPMatcher_IPRangeMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m IPMatcher_IPRangeMatcherMultiError) AllErrors() []error { return m }
// IPMatcher_IPRangeMatcherValidationError is the validation error returned by
// IPMatcher_IPRangeMatcher.Validate if the designated constraints aren't met.
type IPMatcher_IPRangeMatcherValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/matcher.proto
package v3

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/range.proto
package v3

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,20 +32,54 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on Int64RangeMatcher with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *Int64RangeMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Int64RangeMatcher with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// Int64RangeMatcherMultiError, or nil if none found.
func (m *Int64RangeMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *Int64RangeMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetRangeMatchers() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, Int64RangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, Int64RangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Int64RangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
@@ -56,9 +91,30 @@ func (m *Int64RangeMatcher) Validate() error {
}
if len(errors) > 0 {
return Int64RangeMatcherMultiError(errors)
}
return nil
}
// Int64RangeMatcherMultiError is an error wrapping multiple validation errors
// returned by Int64RangeMatcher.ValidateAll() if the designated constraints
// aren't met.
type Int64RangeMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m Int64RangeMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m Int64RangeMatcherMultiError) AllErrors() []error { return m }
// Int64RangeMatcherValidationError is the validation error returned by
// Int64RangeMatcher.Validate if the designated constraints aren't met.
type Int64RangeMatcherValidationError struct {
@@ -116,17 +172,50 @@ var _ interface {
} = Int64RangeMatcherValidationError{}
// Validate checks the field values on Int32RangeMatcher with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *Int32RangeMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Int32RangeMatcher with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// Int32RangeMatcherMultiError, or nil if none found.
func (m *Int32RangeMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *Int32RangeMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetRangeMatchers() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, Int32RangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, Int32RangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Int32RangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
@@ -138,9 +227,30 @@ func (m *Int32RangeMatcher) Validate() error {
}
if len(errors) > 0 {
return Int32RangeMatcherMultiError(errors)
}
return nil
}
// Int32RangeMatcherMultiError is an error wrapping multiple validation errors
// returned by Int32RangeMatcher.ValidateAll() if the designated constraints
// aren't met.
type Int32RangeMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m Int32RangeMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m Int32RangeMatcherMultiError) AllErrors() []error { return m }
// Int32RangeMatcherValidationError is the validation error returned by
// Int32RangeMatcher.Validate if the designated constraints aren't met.
type Int32RangeMatcherValidationError struct {
@@ -199,16 +309,49 @@ var _ interface {
// Validate checks the field values on DoubleRangeMatcher with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *DoubleRangeMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DoubleRangeMatcher with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DoubleRangeMatcherMultiError, or nil if none found.
func (m *DoubleRangeMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *DoubleRangeMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetRangeMatchers() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DoubleRangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DoubleRangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DoubleRangeMatcherValidationError{
field: fmt.Sprintf("RangeMatchers[%v]", idx),
@@ -220,9 +363,30 @@ func (m *DoubleRangeMatcher) Validate() error {
}
if len(errors) > 0 {
return DoubleRangeMatcherMultiError(errors)
}
return nil
}
// DoubleRangeMatcherMultiError is an error wrapping multiple validation errors
// returned by DoubleRangeMatcher.ValidateAll() if the designated constraints
// aren't met.
type DoubleRangeMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DoubleRangeMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m DoubleRangeMatcherMultiError) AllErrors() []error { return m }
// DoubleRangeMatcherValidationError is the validation error returned by
// DoubleRangeMatcher.Validate if the designated constraints aren't met.
type DoubleRangeMatcherValidationError struct {
@@ -281,23 +445,60 @@ var _ interface {
// Validate checks the field values on Int64RangeMatcher_RangeMatcher with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *Int64RangeMatcher_RangeMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Int64RangeMatcher_RangeMatcher with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// Int64RangeMatcher_RangeMatcherMultiError, or nil if none found.
func (m *Int64RangeMatcher_RangeMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *Int64RangeMatcher_RangeMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetRanges()) < 1 {
return Int64RangeMatcher_RangeMatcherValidationError{
err := Int64RangeMatcher_RangeMatcherValidationError{
field: "Ranges",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
for idx, item := range m.GetRanges() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Int64RangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
@@ -309,7 +510,26 @@ func (m *Int64RangeMatcher_RangeMatcher) Validate() error {
}
if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetOnMatch()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, Int64RangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Int64RangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
@@ -319,9 +539,30 @@ func (m *Int64RangeMatcher_RangeMatcher) Validate() error {
}
}
if len(errors) > 0 {
return Int64RangeMatcher_RangeMatcherMultiError(errors)
}
return nil
}
// Int64RangeMatcher_RangeMatcherMultiError is an error wrapping multiple
// validation errors returned by Int64RangeMatcher_RangeMatcher.ValidateAll()
// if the designated constraints aren't met.
type Int64RangeMatcher_RangeMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m Int64RangeMatcher_RangeMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m Int64RangeMatcher_RangeMatcherMultiError) AllErrors() []error { return m }
// Int64RangeMatcher_RangeMatcherValidationError is the validation error
// returned by Int64RangeMatcher_RangeMatcher.Validate if the designated
// constraints aren't met.
@@ -381,23 +622,60 @@ var _ interface {
// Validate checks the field values on Int32RangeMatcher_RangeMatcher with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *Int32RangeMatcher_RangeMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Int32RangeMatcher_RangeMatcher with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// Int32RangeMatcher_RangeMatcherMultiError, or nil if none found.
func (m *Int32RangeMatcher_RangeMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *Int32RangeMatcher_RangeMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetRanges()) < 1 {
return Int32RangeMatcher_RangeMatcherValidationError{
err := Int32RangeMatcher_RangeMatcherValidationError{
field: "Ranges",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
for idx, item := range m.GetRanges() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Int32RangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
@@ -409,7 +687,26 @@ func (m *Int32RangeMatcher_RangeMatcher) Validate() error {
}
if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetOnMatch()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, Int32RangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Int32RangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
@@ -419,9 +716,30 @@ func (m *Int32RangeMatcher_RangeMatcher) Validate() error {
}
}
if len(errors) > 0 {
return Int32RangeMatcher_RangeMatcherMultiError(errors)
}
return nil
}
// Int32RangeMatcher_RangeMatcherMultiError is an error wrapping multiple
// validation errors returned by Int32RangeMatcher_RangeMatcher.ValidateAll()
// if the designated constraints aren't met.
type Int32RangeMatcher_RangeMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m Int32RangeMatcher_RangeMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m Int32RangeMatcher_RangeMatcherMultiError) AllErrors() []error { return m }
// Int32RangeMatcher_RangeMatcherValidationError is the validation error
// returned by Int32RangeMatcher_RangeMatcher.Validate if the designated
// constraints aren't met.
@@ -481,23 +799,60 @@ var _ interface {
// Validate checks the field values on DoubleRangeMatcher_RangeMatcher with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *DoubleRangeMatcher_RangeMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DoubleRangeMatcher_RangeMatcher with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// DoubleRangeMatcher_RangeMatcherMultiError, or nil if none found.
func (m *DoubleRangeMatcher_RangeMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *DoubleRangeMatcher_RangeMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetRanges()) < 1 {
return DoubleRangeMatcher_RangeMatcherValidationError{
err := DoubleRangeMatcher_RangeMatcherValidationError{
field: "Ranges",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
for idx, item := range m.GetRanges() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DoubleRangeMatcher_RangeMatcherValidationError{
field: fmt.Sprintf("Ranges[%v]", idx),
@@ -509,7 +864,26 @@ func (m *DoubleRangeMatcher_RangeMatcher) Validate() error {
}
if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetOnMatch()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DoubleRangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DoubleRangeMatcher_RangeMatcherValidationError{
field: "OnMatch",
@@ -519,9 +893,30 @@ func (m *DoubleRangeMatcher_RangeMatcher) Validate() error {
}
}
if len(errors) > 0 {
return DoubleRangeMatcher_RangeMatcherMultiError(errors)
}
return nil
}
// DoubleRangeMatcher_RangeMatcherMultiError is an error wrapping multiple
// validation errors returned by DoubleRangeMatcher_RangeMatcher.ValidateAll()
// if the designated constraints aren't met.
type DoubleRangeMatcher_RangeMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DoubleRangeMatcher_RangeMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m DoubleRangeMatcher_RangeMatcherMultiError) AllErrors() []error { return m }
// DoubleRangeMatcher_RangeMatcherValidationError is the validation error
// returned by DoubleRangeMatcher_RangeMatcher.Validate if the designated
// constraints aren't met.

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/regex.proto
package v3

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,35 +32,88 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on RegexMatcher with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *RegexMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on RegexMatcher with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in RegexMatcherMultiError, or
// nil if none found.
func (m *RegexMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *RegexMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetRegex()) < 1 {
return RegexMatcherValidationError{
err := RegexMatcherValidationError{
field: "Regex",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
switch m.EngineType.(type) {
oneofEngineTypePresent := false
switch v := m.EngineType.(type) {
case *RegexMatcher_GoogleRe2:
if v == nil {
err := RegexMatcherValidationError{
field: "EngineType",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofEngineTypePresent = true
if m.GetGoogleRe2() == nil {
return RegexMatcherValidationError{
err := RegexMatcherValidationError{
field: "GoogleRe2",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetGoogleRe2()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetGoogleRe2()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, RegexMatcherValidationError{
field: "GoogleRe2",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, RegexMatcherValidationError{
field: "GoogleRe2",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetGoogleRe2()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RegexMatcherValidationError{
field: "GoogleRe2",
@@ -70,16 +124,42 @@ func (m *RegexMatcher) Validate() error {
}
default:
return RegexMatcherValidationError{
_ = v // ensures v is used
}
if !oneofEngineTypePresent {
err := RegexMatcherValidationError{
field: "EngineType",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return RegexMatcherMultiError(errors)
}
return nil
}
// RegexMatcherMultiError is an error wrapping multiple validation errors
// returned by RegexMatcher.ValidateAll() if the designated constraints aren't met.
type RegexMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m RegexMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m RegexMatcherMultiError) AllErrors() []error { return m }
// RegexMatcherValidationError is the validation error returned by
// RegexMatcher.Validate if the designated constraints aren't met.
type RegexMatcherValidationError struct {
@@ -136,15 +216,50 @@ var _ interface {
// Validate checks the field values on RegexMatcher_GoogleRE2 with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *RegexMatcher_GoogleRE2) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on RegexMatcher_GoogleRE2 with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// RegexMatcher_GoogleRE2MultiError, or nil if none found.
func (m *RegexMatcher_GoogleRE2) ValidateAll() error {
return m.validate(true)
}
func (m *RegexMatcher_GoogleRE2) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return RegexMatcher_GoogleRE2MultiError(errors)
}
return nil
}
// RegexMatcher_GoogleRE2MultiError is an error wrapping multiple validation
// errors returned by RegexMatcher_GoogleRE2.ValidateAll() if the designated
// constraints aren't met.
type RegexMatcher_GoogleRE2MultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m RegexMatcher_GoogleRE2MultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m RegexMatcher_GoogleRE2MultiError) AllErrors() []error { return m }
// RegexMatcher_GoogleRE2ValidationError is the validation error returned by
// RegexMatcher_GoogleRE2.Validate if the designated constraints aren't met.
type RegexMatcher_GoogleRE2ValidationError struct {

View File

@@ -1,12 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/matcher/v3/string.proto
package v3
import (
v3 "github.com/cncf/xds/go/xds/core/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@@ -33,6 +34,7 @@ type StringMatcher struct {
// *StringMatcher_Suffix
// *StringMatcher_SafeRegex
// *StringMatcher_Contains
// *StringMatcher_Custom
MatchPattern isStringMatcher_MatchPattern `protobuf_oneof:"match_pattern"`
IgnoreCase bool `protobuf:"varint,6,opt,name=ignore_case,json=ignoreCase,proto3" json:"ignore_case,omitempty"`
}
@@ -111,6 +113,13 @@ func (x *StringMatcher) GetContains() string {
return ""
}
func (x *StringMatcher) GetCustom() *v3.TypedExtensionConfig {
if x, ok := x.GetMatchPattern().(*StringMatcher_Custom); ok {
return x.Custom
}
return nil
}
func (x *StringMatcher) GetIgnoreCase() bool {
if x != nil {
return x.IgnoreCase
@@ -142,6 +151,10 @@ type StringMatcher_Contains struct {
Contains string `protobuf:"bytes,7,opt,name=contains,proto3,oneof"`
}
type StringMatcher_Custom struct {
Custom *v3.TypedExtensionConfig `protobuf:"bytes,8,opt,name=custom,proto3,oneof"`
}
func (*StringMatcher_Exact) isStringMatcher_MatchPattern() {}
func (*StringMatcher_Prefix) isStringMatcher_MatchPattern() {}
@@ -152,6 +165,8 @@ func (*StringMatcher_SafeRegex) isStringMatcher_MatchPattern() {}
func (*StringMatcher_Contains) isStringMatcher_MatchPattern() {}
func (*StringMatcher_Custom) isStringMatcher_MatchPattern() {}
type ListStringMatcher struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -205,41 +220,46 @@ var file_xds_type_matcher_v3_string_proto_rawDesc = []byte{
0x0a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74,
0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70,
0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65, 0x67,
0x65, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x99, 0x02, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x12, 0x21, 0x0a, 0x06, 0x70,
0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x21,
0x0a, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69,
0x78, 0x12, 0x4c, 0x0a, 0x0a, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18,
0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x67, 0x65,
0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02,
0x10, 0x01, 0x48, 0x00, 0x52, 0x09, 0x73, 0x61, 0x66, 0x65, 0x52, 0x65, 0x67, 0x65, 0x78, 0x12,
0x25, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65,
0x5f, 0x63, 0x61, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x67, 0x6e,
0x6f, 0x72, 0x65, 0x43, 0x61, 0x73, 0x65, 0x42, 0x14, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x5d, 0x0a,
0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x12, 0x48, 0x0a, 0x08, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e,
0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02,
0x08, 0x01, 0x52, 0x08, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x42, 0x5b, 0x0a, 0x1e,
0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0b,
0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78,
0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1b, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x72,
0x65, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6,
0x02, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
0x12, 0x16, 0x0a, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48,
0x00, 0x52, 0x05, 0x65, 0x78, 0x61, 0x63, 0x74, 0x12, 0x21, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66,
0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
0x01, 0x48, 0x00, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x21, 0x0a, 0x06, 0x73,
0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x4c,
0x0a, 0x0a, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x78, 0x4d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x48,
0x00, 0x52, 0x09, 0x73, 0x61, 0x66, 0x65, 0x52, 0x65, 0x67, 0x65, 0x78, 0x12, 0x25, 0x0a, 0x08,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61,
0x69, 0x6e, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x08, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76,
0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x18,
0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x43, 0x61, 0x73,
0x65, 0x42, 0x14, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65,
0x72, 0x6e, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x5d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x08,
0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22,
0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
0x72, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x08, 0x70, 0x61,
0x74, 0x74, 0x65, 0x72, 0x6e, 0x73, 0x42, 0x5b, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f,
0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -256,18 +276,20 @@ func file_xds_type_matcher_v3_string_proto_rawDescGZIP() []byte {
var file_xds_type_matcher_v3_string_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_xds_type_matcher_v3_string_proto_goTypes = []interface{}{
(*StringMatcher)(nil), // 0: xds.type.matcher.v3.StringMatcher
(*ListStringMatcher)(nil), // 1: xds.type.matcher.v3.ListStringMatcher
(*RegexMatcher)(nil), // 2: xds.type.matcher.v3.RegexMatcher
(*StringMatcher)(nil), // 0: xds.type.matcher.v3.StringMatcher
(*ListStringMatcher)(nil), // 1: xds.type.matcher.v3.ListStringMatcher
(*RegexMatcher)(nil), // 2: xds.type.matcher.v3.RegexMatcher
(*v3.TypedExtensionConfig)(nil), // 3: xds.core.v3.TypedExtensionConfig
}
var file_xds_type_matcher_v3_string_proto_depIdxs = []int32{
2, // 0: xds.type.matcher.v3.StringMatcher.safe_regex:type_name -> xds.type.matcher.v3.RegexMatcher
0, // 1: xds.type.matcher.v3.ListStringMatcher.patterns:type_name -> xds.type.matcher.v3.StringMatcher
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
3, // 1: xds.type.matcher.v3.StringMatcher.custom:type_name -> xds.core.v3.TypedExtensionConfig
0, // 2: xds.type.matcher.v3.ListStringMatcher.patterns:type_name -> xds.type.matcher.v3.StringMatcher
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_xds_type_matcher_v3_string_proto_init() }
@@ -308,6 +330,7 @@ func file_xds_type_matcher_v3_string_proto_init() {
(*StringMatcher_Suffix)(nil),
(*StringMatcher_SafeRegex)(nil),
(*StringMatcher_Contains)(nil),
(*StringMatcher_Custom)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,51 +32,140 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on StringMatcher with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *StringMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on StringMatcher with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in StringMatcherMultiError, or
// nil if none found.
func (m *StringMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *StringMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for IgnoreCase
switch m.MatchPattern.(type) {
oneofMatchPatternPresent := false
switch v := m.MatchPattern.(type) {
case *StringMatcher_Exact:
if v == nil {
err := StringMatcherValidationError{
field: "MatchPattern",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofMatchPatternPresent = true
// no validation rules for Exact
case *StringMatcher_Prefix:
if v == nil {
err := StringMatcherValidationError{
field: "MatchPattern",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofMatchPatternPresent = true
if utf8.RuneCountInString(m.GetPrefix()) < 1 {
return StringMatcherValidationError{
err := StringMatcherValidationError{
field: "Prefix",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
case *StringMatcher_Suffix:
if v == nil {
err := StringMatcherValidationError{
field: "MatchPattern",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofMatchPatternPresent = true
if utf8.RuneCountInString(m.GetSuffix()) < 1 {
return StringMatcherValidationError{
err := StringMatcherValidationError{
field: "Suffix",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
case *StringMatcher_SafeRegex:
if v == nil {
err := StringMatcherValidationError{
field: "MatchPattern",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofMatchPatternPresent = true
if m.GetSafeRegex() == nil {
return StringMatcherValidationError{
err := StringMatcherValidationError{
field: "SafeRegex",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetSafeRegex()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetSafeRegex()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, StringMatcherValidationError{
field: "SafeRegex",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, StringMatcherValidationError{
field: "SafeRegex",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetSafeRegex()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return StringMatcherValidationError{
field: "SafeRegex",
@@ -86,25 +176,109 @@ func (m *StringMatcher) Validate() error {
}
case *StringMatcher_Contains:
if v == nil {
err := StringMatcherValidationError{
field: "MatchPattern",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofMatchPatternPresent = true
if utf8.RuneCountInString(m.GetContains()) < 1 {
return StringMatcherValidationError{
err := StringMatcherValidationError{
field: "Contains",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
case *StringMatcher_Custom:
if v == nil {
err := StringMatcherValidationError{
field: "MatchPattern",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofMatchPatternPresent = true
if all {
switch v := interface{}(m.GetCustom()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, StringMatcherValidationError{
field: "Custom",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, StringMatcherValidationError{
field: "Custom",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetCustom()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return StringMatcherValidationError{
field: "Custom",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
return StringMatcherValidationError{
_ = v // ensures v is used
}
if !oneofMatchPatternPresent {
err := StringMatcherValidationError{
field: "MatchPattern",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return StringMatcherMultiError(errors)
}
return nil
}
// StringMatcherMultiError is an error wrapping multiple validation errors
// returned by StringMatcher.ValidateAll() if the designated constraints
// aren't met.
type StringMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m StringMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m StringMatcherMultiError) AllErrors() []error { return m }
// StringMatcherValidationError is the validation error returned by
// StringMatcher.Validate if the designated constraints aren't met.
type StringMatcherValidationError struct {
@@ -160,24 +334,61 @@ var _ interface {
} = StringMatcherValidationError{}
// Validate checks the field values on ListStringMatcher with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *ListStringMatcher) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ListStringMatcher with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ListStringMatcherMultiError, or nil if none found.
func (m *ListStringMatcher) ValidateAll() error {
return m.validate(true)
}
func (m *ListStringMatcher) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetPatterns()) < 1 {
return ListStringMatcherValidationError{
err := ListStringMatcherValidationError{
field: "Patterns",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
for idx, item := range m.GetPatterns() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ListStringMatcherValidationError{
field: fmt.Sprintf("Patterns[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ListStringMatcherValidationError{
field: fmt.Sprintf("Patterns[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListStringMatcherValidationError{
field: fmt.Sprintf("Patterns[%v]", idx),
@@ -189,9 +400,30 @@ func (m *ListStringMatcher) Validate() error {
}
if len(errors) > 0 {
return ListStringMatcherMultiError(errors)
}
return nil
}
// ListStringMatcherMultiError is an error wrapping multiple validation errors
// returned by ListStringMatcher.ValidateAll() if the designated constraints
// aren't met.
type ListStringMatcherMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ListStringMatcherMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ListStringMatcherMultiError) AllErrors() []error { return m }
// ListStringMatcherValidationError is the validation error returned by
// ListStringMatcher.Validate if the designated constraints aren't met.
type ListStringMatcherValidationError struct {

View File

@@ -1,18 +1,19 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/v3/cel.proto
package v3
import (
expr "cel.dev/expr"
_ "github.com/cncf/xds/go/xds/annotations/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
v1alpha1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
reflect "reflect"
sync "sync"
)
@@ -33,7 +34,9 @@ type CelExpression struct {
//
// *CelExpression_ParsedExpr
// *CelExpression_CheckedExpr
ExprSpecifier isCelExpression_ExprSpecifier `protobuf_oneof:"expr_specifier"`
ExprSpecifier isCelExpression_ExprSpecifier `protobuf_oneof:"expr_specifier"`
CelExprParsed *expr.ParsedExpr `protobuf:"bytes,3,opt,name=cel_expr_parsed,json=celExprParsed,proto3" json:"cel_expr_parsed,omitempty"`
CelExprChecked *expr.CheckedExpr `protobuf:"bytes,4,opt,name=cel_expr_checked,json=celExprChecked,proto3" json:"cel_expr_checked,omitempty"`
}
func (x *CelExpression) Reset() {
@@ -75,6 +78,7 @@ func (m *CelExpression) GetExprSpecifier() isCelExpression_ExprSpecifier {
return nil
}
// Deprecated: Marked as deprecated in xds/type/v3/cel.proto.
func (x *CelExpression) GetParsedExpr() *v1alpha1.ParsedExpr {
if x, ok := x.GetExprSpecifier().(*CelExpression_ParsedExpr); ok {
return x.ParsedExpr
@@ -82,6 +86,7 @@ func (x *CelExpression) GetParsedExpr() *v1alpha1.ParsedExpr {
return nil
}
// Deprecated: Marked as deprecated in xds/type/v3/cel.proto.
func (x *CelExpression) GetCheckedExpr() *v1alpha1.CheckedExpr {
if x, ok := x.GetExprSpecifier().(*CelExpression_CheckedExpr); ok {
return x.CheckedExpr
@@ -89,15 +94,31 @@ func (x *CelExpression) GetCheckedExpr() *v1alpha1.CheckedExpr {
return nil
}
func (x *CelExpression) GetCelExprParsed() *expr.ParsedExpr {
if x != nil {
return x.CelExprParsed
}
return nil
}
func (x *CelExpression) GetCelExprChecked() *expr.CheckedExpr {
if x != nil {
return x.CelExprChecked
}
return nil
}
type isCelExpression_ExprSpecifier interface {
isCelExpression_ExprSpecifier()
}
type CelExpression_ParsedExpr struct {
// Deprecated: Marked as deprecated in xds/type/v3/cel.proto.
ParsedExpr *v1alpha1.ParsedExpr `protobuf:"bytes,1,opt,name=parsed_expr,json=parsedExpr,proto3,oneof"`
}
type CelExpression_CheckedExpr struct {
// Deprecated: Marked as deprecated in xds/type/v3/cel.proto.
CheckedExpr *v1alpha1.CheckedExpr `protobuf:"bytes,2,opt,name=checked_expr,json=checkedExpr,proto3,oneof"`
}
@@ -110,8 +131,8 @@ type CelExtractString struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ExprExtract *CelExpression `protobuf:"bytes,1,opt,name=expr_extract,json=exprExtract,proto3" json:"expr_extract,omitempty"`
DefaultValue *wrappers.StringValue `protobuf:"bytes,2,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
ExprExtract *CelExpression `protobuf:"bytes,1,opt,name=expr_extract,json=exprExtract,proto3" json:"expr_extract,omitempty"`
DefaultValue *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
}
func (x *CelExtractString) Reset() {
@@ -153,7 +174,7 @@ func (x *CelExtractString) GetExprExtract() *CelExpression {
return nil
}
func (x *CelExtractString) GetDefaultValue() *wrappers.StringValue {
func (x *CelExtractString) GetDefaultValue() *wrapperspb.StringValue {
if x != nil {
return x.DefaultValue
}
@@ -170,40 +191,51 @@ var file_xds_type_v3_cel_proto_rawDesc = []byte{
0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x01,
0x0a, 0x0d, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12,
0x47, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e,
0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x61,
0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x12, 0x4a, 0x0a, 0x0c, 0x63, 0x68, 0x65, 0x63,
0x6b, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78, 0x70, 0x72,
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65,
0x64, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64,
0x45, 0x78, 0x70, 0x72, 0x42, 0x15, 0x0a, 0x0e, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x73, 0x70, 0x65,
0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x9e, 0x01, 0x0a, 0x10,
0x43, 0x65, 0x6c, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
0x12, 0x47, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69,
0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x65, 0x78,
0x70, 0x72, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x65, 0x66,
0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c,
0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x50, 0x0a, 0x16,
0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x08, 0x43, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63,
0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74,
0x79, 0x70, 0x65, 0x2f, 0x76, 0x33, 0xd2, 0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x63, 0x68,
0x65, 0x63, 0x6b, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x65, 0x6c,
0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x02, 0x0a,
0x0d, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4b,
0x0a, 0x0b, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50,
0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x42, 0x02, 0x18, 0x01, 0x48, 0x00, 0x52,
0x0a, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x12, 0x4e, 0x0a, 0x0c, 0x63,
0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65,
0x78, 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65,
0x63, 0x6b, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x42, 0x02, 0x18, 0x01, 0x48, 0x00, 0x52, 0x0b,
0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x12, 0x3c, 0x0a, 0x0f, 0x63,
0x65, 0x6c, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e,
0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0d, 0x63, 0x65, 0x6c, 0x45,
0x78, 0x70, 0x72, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x12, 0x3f, 0x0a, 0x10, 0x63, 0x65, 0x6c,
0x5f, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x04, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0e, 0x63, 0x65, 0x6c, 0x45,
0x78, 0x70, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x42, 0x10, 0x0a, 0x0e, 0x65, 0x78,
0x70, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x9e, 0x01, 0x0a,
0x10, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e,
0x67, 0x12, 0x47, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73,
0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x65,
0x78, 0x70, 0x72, 0x45, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x65,
0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x50, 0xd2,
0xc6, 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x42,
0x08, 0x43, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73,
0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76, 0x33, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -220,22 +252,26 @@ func file_xds_type_v3_cel_proto_rawDescGZIP() []byte {
var file_xds_type_v3_cel_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_xds_type_v3_cel_proto_goTypes = []interface{}{
(*CelExpression)(nil), // 0: xds.type.v3.CelExpression
(*CelExtractString)(nil), // 1: xds.type.v3.CelExtractString
(*v1alpha1.ParsedExpr)(nil), // 2: google.api.expr.v1alpha1.ParsedExpr
(*v1alpha1.CheckedExpr)(nil), // 3: google.api.expr.v1alpha1.CheckedExpr
(*wrappers.StringValue)(nil), // 4: google.protobuf.StringValue
(*CelExpression)(nil), // 0: xds.type.v3.CelExpression
(*CelExtractString)(nil), // 1: xds.type.v3.CelExtractString
(*v1alpha1.ParsedExpr)(nil), // 2: google.api.expr.v1alpha1.ParsedExpr
(*v1alpha1.CheckedExpr)(nil), // 3: google.api.expr.v1alpha1.CheckedExpr
(*expr.ParsedExpr)(nil), // 4: cel.expr.ParsedExpr
(*expr.CheckedExpr)(nil), // 5: cel.expr.CheckedExpr
(*wrapperspb.StringValue)(nil), // 6: google.protobuf.StringValue
}
var file_xds_type_v3_cel_proto_depIdxs = []int32{
2, // 0: xds.type.v3.CelExpression.parsed_expr:type_name -> google.api.expr.v1alpha1.ParsedExpr
3, // 1: xds.type.v3.CelExpression.checked_expr:type_name -> google.api.expr.v1alpha1.CheckedExpr
0, // 2: xds.type.v3.CelExtractString.expr_extract:type_name -> xds.type.v3.CelExpression
4, // 3: xds.type.v3.CelExtractString.default_value:type_name -> google.protobuf.StringValue
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
4, // 2: xds.type.v3.CelExpression.cel_expr_parsed:type_name -> cel.expr.ParsedExpr
5, // 3: xds.type.v3.CelExpression.cel_expr_checked:type_name -> cel.expr.CheckedExpr
0, // 4: xds.type.v3.CelExtractString.expr_extract:type_name -> xds.type.v3.CelExpression
6, // 5: xds.type.v3.CelExtractString.default_value:type_name -> google.protobuf.StringValue
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_xds_type_v3_cel_proto_init() }

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,21 +32,122 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on CelExpression with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *CelExpression) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CelExpression with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in CelExpressionMultiError, or
// nil if none found.
func (m *CelExpression) ValidateAll() error {
return m.validate(true)
}
func (m *CelExpression) validate(all bool) error {
if m == nil {
return nil
}
switch m.ExprSpecifier.(type) {
var errors []error
if all {
switch v := interface{}(m.GetCelExprParsed()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "CelExprParsed",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "CelExprParsed",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetCelExprParsed()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CelExpressionValidationError{
field: "CelExprParsed",
reason: "embedded message failed validation",
cause: err,
}
}
}
if all {
switch v := interface{}(m.GetCelExprChecked()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "CelExprChecked",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "CelExprChecked",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetCelExprChecked()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CelExpressionValidationError{
field: "CelExprChecked",
reason: "embedded message failed validation",
cause: err,
}
}
}
switch v := m.ExprSpecifier.(type) {
case *CelExpression_ParsedExpr:
if v == nil {
err := CelExpressionValidationError{
field: "ExprSpecifier",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetParsedExpr()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetParsedExpr()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "ParsedExpr",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "ParsedExpr",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetParsedExpr()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CelExpressionValidationError{
field: "ParsedExpr",
@@ -56,8 +158,37 @@ func (m *CelExpression) Validate() error {
}
case *CelExpression_CheckedExpr:
if v == nil {
err := CelExpressionValidationError{
field: "ExprSpecifier",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetCheckedExpr()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetCheckedExpr()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "CheckedExpr",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CelExpressionValidationError{
field: "CheckedExpr",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetCheckedExpr()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CelExpressionValidationError{
field: "CheckedExpr",
@@ -68,16 +199,33 @@ func (m *CelExpression) Validate() error {
}
default:
return CelExpressionValidationError{
field: "ExprSpecifier",
reason: "value is required",
}
_ = v // ensures v is used
}
if len(errors) > 0 {
return CelExpressionMultiError(errors)
}
return nil
}
// CelExpressionMultiError is an error wrapping multiple validation errors
// returned by CelExpression.ValidateAll() if the designated constraints
// aren't met.
type CelExpressionMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CelExpressionMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CelExpressionMultiError) AllErrors() []error { return m }
// CelExpressionValidationError is the validation error returned by
// CelExpression.Validate if the designated constraints aren't met.
type CelExpressionValidationError struct {
@@ -133,21 +281,58 @@ var _ interface {
} = CelExpressionValidationError{}
// Validate checks the field values on CelExtractString with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *CelExtractString) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CelExtractString with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CelExtractStringMultiError, or nil if none found.
func (m *CelExtractString) ValidateAll() error {
return m.validate(true)
}
func (m *CelExtractString) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if m.GetExprExtract() == nil {
return CelExtractStringValidationError{
err := CelExtractStringValidationError{
field: "ExprExtract",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if v, ok := interface{}(m.GetExprExtract()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetExprExtract()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CelExtractStringValidationError{
field: "ExprExtract",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CelExtractStringValidationError{
field: "ExprExtract",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetExprExtract()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CelExtractStringValidationError{
field: "ExprExtract",
@@ -157,7 +342,26 @@ func (m *CelExtractString) Validate() error {
}
}
if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetDefaultValue()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CelExtractStringValidationError{
field: "DefaultValue",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CelExtractStringValidationError{
field: "DefaultValue",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CelExtractStringValidationError{
field: "DefaultValue",
@@ -167,9 +371,30 @@ func (m *CelExtractString) Validate() error {
}
}
if len(errors) > 0 {
return CelExtractStringMultiError(errors)
}
return nil
}
// CelExtractStringMultiError is an error wrapping multiple validation errors
// returned by CelExtractString.ValidateAll() if the designated constraints
// aren't met.
type CelExtractStringMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CelExtractStringMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CelExtractStringMultiError) AllErrors() []error { return m }
// CelExtractStringValidationError is the validation error returned by
// CelExtractString.Validate if the designated constraints aren't met.
type CelExtractStringValidationError struct {

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/v3/range.proto
package v3

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,22 +32,58 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on Int64Range with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Int64Range) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Int64Range with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in Int64RangeMultiError, or
// nil if none found.
func (m *Int64Range) ValidateAll() error {
return m.validate(true)
}
func (m *Int64Range) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Start
// no validation rules for End
if len(errors) > 0 {
return Int64RangeMultiError(errors)
}
return nil
}
// Int64RangeMultiError is an error wrapping multiple validation errors
// returned by Int64Range.ValidateAll() if the designated constraints aren't met.
type Int64RangeMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m Int64RangeMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m Int64RangeMultiError) AllErrors() []error { return m }
// Int64RangeValidationError is the validation error returned by
// Int64Range.Validate if the designated constraints aren't met.
type Int64RangeValidationError struct {
@@ -102,19 +139,54 @@ var _ interface {
} = Int64RangeValidationError{}
// Validate checks the field values on Int32Range with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Int32Range) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Int32Range with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in Int32RangeMultiError, or
// nil if none found.
func (m *Int32Range) ValidateAll() error {
return m.validate(true)
}
func (m *Int32Range) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Start
// no validation rules for End
if len(errors) > 0 {
return Int32RangeMultiError(errors)
}
return nil
}
// Int32RangeMultiError is an error wrapping multiple validation errors
// returned by Int32Range.ValidateAll() if the designated constraints aren't met.
type Int32RangeMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m Int32RangeMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m Int32RangeMultiError) AllErrors() []error { return m }
// Int32RangeValidationError is the validation error returned by
// Int32Range.Validate if the designated constraints aren't met.
type Int32RangeValidationError struct {
@@ -170,20 +242,54 @@ var _ interface {
} = Int32RangeValidationError{}
// Validate checks the field values on DoubleRange with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *DoubleRange) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DoubleRange with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in DoubleRangeMultiError, or
// nil if none found.
func (m *DoubleRange) ValidateAll() error {
return m.validate(true)
}
func (m *DoubleRange) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Start
// no validation rules for End
if len(errors) > 0 {
return DoubleRangeMultiError(errors)
}
return nil
}
// DoubleRangeMultiError is an error wrapping multiple validation errors
// returned by DoubleRange.ValidateAll() if the designated constraints aren't met.
type DoubleRangeMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DoubleRangeMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m DoubleRangeMultiError) AllErrors() []error { return m }
// DoubleRangeValidationError is the validation error returned by
// DoubleRange.Validate if the designated constraints aren't met.
type DoubleRangeValidationError struct {

View File

@@ -1,15 +1,15 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.18.0
// protoc-gen-go v1.32.0
// protoc v3.21.5
// source: xds/type/v3/typed_struct.proto
package v3
import (
_struct "github.com/golang/protobuf/ptypes/struct"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
structpb "google.golang.org/protobuf/types/known/structpb"
reflect "reflect"
sync "sync"
)
@@ -26,8 +26,8 @@ type TypedStruct struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
Value *_struct.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
Value *structpb.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (x *TypedStruct) Reset() {
@@ -69,7 +69,7 @@ func (x *TypedStruct) GetTypeUrl() string {
return ""
}
func (x *TypedStruct) GetValue() *_struct.Struct {
func (x *TypedStruct) GetValue() *structpb.Struct {
if x != nil {
return x.Value
}
@@ -111,8 +111,8 @@ func file_xds_type_v3_typed_struct_proto_rawDescGZIP() []byte {
var file_xds_type_v3_typed_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_xds_type_v3_typed_struct_proto_goTypes = []interface{}{
(*TypedStruct)(nil), // 0: xds.type.v3.TypedStruct
(*_struct.Struct)(nil), // 1: google.protobuf.Struct
(*TypedStruct)(nil), // 0: xds.type.v3.TypedStruct
(*structpb.Struct)(nil), // 1: google.protobuf.Struct
}
var file_xds_type_v3_typed_struct_proto_depIdxs = []int32{
1, // 0: xds.type.v3.TypedStruct.value:type_name -> google.protobuf.Struct

View File

@@ -11,6 +11,7 @@ import (
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
@@ -31,19 +32,53 @@ var (
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on TypedStruct with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *TypedStruct) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on TypedStruct with the rules defined in
// the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in TypedStructMultiError, or
// nil if none found.
func (m *TypedStruct) ValidateAll() error {
return m.validate(true)
}
func (m *TypedStruct) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for TypeUrl
if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
if all {
switch v := interface{}(m.GetValue()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, TypedStructValidationError{
field: "Value",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, TypedStructValidationError{
field: "Value",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TypedStructValidationError{
field: "Value",
@@ -53,9 +88,29 @@ func (m *TypedStruct) Validate() error {
}
}
if len(errors) > 0 {
return TypedStructMultiError(errors)
}
return nil
}
// TypedStructMultiError is an error wrapping multiple validation errors
// returned by TypedStruct.ValidateAll() if the designated constraints aren't met.
type TypedStructMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m TypedStructMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m TypedStructMultiError) AllErrors() []error { return m }
// TypedStructValidationError is the validation error returned by
// TypedStruct.Validate if the designated constraints aren't met.
type TypedStructValidationError struct {