2019-06-07 12:10:43 +00:00
|
|
|
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
2018-10-03 18:18:55 +00:00
|
|
|
// source: envoy/api/v2/rds.proto
|
|
|
|
|
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"net"
|
|
|
|
"net/mail"
|
|
|
|
"net/url"
|
|
|
|
"regexp"
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
"unicode/utf8"
|
|
|
|
|
|
|
|
"github.com/gogo/protobuf/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ensure the imports are used
|
|
|
|
var (
|
|
|
|
_ = bytes.MinRead
|
|
|
|
_ = errors.New("")
|
|
|
|
_ = fmt.Print
|
|
|
|
_ = utf8.UTFMax
|
|
|
|
_ = (*regexp.Regexp)(nil)
|
|
|
|
_ = (*strings.Reader)(nil)
|
|
|
|
_ = net.IPv4len
|
|
|
|
_ = time.Duration(0)
|
|
|
|
_ = (*url.URL)(nil)
|
|
|
|
_ = (*mail.Address)(nil)
|
|
|
|
_ = types.DynamicAny{}
|
|
|
|
)
|
|
|
|
|
|
|
|
// Validate checks the field values on RouteConfiguration with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *RouteConfiguration) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for Name
|
|
|
|
|
|
|
|
for idx, item := range m.GetVirtualHosts() {
|
|
|
|
_, _ = idx, item
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := item
|
|
|
|
|
|
|
|
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return RouteConfigurationValidationError{
|
|
|
|
field: fmt.Sprintf("VirtualHosts[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
tmp := m.GetVhds()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return RouteConfigurationValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "Vhds",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-07 12:10:43 +00:00
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
if len(m.GetResponseHeadersToAdd()) > 1000 {
|
|
|
|
return RouteConfigurationValidationError{
|
|
|
|
field: "ResponseHeadersToAdd",
|
|
|
|
reason: "value must contain no more than 1000 item(s)",
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for idx, item := range m.GetResponseHeadersToAdd() {
|
|
|
|
_, _ = idx, item
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := item
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return RouteConfigurationValidationError{
|
|
|
|
field: fmt.Sprintf("ResponseHeadersToAdd[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
if len(m.GetRequestHeadersToAdd()) > 1000 {
|
|
|
|
return RouteConfigurationValidationError{
|
|
|
|
field: "RequestHeadersToAdd",
|
|
|
|
reason: "value must contain no more than 1000 item(s)",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
for idx, item := range m.GetRequestHeadersToAdd() {
|
|
|
|
_, _ = idx, item
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := item
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return RouteConfigurationValidationError{
|
|
|
|
field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetValidateClusters()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return RouteConfigurationValidationError{
|
|
|
|
field: "ValidateClusters",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RouteConfigurationValidationError is the validation error returned by
|
|
|
|
// RouteConfiguration.Validate if the designated constraints aren't met.
|
|
|
|
type RouteConfigurationValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e RouteConfigurationValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e RouteConfigurationValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e RouteConfigurationValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e RouteConfigurationValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e RouteConfigurationValidationError) ErrorName() string {
|
|
|
|
return "RouteConfigurationValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e RouteConfigurationValidationError) Error() string {
|
|
|
|
cause := ""
|
2019-06-07 12:10:43 +00:00
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
2019-06-07 12:10:43 +00:00
|
|
|
if e.key {
|
2018-10-03 18:18:55 +00:00
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
|
|
|
"invalid %sRouteConfiguration.%s: %s%s",
|
|
|
|
key,
|
2019-06-07 12:10:43 +00:00
|
|
|
e.field,
|
|
|
|
e.reason,
|
2018-10-03 18:18:55 +00:00
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = RouteConfigurationValidationError{}
|
2019-06-07 12:10:43 +00:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = RouteConfigurationValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on Vhds with the rules defined in the proto
|
|
|
|
// definition for this message. If any rules are violated, an error is returned.
|
|
|
|
func (m *Vhds) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
tmp := m.GetConfigSource()
|
|
|
|
|
|
|
|
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return VhdsValidationError{
|
|
|
|
field: "ConfigSource",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// VhdsValidationError is the validation error returned by Vhds.Validate if the
|
|
|
|
// designated constraints aren't met.
|
|
|
|
type VhdsValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e VhdsValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e VhdsValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e VhdsValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e VhdsValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e VhdsValidationError) ErrorName() string { return "VhdsValidationError" }
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e VhdsValidationError) Error() string {
|
|
|
|
cause := ""
|
|
|
|
if e.cause != nil {
|
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
key := ""
|
|
|
|
if e.key {
|
|
|
|
key = "key for "
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
|
|
|
"invalid %sVhds.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = VhdsValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = VhdsValidationError{}
|