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/cds.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 Cluster with the rules defined in the
|
|
|
|
// proto definition for this message. If any rules are violated, an error is returned.
|
|
|
|
func (m *Cluster) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(m.GetName()) < 1 {
|
|
|
|
return ClusterValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "Name",
|
|
|
|
reason: "value length must be at least 1 bytes",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for AltStatName
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetEdsClusterConfig()
|
2018-10-03 18:18:55 +00:00
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "EdsClusterConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if true {
|
|
|
|
dur := m.GetConnectTimeout()
|
|
|
|
|
|
|
|
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
|
|
|
|
|
|
|
|
if dur <= gt {
|
|
|
|
return ClusterValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "ConnectTimeout",
|
|
|
|
reason: "value must be greater than 0s",
|
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 ClusterValidationError{
|
|
|
|
field: "PerConnectionBufferLimitBytes",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if _, ok := Cluster_LbPolicy_name[int32(m.GetLbPolicy())]; !ok {
|
|
|
|
return ClusterValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "LbPolicy",
|
|
|
|
reason: "value must be one of the defined enum values",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for idx, item := range m.GetHosts() {
|
|
|
|
_, _ = 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 ClusterValidationError{
|
|
|
|
field: fmt.Sprintf("Hosts[%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.GetLoadAssignment()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "LoadAssignment",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for idx, item := range m.GetHealthChecks() {
|
|
|
|
_, _ = 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 ClusterValidationError{
|
|
|
|
field: fmt.Sprintf("HealthChecks[%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.GetMaxRequestsPerConnection()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "MaxRequestsPerConnection",
|
|
|
|
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.GetCircuitBreakers()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "CircuitBreakers",
|
|
|
|
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.GetTlsContext()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "TlsContext",
|
|
|
|
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.GetCommonHttpProtocolOptions()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "CommonHttpProtocolOptions",
|
|
|
|
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.GetHttpProtocolOptions()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "HttpProtocolOptions",
|
|
|
|
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.GetHttp2ProtocolOptions()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "Http2ProtocolOptions",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for ExtensionProtocolOptions
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
// no validation rules for TypedExtensionProtocolOptions
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
if d := m.GetDnsRefreshRate(); d != nil {
|
|
|
|
dur := *d
|
|
|
|
|
|
|
|
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
|
|
|
|
|
|
|
|
if dur <= gt {
|
|
|
|
return ClusterValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "DnsRefreshRate",
|
|
|
|
reason: "value must be greater than 0s",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if _, ok := Cluster_DnsLookupFamily_name[int32(m.GetDnsLookupFamily())]; !ok {
|
|
|
|
return ClusterValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "DnsLookupFamily",
|
|
|
|
reason: "value must be one of the defined enum values",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for idx, item := range m.GetDnsResolvers() {
|
|
|
|
_, _ = 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 ClusterValidationError{
|
|
|
|
field: fmt.Sprintf("DnsResolvers[%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.GetOutlierDetection()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "OutlierDetection",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if d := m.GetCleanupInterval(); d != nil {
|
|
|
|
dur := *d
|
|
|
|
|
|
|
|
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
|
|
|
|
|
|
|
|
if dur <= gt {
|
|
|
|
return ClusterValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "CleanupInterval",
|
|
|
|
reason: "value must be greater than 0s",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetUpstreamBindConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "UpstreamBindConfig",
|
|
|
|
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.GetLbSubsetConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "LbSubsetConfig",
|
|
|
|
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.GetCommonLbConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "CommonLbConfig",
|
|
|
|
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.GetTransportSocket()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "TransportSocket",
|
|
|
|
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 ClusterValidationError{
|
|
|
|
field: "Metadata",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for ProtocolSelection
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetUpstreamConnectionOptions()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "UpstreamConnectionOptions",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for CloseConnectionsOnHostHealthFailure
|
|
|
|
|
|
|
|
// no validation rules for DrainConnectionsOnHostRemoval
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
switch m.ClusterDiscoveryType.(type) {
|
|
|
|
|
|
|
|
case *Cluster_Type:
|
|
|
|
|
|
|
|
if _, ok := Cluster_DiscoveryType_name[int32(m.GetType())]; !ok {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "Type",
|
|
|
|
reason: "value must be one of the defined enum values",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case *Cluster_ClusterType:
|
|
|
|
|
|
|
|
{
|
|
|
|
tmp := m.GetClusterType()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "ClusterType",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
switch m.LbConfig.(type) {
|
|
|
|
|
|
|
|
case *Cluster_RingHashLbConfig_:
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetRingHashLbConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "RingHashLbConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case *Cluster_OriginalDstLbConfig_:
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetOriginalDstLbConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "OriginalDstLbConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case *Cluster_LeastRequestLbConfig_:
|
|
|
|
|
|
|
|
{
|
|
|
|
tmp := m.GetLeastRequestLbConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return ClusterValidationError{
|
|
|
|
field: "LeastRequestLbConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ClusterValidationError is the validation error returned by Cluster.Validate
|
|
|
|
// if the designated constraints aren't met.
|
|
|
|
type ClusterValidationError 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 ClusterValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e ClusterValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e ClusterValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e ClusterValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e ClusterValidationError) ErrorName() string { return "ClusterValidationError" }
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e ClusterValidationError) 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 %sCluster.%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 = ClusterValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = ClusterValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on UpstreamBindConfig with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *UpstreamBindConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetSourceAddress()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return UpstreamBindConfigValidationError{
|
|
|
|
field: "SourceAddress",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// UpstreamBindConfigValidationError is the validation error returned by
|
|
|
|
// UpstreamBindConfig.Validate if the designated constraints aren't met.
|
|
|
|
type UpstreamBindConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e UpstreamBindConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e UpstreamBindConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e UpstreamBindConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e UpstreamBindConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e UpstreamBindConfigValidationError) ErrorName() string {
|
|
|
|
return "UpstreamBindConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e UpstreamBindConfigValidationError) 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 %sUpstreamBindConfig.%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 = UpstreamBindConfigValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = UpstreamBindConfigValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on UpstreamConnectionOptions with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *UpstreamConnectionOptions) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetTcpKeepalive()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return UpstreamConnectionOptionsValidationError{
|
|
|
|
field: "TcpKeepalive",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// UpstreamConnectionOptionsValidationError is the validation error returned by
|
|
|
|
// UpstreamConnectionOptions.Validate if the designated constraints aren't met.
|
|
|
|
type UpstreamConnectionOptionsValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e UpstreamConnectionOptionsValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e UpstreamConnectionOptionsValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e UpstreamConnectionOptionsValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e UpstreamConnectionOptionsValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e UpstreamConnectionOptionsValidationError) ErrorName() string {
|
|
|
|
return "UpstreamConnectionOptionsValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e UpstreamConnectionOptionsValidationError) 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 %sUpstreamConnectionOptions.%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 = UpstreamConnectionOptionsValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = UpstreamConnectionOptionsValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on Cluster_CustomClusterType with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Cluster_CustomClusterType) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(m.GetName()) < 1 {
|
|
|
|
return Cluster_CustomClusterTypeValidationError{
|
|
|
|
field: "Name",
|
|
|
|
reason: "value length must be at least 1 bytes",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
tmp := m.GetTypedConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_CustomClusterTypeValidationError{
|
|
|
|
field: "TypedConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_CustomClusterTypeValidationError is the validation error returned by
|
|
|
|
// Cluster_CustomClusterType.Validate if the designated constraints aren't met.
|
|
|
|
type Cluster_CustomClusterTypeValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_CustomClusterTypeValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_CustomClusterTypeValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_CustomClusterTypeValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_CustomClusterTypeValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_CustomClusterTypeValidationError) ErrorName() string {
|
|
|
|
return "Cluster_CustomClusterTypeValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_CustomClusterTypeValidationError) 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 %sCluster_CustomClusterType.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = Cluster_CustomClusterTypeValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_CustomClusterTypeValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on Cluster_EdsClusterConfig with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Cluster_EdsClusterConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetEdsConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_EdsClusterConfigValidationError{
|
|
|
|
field: "EdsConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for ServiceName
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_EdsClusterConfigValidationError is the validation error returned by
|
|
|
|
// Cluster_EdsClusterConfig.Validate if the designated constraints aren't met.
|
|
|
|
type Cluster_EdsClusterConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_EdsClusterConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_EdsClusterConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_EdsClusterConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_EdsClusterConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_EdsClusterConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_EdsClusterConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_EdsClusterConfigValidationError) 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 %sCluster_EdsClusterConfig.%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 = Cluster_EdsClusterConfigValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_EdsClusterConfigValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on Cluster_LbSubsetConfig with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Cluster_LbSubsetConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if _, ok := Cluster_LbSubsetConfig_LbSubsetFallbackPolicy_name[int32(m.GetFallbackPolicy())]; !ok {
|
|
|
|
return Cluster_LbSubsetConfigValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "FallbackPolicy",
|
|
|
|
reason: "value must be one of the defined enum values",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetDefaultSubset()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_LbSubsetConfigValidationError{
|
|
|
|
field: "DefaultSubset",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for idx, item := range m.GetSubsetSelectors() {
|
|
|
|
_, _ = 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 Cluster_LbSubsetConfigValidationError{
|
|
|
|
field: fmt.Sprintf("SubsetSelectors[%v]", idx),
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for LocalityWeightAware
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
// no validation rules for ScaleLocalityWeight
|
|
|
|
|
|
|
|
// no validation rules for PanicModeAny
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_LbSubsetConfigValidationError is the validation error returned by
|
|
|
|
// Cluster_LbSubsetConfig.Validate if the designated constraints aren't met.
|
|
|
|
type Cluster_LbSubsetConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_LbSubsetConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_LbSubsetConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_LbSubsetConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_LbSubsetConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_LbSubsetConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_LbSubsetConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_LbSubsetConfigValidationError) 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 %sCluster_LbSubsetConfig.%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 = Cluster_LbSubsetConfigValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_LbSubsetConfigValidationError{}
|
|
|
|
|
|
|
|
// Validate checks the field values on Cluster_LeastRequestLbConfig with the
|
|
|
|
// rules defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Cluster_LeastRequestLbConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if wrapper := m.GetChoiceCount(); wrapper != nil {
|
|
|
|
|
|
|
|
if wrapper.GetValue() < 2 {
|
|
|
|
return Cluster_LeastRequestLbConfigValidationError{
|
|
|
|
field: "ChoiceCount",
|
|
|
|
reason: "value must be greater than or equal to 2",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_LeastRequestLbConfigValidationError is the validation error returned
|
|
|
|
// by Cluster_LeastRequestLbConfig.Validate if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type Cluster_LeastRequestLbConfigValidationError struct {
|
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_LeastRequestLbConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_LeastRequestLbConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_LeastRequestLbConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_LeastRequestLbConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_LeastRequestLbConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_LeastRequestLbConfigValidationError"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_LeastRequestLbConfigValidationError) 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 %sCluster_LeastRequestLbConfig.%s: %s%s",
|
|
|
|
key,
|
|
|
|
e.field,
|
|
|
|
e.reason,
|
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ error = Cluster_LeastRequestLbConfigValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_LeastRequestLbConfigValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on Cluster_RingHashLbConfig with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Cluster_RingHashLbConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if wrapper := m.GetMinimumRingSize(); wrapper != nil {
|
|
|
|
|
|
|
|
if wrapper.GetValue() > 8388608 {
|
|
|
|
return Cluster_RingHashLbConfigValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "MinimumRingSize",
|
|
|
|
reason: "value must be less than or equal to 8388608",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
if _, ok := Cluster_RingHashLbConfig_HashFunction_name[int32(m.GetHashFunction())]; !ok {
|
|
|
|
return Cluster_RingHashLbConfigValidationError{
|
|
|
|
field: "HashFunction",
|
|
|
|
reason: "value must be one of the defined enum values",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if wrapper := m.GetMaximumRingSize(); wrapper != nil {
|
|
|
|
|
|
|
|
if wrapper.GetValue() > 8388608 {
|
2018-10-03 18:18:55 +00:00
|
|
|
return Cluster_RingHashLbConfigValidationError{
|
2019-06-07 12:10:43 +00:00
|
|
|
field: "MaximumRingSize",
|
|
|
|
reason: "value must be less than or equal to 8388608",
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
2019-06-07 12:10:43 +00:00
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_RingHashLbConfigValidationError is the validation error returned by
|
|
|
|
// Cluster_RingHashLbConfig.Validate if the designated constraints aren't met.
|
|
|
|
type Cluster_RingHashLbConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_RingHashLbConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_RingHashLbConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_RingHashLbConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_RingHashLbConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_RingHashLbConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_RingHashLbConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_RingHashLbConfigValidationError) 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 %sCluster_RingHashLbConfig.%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 = Cluster_RingHashLbConfigValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_RingHashLbConfigValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on Cluster_OriginalDstLbConfig with the
|
|
|
|
// rules defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Cluster_OriginalDstLbConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// no validation rules for UseHttpHeader
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_OriginalDstLbConfigValidationError is the validation error returned
|
|
|
|
// by Cluster_OriginalDstLbConfig.Validate if the designated constraints
|
|
|
|
// aren't met.
|
|
|
|
type Cluster_OriginalDstLbConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_OriginalDstLbConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_OriginalDstLbConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_OriginalDstLbConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_OriginalDstLbConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_OriginalDstLbConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_OriginalDstLbConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_OriginalDstLbConfigValidationError) 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 %sCluster_OriginalDstLbConfig.%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 = Cluster_OriginalDstLbConfigValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_OriginalDstLbConfigValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on Cluster_CommonLbConfig with the rules
|
|
|
|
// defined in the proto definition for this message. If any rules are
|
|
|
|
// violated, an error is returned.
|
|
|
|
func (m *Cluster_CommonLbConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetHealthyPanicThreshold()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_CommonLbConfigValidationError{
|
|
|
|
field: "HealthyPanicThreshold",
|
|
|
|
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.GetUpdateMergeWindow()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_CommonLbConfigValidationError{
|
|
|
|
field: "UpdateMergeWindow",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
switch m.LocalityConfigSpecifier.(type) {
|
|
|
|
|
|
|
|
case *Cluster_CommonLbConfig_ZoneAwareLbConfig_:
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetZoneAwareLbConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_CommonLbConfigValidationError{
|
|
|
|
field: "ZoneAwareLbConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case *Cluster_CommonLbConfig_LocalityWeightedLbConfig_:
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetLocalityWeightedLbConfig()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_CommonLbConfigValidationError{
|
|
|
|
field: "LocalityWeightedLbConfig",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_CommonLbConfigValidationError is the validation error returned by
|
|
|
|
// Cluster_CommonLbConfig.Validate if the designated constraints aren't met.
|
|
|
|
type Cluster_CommonLbConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_CommonLbConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_CommonLbConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_CommonLbConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_CommonLbConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_CommonLbConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_CommonLbConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_CommonLbConfigValidationError) 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 %sCluster_CommonLbConfig.%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 = Cluster_CommonLbConfigValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_CommonLbConfigValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on Cluster_LbSubsetConfig_LbSubsetSelector
|
|
|
|
// with the rules defined in the proto definition for this message. If any
|
|
|
|
// rules are violated, an error is returned.
|
|
|
|
func (m *Cluster_LbSubsetConfig_LbSubsetSelector) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_LbSubsetConfig_LbSubsetSelectorValidationError is the validation
|
|
|
|
// error returned by Cluster_LbSubsetConfig_LbSubsetSelector.Validate if the
|
|
|
|
// designated constraints aren't met.
|
|
|
|
type Cluster_LbSubsetConfig_LbSubsetSelectorValidationError 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 Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Field() string { return e.field }
|
2018-10-03 18:18:55 +00:00
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Reason() string { return e.reason }
|
2018-10-03 18:18:55 +00:00
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Cause() error { return e.cause }
|
2018-10-03 18:18:55 +00:00
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Key() bool { return e.key }
|
2018-10-03 18:18:55 +00:00
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) ErrorName() string {
|
|
|
|
return "Cluster_LbSubsetConfig_LbSubsetSelectorValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
2019-06-07 12:10:43 +00:00
|
|
|
func (e Cluster_LbSubsetConfig_LbSubsetSelectorValidationError) Error() string {
|
2018-10-03 18:18:55 +00:00
|
|
|
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(
|
2019-06-07 12:10:43 +00:00
|
|
|
"invalid %sCluster_LbSubsetConfig_LbSubsetSelector.%s: %s%s",
|
2018-10-03 18:18:55 +00:00
|
|
|
key,
|
2019-06-07 12:10:43 +00:00
|
|
|
e.field,
|
|
|
|
e.reason,
|
2018-10-03 18:18:55 +00:00
|
|
|
cause)
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ error = Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{}
|
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_LbSubsetConfig_LbSubsetSelectorValidationError{}
|
2018-10-03 18:18:55 +00:00
|
|
|
|
|
|
|
// Validate checks the field values on Cluster_CommonLbConfig_ZoneAwareLbConfig
|
|
|
|
// with the rules defined in the proto definition for this message. If any
|
|
|
|
// rules are violated, an error is returned.
|
|
|
|
func (m *Cluster_CommonLbConfig_ZoneAwareLbConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
{
|
|
|
|
tmp := m.GetRoutingEnabled()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{
|
|
|
|
field: "RoutingEnabled",
|
|
|
|
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.GetMinClusterSize()
|
|
|
|
|
|
|
|
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
|
|
|
|
|
|
|
|
if err := v.Validate(); err != nil {
|
|
|
|
return Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{
|
|
|
|
field: "MinClusterSize",
|
|
|
|
reason: "embedded message failed validation",
|
|
|
|
cause: err,
|
|
|
|
}
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError is the validation
|
|
|
|
// error returned by Cluster_CommonLbConfig_ZoneAwareLbConfig.Validate if the
|
|
|
|
// designated constraints aren't met.
|
|
|
|
type Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Reason() string { return e.reason }
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError) 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 %sCluster_CommonLbConfig_ZoneAwareLbConfig.%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 = Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{}
|
|
|
|
|
2019-06-07 12:10:43 +00:00
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_CommonLbConfig_ZoneAwareLbConfigValidationError{}
|
|
|
|
|
2018-10-03 18:18:55 +00:00
|
|
|
// Validate checks the field values on
|
|
|
|
// Cluster_CommonLbConfig_LocalityWeightedLbConfig with the rules defined in
|
|
|
|
// the proto definition for this message. If any rules are violated, an error
|
|
|
|
// is returned.
|
|
|
|
func (m *Cluster_CommonLbConfig_LocalityWeightedLbConfig) Validate() error {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError is the
|
|
|
|
// validation error returned by
|
|
|
|
// Cluster_CommonLbConfig_LocalityWeightedLbConfig.Validate if the designated
|
|
|
|
// constraints aren't met.
|
|
|
|
type Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError struct {
|
2019-06-07 12:10:43 +00:00
|
|
|
field string
|
|
|
|
reason string
|
|
|
|
cause error
|
|
|
|
key bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// Field function returns field value.
|
|
|
|
func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Field() string { return e.field }
|
|
|
|
|
|
|
|
// Reason function returns reason value.
|
|
|
|
func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Reason() string {
|
|
|
|
return e.reason
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cause function returns cause value.
|
|
|
|
func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Cause() error { return e.cause }
|
|
|
|
|
|
|
|
// Key function returns key value.
|
|
|
|
func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) Key() bool { return e.key }
|
|
|
|
|
|
|
|
// ErrorName returns error name.
|
|
|
|
func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) ErrorName() string {
|
|
|
|
return "Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError"
|
2018-10-03 18:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Error satisfies the builtin error interface
|
|
|
|
func (e Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError) 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 %sCluster_CommonLbConfig_LocalityWeightedLbConfig.%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 = Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError{}
|
2019-06-07 12:10:43 +00:00
|
|
|
|
|
|
|
var _ interface {
|
|
|
|
Field() string
|
|
|
|
Reason() string
|
|
|
|
Key() bool
|
|
|
|
Cause() error
|
|
|
|
ErrorName() string
|
|
|
|
} = Cluster_CommonLbConfig_LocalityWeightedLbConfigValidationError{}
|