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/lds.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 Listener with the rules defined in the
|
|
|
|
// proto definition for this message. If any rules are violated, an error is returned.
|
|
|
|
func (m *Listener) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for Name
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetAddress()
|
|
|
|
|
|
|
|
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "Address",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(m.GetFilterChains()) < 1 {
|
|
|
|
return ListenerValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "FilterChains",
|
|
|
|
reason: "value must contain at least 1 item(s)",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for idx, item := range m.GetFilterChains() {
|
|
|
|
_, _ = 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 ListenerValidationError{
|
|
|
|
field: fmt.Sprintf("FilterChains[%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.GetUseOriginalDst()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "UseOriginalDst",
|
|
|
|
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.GetPerConnectionBufferLimitBytes()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "PerConnectionBufferLimitBytes",
|
|
|
|
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.GetMetadata()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "Metadata",
|
|
|
|
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.GetDeprecatedV1()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "DeprecatedV1",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for DrainType
|
|
|
|
|
|
|
|
for idx, item := range m.GetListenerFilters() {
|
|
|
|
_, _ = 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 ListenerValidationError{
|
|
|
|
field: fmt.Sprintf("ListenerFilters[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
tmp := m.GetListenerFiltersTimeout()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "ListenerFiltersTimeout",
|
|
|
|
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.GetTransparent()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "Transparent",
|
|
|
|
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.GetFreebind()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "Freebind",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for idx, item := range m.GetSocketOptions() {
|
|
|
|
_, _ = 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 ListenerValidationError{
|
|
|
|
field: fmt.Sprintf("SocketOptions[%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.GetTcpFastOpenQueueLength()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ListenerValidationError{
|
|
|
|
field: "TcpFastOpenQueueLength",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ListenerValidationError is the validation error returned by
|
|
|
|
// Listener.Validate if the designated constraints aren't met.
|
|
|
|
type ListenerValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
// Field function returns field value.
|
|
|
|
func (e ListenerValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e ListenerValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e ListenerValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e ListenerValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e ListenerValidationError) ErrorName() string { return "ListenerValidationError" }
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e ListenerValidationError) 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 %sListener.%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 = ListenerValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = ListenerValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on Listener_DeprecatedV1 with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Listener_DeprecatedV1) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetBindToPort()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Listener_DeprecatedV1ValidationError{
|
|
|
|
field: "BindToPort",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Listener_DeprecatedV1ValidationError is the validation error returned by
|
|
|
|
// Listener_DeprecatedV1.Validate if the designated constraints aren't met.
|
|
|
|
type Listener_DeprecatedV1ValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Listener_DeprecatedV1ValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Listener_DeprecatedV1ValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Listener_DeprecatedV1ValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Listener_DeprecatedV1ValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Listener_DeprecatedV1ValidationError) ErrorName() string {
|
|
|
|
return "Listener_DeprecatedV1ValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Listener_DeprecatedV1ValidationError) 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 %sListener_DeprecatedV1.%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 = Listener_DeprecatedV1ValidationError{}
|
2019-06-07 12:10:43 +00:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Listener_DeprecatedV1ValidationError{}
|