connect: upgrade github.com/envoyproxy/go-control-plane to v0.9.5 (#8247)

cherry-pick of #8165 onto origin/release/1.8.x
This commit is contained in:
R.B. Boyer 2020-07-07 16:22:30 -05:00 committed by GitHub
parent 03ce368a61
commit 8a5680aaf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
232 changed files with 46056 additions and 97595 deletions

View File

@ -4,7 +4,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/hashicorp/consul/logging"
"time"
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
@ -13,13 +12,14 @@ import (
envoycore "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
envoyendpoint "github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint"
envoytype "github.com/envoyproxy/go-control-plane/envoy/type"
"github.com/gogo/protobuf/jsonpb"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/agent/proxycfg"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/logging"
)
// clustersFromSnapshot returns the xDS API representation of the "clusters" in the snapshot.
@ -314,13 +314,13 @@ func (s *Server) makeAppCluster(cfgSnap *proxycfg.ConfigSnapshot, name, pathProt
}
c = &envoy.Cluster{
Name: name,
ConnectTimeout: time.Duration(cfg.LocalConnectTimeoutMs) * time.Millisecond,
ConnectTimeout: ptypes.DurationProto(time.Duration(cfg.LocalConnectTimeoutMs) * time.Millisecond),
ClusterDiscoveryType: &envoy.Cluster_Type{Type: envoy.Cluster_STATIC},
LoadAssignment: &envoy.ClusterLoadAssignment{
ClusterName: name,
Endpoints: []envoyendpoint.LocalityLbEndpoints{
Endpoints: []*envoyendpoint.LocalityLbEndpoints{
{
LbEndpoints: []envoyendpoint.LbEndpoint{
LbEndpoints: []*envoyendpoint.LbEndpoint{
makeEndpoint(name,
addr,
port),
@ -367,7 +367,7 @@ func (s *Server) makeUpstreamClusterForPreparedQuery(upstream structs.Upstream,
if c == nil {
c = &envoy.Cluster{
Name: sni,
ConnectTimeout: time.Duration(cfg.ConnectTimeoutMs) * time.Millisecond,
ConnectTimeout: ptypes.DurationProto(time.Duration(cfg.ConnectTimeoutMs) * time.Millisecond),
ClusterDiscoveryType: &envoy.Cluster_Type{Type: envoy.Cluster_EDS},
EdsClusterConfig: &envoy.Cluster_EdsClusterConfig{
EdsConfig: &envoycore.ConfigSource{
@ -463,7 +463,7 @@ func (s *Server) makeUpstreamClustersForDiscoveryChain(
c := &envoy.Cluster{
Name: clusterName,
AltStatName: clusterName,
ConnectTimeout: node.Resolver.ConnectTimeout,
ConnectTimeout: ptypes.DurationProto(node.Resolver.ConnectTimeout),
ClusterDiscoveryType: &envoy.Cluster_Type{Type: envoy.Cluster_EDS},
CommonLbConfig: &envoy.Cluster_CommonLbConfig{
HealthyPanicThreshold: &envoytype.Percent{
@ -548,7 +548,7 @@ func makeClusterFromUserConfig(configJSON string) (*envoy.Cluster, error) {
if _, ok := jsonFields["@type"]; ok {
// Type field is present so decode it as a types.Any
var any types.Any
var any any.Any
err := jsonpb.UnmarshalString(configJSON, &any)
if err != nil {
return nil, err
@ -597,7 +597,7 @@ func (s *Server) makeGatewayCluster(snap *proxycfg.ConfigSnapshot, opts gatewayC
cluster := &envoy.Cluster{
Name: opts.name,
ConnectTimeout: opts.connectTimeout,
ConnectTimeout: ptypes.DurationProto(opts.connectTimeout),
// Having an empty config enables outlier detection with default config.
OutlierDetection: &envoycluster.OutlierDetection{},
@ -624,7 +624,7 @@ func (s *Server) makeGatewayCluster(snap *proxycfg.ConfigSnapshot, opts gatewayC
// When a service instance is addressed by a hostname we have Envoy do the DNS resolution
// by setting a DNS cluster type and passing the hostname endpoints via CDS.
rate := 10 * time.Second
cluster.DnsRefreshRate = &rate
cluster.DnsRefreshRate = ptypes.DurationProto(rate)
cluster.DnsLookupFamily = envoy.Cluster_V4_ONLY
discoveryType := envoy.Cluster_Type{Type: envoy.Cluster_LOGICAL_DNS}
@ -633,13 +633,13 @@ func (s *Server) makeGatewayCluster(snap *proxycfg.ConfigSnapshot, opts gatewayC
}
cluster.ClusterDiscoveryType = &discoveryType
endpoints := make([]envoyendpoint.LbEndpoint, 0, 1)
endpoints := make([]*envoyendpoint.LbEndpoint, 0, 1)
uniqueHostnames := make(map[string]bool)
var (
hostname string
idx int
fallback envoyendpoint.LbEndpoint
fallback *envoyendpoint.LbEndpoint
)
for i, e := range opts.hostnameEndpoints {
addr, port := e.BestAddress(opts.isRemote)
@ -683,7 +683,7 @@ func (s *Server) makeGatewayCluster(snap *proxycfg.ConfigSnapshot, opts gatewayC
cluster.LoadAssignment = &envoy.ClusterLoadAssignment{
ClusterName: cluster.Name,
Endpoints: []envoyendpoint.LocalityLbEndpoints{
Endpoints: []*envoyendpoint.LocalityLbEndpoints{
{
LbEndpoints: endpoints,
},
@ -728,8 +728,8 @@ func makeThresholdsIfNeeded(limits UpstreamLimits) []*envoycluster.CircuitBreake
return []*envoycluster.CircuitBreakers_Thresholds{threshold}
}
func makeLbEndpoint(addr string, port int, health envoycore.HealthStatus, weight int) envoyendpoint.LbEndpoint {
return envoyendpoint.LbEndpoint{
func makeLbEndpoint(addr string, port int, health envoycore.HealthStatus, weight int) *envoyendpoint.LbEndpoint {
return &envoyendpoint.LbEndpoint{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: &envoycore.Address{

View File

@ -5,7 +5,8 @@ import (
"time"
envoycluster "github.com/envoyproxy/go-control-plane/envoy/api/v2/cluster"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/wrappers"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/lib/decode"
"github.com/mitchellh/mapstructure"
@ -211,10 +212,10 @@ type PassiveHealthCheck struct {
func (p PassiveHealthCheck) AsOutlierDetection() *envoycluster.OutlierDetection {
od := &envoycluster.OutlierDetection{}
if p.Interval != 0 {
od.Interval = types.DurationProto(p.Interval)
od.Interval = ptypes.DurationProto(p.Interval)
}
if p.MaxFailures != 0 {
od.Consecutive_5Xx = &types.UInt32Value{Value: p.MaxFailures}
od.Consecutive_5Xx = &wrappers.UInt32Value{Value: p.MaxFailures}
}
return od
}

View File

@ -3,16 +3,15 @@ package xds
import (
"errors"
"fmt"
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
envoycore "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
envoyendpoint "github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint"
"github.com/gogo/protobuf/proto"
"github.com/golang/protobuf/proto"
"github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/agent/proxycfg"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/api"
bexpr "github.com/hashicorp/go-bexpr"
)
@ -162,17 +161,17 @@ func (s *Server) endpointsFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapsh
// generate endpoints for our servers if WAN federation is enabled
if cfgSnap.ServiceMeta[structs.MetaWANFederationKey] == "1" && cfgSnap.ServerSNIFn != nil {
var allServersLbEndpoints []envoyendpoint.LbEndpoint
var allServersLbEndpoints []*envoyendpoint.LbEndpoint
for _, srv := range cfgSnap.MeshGateway.ConsulServers {
clusterName := cfgSnap.ServerSNIFn(cfgSnap.Datacenter, srv.Node.Node)
addr, port := srv.BestAddress(false /*wan*/)
lbEndpoint := envoyendpoint.LbEndpoint{
lbEndpoint := &envoyendpoint.LbEndpoint{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr(addr, port),
Address: makeAddress(addr, port),
},
},
HealthStatus: envoycore.HealthStatus_UNKNOWN,
@ -180,8 +179,8 @@ func (s *Server) endpointsFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapsh
cla := &envoy.ClusterLoadAssignment{
ClusterName: clusterName,
Endpoints: []envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []envoyendpoint.LbEndpoint{lbEndpoint},
Endpoints: []*envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []*envoyendpoint.LbEndpoint{lbEndpoint},
}},
}
allServersLbEndpoints = append(allServersLbEndpoints, lbEndpoint)
@ -193,7 +192,7 @@ func (s *Server) endpointsFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapsh
// in this datacenter without knowing its name.
resources = append(resources, &envoy.ClusterLoadAssignment{
ClusterName: cfgSnap.ServerSNIFn(cfgSnap.Datacenter, ""),
Endpoints: []envoyendpoint.LocalityLbEndpoints{{
Endpoints: []*envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: allServersLbEndpoints,
}},
})
@ -289,11 +288,11 @@ func (s *Server) endpointsFromSnapshotIngressGateway(cfgSnap *proxycfg.ConfigSna
return resources, nil
}
func makeEndpoint(clusterName, host string, port int) envoyendpoint.LbEndpoint {
return envoyendpoint.LbEndpoint{
func makeEndpoint(clusterName, host string, port int) *envoyendpoint.LbEndpoint {
return &envoyendpoint.LbEndpoint{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr(host, port),
Address: makeAddress(host, port),
},
},
}
@ -423,7 +422,7 @@ type loadAssignmentEndpointGroup struct {
func makeLoadAssignment(clusterName string, endpointGroups []loadAssignmentEndpointGroup, localDatacenter string) *envoy.ClusterLoadAssignment {
cla := &envoy.ClusterLoadAssignment{
ClusterName: clusterName,
Endpoints: make([]envoyendpoint.LocalityLbEndpoints, 0, len(endpointGroups)),
Endpoints: make([]*envoyendpoint.LocalityLbEndpoints, 0, len(endpointGroups)),
}
if len(endpointGroups) > 1 {
@ -436,7 +435,7 @@ func makeLoadAssignment(clusterName string, endpointGroups []loadAssignmentEndpo
for priority, endpointGroup := range endpointGroups {
endpoints := endpointGroup.Endpoints
es := make([]envoyendpoint.LbEndpoint, 0, len(endpoints))
es := make([]*envoyendpoint.LbEndpoint, 0, len(endpoints))
for _, ep := range endpoints {
// TODO (mesh-gateway) - should we respect the translate_wan_addrs configuration here or just always use the wan for cross-dc?
@ -447,10 +446,10 @@ func makeLoadAssignment(clusterName string, endpointGroups []loadAssignmentEndpo
healthStatus = endpointGroup.OverrideHealth
}
es = append(es, envoyendpoint.LbEndpoint{
es = append(es, &envoyendpoint.LbEndpoint{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr(addr, port),
Address: makeAddress(addr, port),
},
},
HealthStatus: healthStatus,
@ -458,7 +457,7 @@ func makeLoadAssignment(clusterName string, endpointGroups []loadAssignmentEndpo
})
}
cla.Endpoints = append(cla.Endpoints, envoyendpoint.LocalityLbEndpoints{
cla.Endpoints = append(cla.Endpoints, &envoyendpoint.LocalityLbEndpoints{
Priority: uint32(priority),
LbEndpoints: es,
})

View File

@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
"github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
envoycore "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
envoyendpoint "github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint"
"github.com/hashicorp/consul/agent/proxycfg"
"github.com/hashicorp/consul/agent/structs"
@ -108,8 +108,8 @@ func Test_makeLoadAssignment(t *testing.T) {
},
want: &envoy.ClusterLoadAssignment{
ClusterName: "service:test",
Endpoints: []envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []envoyendpoint.LbEndpoint{},
Endpoints: []*envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []*envoyendpoint.LbEndpoint{},
}},
},
},
@ -121,22 +121,22 @@ func Test_makeLoadAssignment(t *testing.T) {
},
want: &envoy.ClusterLoadAssignment{
ClusterName: "service:test",
Endpoints: []envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []envoyendpoint.LbEndpoint{
envoyendpoint.LbEndpoint{
Endpoints: []*envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []*envoyendpoint.LbEndpoint{
{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr("10.10.10.10", 1234),
Address: makeAddress("10.10.10.10", 1234),
}},
HealthStatus: core.HealthStatus_HEALTHY,
HealthStatus: envoycore.HealthStatus_HEALTHY,
LoadBalancingWeight: makeUint32Value(1),
},
envoyendpoint.LbEndpoint{
{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr("10.10.10.20", 1234),
Address: makeAddress("10.10.10.20", 1234),
}},
HealthStatus: core.HealthStatus_HEALTHY,
HealthStatus: envoycore.HealthStatus_HEALTHY,
LoadBalancingWeight: makeUint32Value(1),
},
},
@ -151,22 +151,22 @@ func Test_makeLoadAssignment(t *testing.T) {
},
want: &envoy.ClusterLoadAssignment{
ClusterName: "service:test",
Endpoints: []envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []envoyendpoint.LbEndpoint{
envoyendpoint.LbEndpoint{
Endpoints: []*envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []*envoyendpoint.LbEndpoint{
{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr("10.10.10.10", 1234),
Address: makeAddress("10.10.10.10", 1234),
}},
HealthStatus: core.HealthStatus_HEALTHY,
HealthStatus: envoycore.HealthStatus_HEALTHY,
LoadBalancingWeight: makeUint32Value(10),
},
envoyendpoint.LbEndpoint{
{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr("10.10.10.20", 1234),
Address: makeAddress("10.10.10.20", 1234),
}},
HealthStatus: core.HealthStatus_HEALTHY,
HealthStatus: envoycore.HealthStatus_HEALTHY,
LoadBalancingWeight: makeUint32Value(5),
},
},
@ -181,22 +181,22 @@ func Test_makeLoadAssignment(t *testing.T) {
},
want: &envoy.ClusterLoadAssignment{
ClusterName: "service:test",
Endpoints: []envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []envoyendpoint.LbEndpoint{
envoyendpoint.LbEndpoint{
Endpoints: []*envoyendpoint.LocalityLbEndpoints{{
LbEndpoints: []*envoyendpoint.LbEndpoint{
{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr("10.10.10.10", 1234),
Address: makeAddress("10.10.10.10", 1234),
}},
HealthStatus: core.HealthStatus_HEALTHY,
HealthStatus: envoycore.HealthStatus_HEALTHY,
LoadBalancingWeight: makeUint32Value(1),
},
envoyendpoint.LbEndpoint{
{
HostIdentifier: &envoyendpoint.LbEndpoint_Endpoint{
Endpoint: &envoyendpoint.Endpoint{
Address: makeAddressPtr("10.10.10.20", 1234),
Address: makeAddress("10.10.10.20", 1234),
}},
HealthStatus: core.HealthStatus_UNHEALTHY,
HealthStatus: envoycore.HealthStatus_UNHEALTHY,
LoadBalancingWeight: makeUint32Value(1),
},
},

View File

@ -7,8 +7,7 @@ import (
"testing"
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
"github.com/gogo/protobuf/jsonpb"
"github.com/golang/protobuf/jsonpb"
"github.com/stretchr/testify/require"
)

View File

@ -10,9 +10,6 @@ import (
"strconv"
"strings"
"github.com/hashicorp/consul/logging"
"github.com/hashicorp/go-hclog"
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
envoyauth "github.com/envoyproxy/go-control-plane/envoy/api/v2/auth"
envoycore "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
@ -22,14 +19,18 @@ import (
envoyhttp "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2"
envoytcp "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/tcp_proxy/v2"
envoytype "github.com/envoyproxy/go-control-plane/envoy/type"
"github.com/envoyproxy/go-control-plane/pkg/util"
"github.com/gogo/protobuf/jsonpb"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/types"
"github.com/envoyproxy/go-control-plane/pkg/conversion"
"github.com/envoyproxy/go-control-plane/pkg/wellknown"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/any"
pbstruct "github.com/golang/protobuf/ptypes/struct"
"github.com/golang/protobuf/ptypes/wrappers"
"github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/agent/proxycfg"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/consul/logging"
"github.com/hashicorp/go-hclog"
)
// listenersFromSnapshot returns the xDS API representation of the "listeners" in the snapshot.
@ -284,7 +285,7 @@ func (s *Server) makeIngressGatewayListeners(address string, cfgSnap *proxycfg.C
if cfgSnap.IngressGateway.TLSEnabled {
tlsContext = &envoyauth.DownstreamTlsContext{
CommonTlsContext: makeCommonTLSContextFromLeaf(cfgSnap, cfgSnap.Leaf()),
RequireClientCertificate: &types.BoolValue{Value: false},
RequireClientCertificate: &wrappers.BoolValue{Value: false},
}
}
@ -318,9 +319,9 @@ func (s *Server) makeIngressGatewayListeners(address string, cfgSnap *proxycfg.C
return nil, err
}
listener.FilterChains = []envoylistener.FilterChain{
listener.FilterChains = []*envoylistener.FilterChain{
{
Filters: []envoylistener.Filter{
Filters: []*envoylistener.Filter{
filter,
},
TlsContext: tlsContext,
@ -370,7 +371,7 @@ func makeListener(name, addr string, port int) *envoy.Listener {
// from rather than our slight variant in JSON/hcl.
func makeListenerFromUserConfig(configJSON string) (*envoy.Listener, error) {
// Figure out if there is an @type field. We don't require is since we know
// this will be a listener but unmarshalling into types.Any fails if it's not
// this will be a listener but unmarshalling into any.Any fails if it's not
// there and unmarshalling into listener directly fails if it is...
var jsonFields map[string]*json.RawMessage
if err := json.Unmarshal([]byte(configJSON), &jsonFields); err != nil {
@ -380,8 +381,8 @@ func makeListenerFromUserConfig(configJSON string) (*envoy.Listener, error) {
var l envoy.Listener
if _, ok := jsonFields["@type"]; ok {
// Type field is present so decode it as a types.Any
var any types.Any
// Type field is present so decode it as a any.Any
var any any.Any
err := jsonpb.UnmarshalString(configJSON, &any)
if err != nil {
return nil, err
@ -414,11 +415,11 @@ func injectConnectFilters(cfgSnap *proxycfg.ConfigSnapshot, token string, listen
for idx := range listener.FilterChains {
// Insert our authz filter before any others
listener.FilterChains[idx].Filters =
append([]envoylistener.Filter{authFilter}, listener.FilterChains[idx].Filters...)
append([]*envoylistener.Filter{authFilter}, listener.FilterChains[idx].Filters...)
listener.FilterChains[idx].TlsContext = &envoyauth.DownstreamTlsContext{
CommonTlsContext: makeCommonTLSContextFromLeaf(cfgSnap, cfgSnap.Leaf()),
RequireClientCertificate: &types.BoolValue{Value: true},
RequireClientCertificate: &wrappers.BoolValue{Value: true},
}
}
return nil
@ -469,9 +470,9 @@ func (s *Server) makePublicListener(cfgSnap *proxycfg.ConfigSnapshot, token stri
if err != nil {
return nil, err
}
l.FilterChains = []envoylistener.FilterChain{
l.FilterChains = []*envoylistener.FilterChain{
{
Filters: []envoylistener.Filter{
Filters: []*envoylistener.Filter{
filter,
},
},
@ -514,8 +515,8 @@ func (s *Server) makeExposedCheckListener(cfgSnap *proxycfg.ConfigSnapshot, clus
return nil, err
}
chain := envoylistener.FilterChain{
Filters: []envoylistener.Filter{f},
chain := &envoylistener.FilterChain{
Filters: []*envoylistener.Filter{f},
}
// For registered checks restrict traffic sources to localhost and Consul's advertise addr
@ -533,14 +534,14 @@ func (s *Server) makeExposedCheckListener(cfgSnap *proxycfg.ConfigSnapshot, clus
chain.FilterChainMatch = &envoylistener.FilterChainMatch{
SourcePrefixRanges: []*envoycore.CidrRange{
{AddressPrefix: "127.0.0.1", PrefixLen: &types.UInt32Value{Value: 8}},
{AddressPrefix: "::1", PrefixLen: &types.UInt32Value{Value: 128}},
{AddressPrefix: advertise, PrefixLen: &types.UInt32Value{Value: uint32(advertiseLen)}},
{AddressPrefix: "127.0.0.1", PrefixLen: &wrappers.UInt32Value{Value: 8}},
{AddressPrefix: "::1", PrefixLen: &wrappers.UInt32Value{Value: 128}},
{AddressPrefix: advertise, PrefixLen: &wrappers.UInt32Value{Value: uint32(advertiseLen)}},
},
}
}
l.FilterChains = []envoylistener.FilterChain{chain}
l.FilterChains = []*envoylistener.FilterChain{chain}
return l, err
}
@ -552,7 +553,7 @@ func (s *Server) makeTerminatingGatewayListener(name, addr string, port int, cfg
if err != nil {
return nil, err
}
l.ListenerFilters = []envoylistener.ListenerFilter{tlsInspector}
l.ListenerFilters = []*envoylistener.ListenerFilter{tlsInspector}
// Make a FilterChain for each linked service
// Match on the cluster name,
@ -596,8 +597,8 @@ func (s *Server) makeTerminatingGatewayListener(name, addr string, port int, cfg
if err != nil {
return nil, err
}
fallback := envoylistener.FilterChain{
Filters: []envoylistener.Filter{
fallback := &envoylistener.FilterChain{
Filters: []*envoylistener.Filter{
{Name: "envoy.filters.network.sni_cluster"},
tcpProxy,
},
@ -608,34 +609,34 @@ func (s *Server) makeTerminatingGatewayListener(name, addr string, port int, cfg
}
func (s *Server) sniFilterChainTerminatingGateway(listener, cluster, token string, service structs.ServiceName,
cfgSnap *proxycfg.ConfigSnapshot) (envoylistener.FilterChain, error) {
cfgSnap *proxycfg.ConfigSnapshot) (*envoylistener.FilterChain, error) {
authFilter, err := makeExtAuthFilter(token)
if err != nil {
return envoylistener.FilterChain{}, err
return nil, err
}
sniCluster, err := makeSNIClusterFilter()
if err != nil {
return envoylistener.FilterChain{}, err
return nil, err
}
// The cluster name here doesn't matter as the sni_cluster filter will fill it in for us.
statPrefix := fmt.Sprintf("terminating_gateway_%s_%s_", service.NamespaceOrDefault(), service.Name)
tcpProxy, err := makeTCPProxyFilter(listener, "", statPrefix)
if err != nil {
return envoylistener.FilterChain{}, err
return nil, err
}
return envoylistener.FilterChain{
return &envoylistener.FilterChain{
FilterChainMatch: makeSNIFilterChainMatch(cluster),
Filters: []envoylistener.Filter{
Filters: []*envoylistener.Filter{
authFilter,
sniCluster,
tcpProxy,
},
TlsContext: &envoyauth.DownstreamTlsContext{
CommonTlsContext: makeCommonTLSContextFromLeaf(cfgSnap, cfgSnap.TerminatingGateway.ServiceLeaves[service]),
RequireClientCertificate: &types.BoolValue{Value: true},
RequireClientCertificate: &wrappers.BoolValue{Value: true},
},
}, err
}
@ -658,15 +659,15 @@ func (s *Server) makeMeshGatewayListener(name, addr string, port int, cfgSnap *p
return nil, err
}
sniClusterChain := envoylistener.FilterChain{
Filters: []envoylistener.Filter{
sniClusterChain := &envoylistener.FilterChain{
Filters: []*envoylistener.Filter{
sniCluster,
tcpProxy,
},
}
l := makeListener(name, addr, port)
l.ListenerFilters = []envoylistener.ListenerFilter{tlsInspector}
l.ListenerFilters = []*envoylistener.ListenerFilter{tlsInspector}
// TODO (mesh-gateway) - Do we need to create clusters for all the old trust domains as well?
// We need 1 Filter Chain per datacenter
@ -682,11 +683,11 @@ func (s *Server) makeMeshGatewayListener(name, addr string, port int, cfgSnap *p
return nil, err
}
l.FilterChains = append(l.FilterChains, envoylistener.FilterChain{
l.FilterChains = append(l.FilterChains, &envoylistener.FilterChain{
FilterChainMatch: &envoylistener.FilterChainMatch{
ServerNames: []string{fmt.Sprintf("*.%s", clusterName)},
},
Filters: []envoylistener.Filter{
Filters: []*envoylistener.Filter{
dcTCPProxy,
},
})
@ -704,11 +705,11 @@ func (s *Server) makeMeshGatewayListener(name, addr string, port int, cfgSnap *p
return nil, err
}
l.FilterChains = append(l.FilterChains, envoylistener.FilterChain{
l.FilterChains = append(l.FilterChains, &envoylistener.FilterChain{
FilterChainMatch: &envoylistener.FilterChainMatch{
ServerNames: []string{fmt.Sprintf("*.%s", clusterName)},
},
Filters: []envoylistener.Filter{
Filters: []*envoylistener.Filter{
dcTCPProxy,
},
})
@ -724,11 +725,11 @@ func (s *Server) makeMeshGatewayListener(name, addr string, port int, cfgSnap *p
return nil, err
}
l.FilterChains = append(l.FilterChains, envoylistener.FilterChain{
l.FilterChains = append(l.FilterChains, &envoylistener.FilterChain{
FilterChainMatch: &envoylistener.FilterChainMatch{
ServerNames: []string{fmt.Sprintf("%s", clusterName)},
},
Filters: []envoylistener.Filter{
Filters: []*envoylistener.Filter{
dcTCPProxy,
},
})
@ -792,9 +793,9 @@ func (s *Server) makeUpstreamListenerForDiscoveryChain(
return nil, err
}
l.FilterChains = []envoylistener.FilterChain{
l.FilterChains = []*envoylistener.FilterChain{
{
Filters: []envoylistener.Filter{
Filters: []*envoylistener.Filter{
filter,
},
TlsContext: tlsContext,
@ -852,7 +853,7 @@ func getAndModifyUpstreamConfigForListener(logger hclog.Logger, u *structs.Upstr
func makeListenerFilter(
useRDS bool,
protocol, filterName, cluster, statPrefix, routePath string, ingress bool) (envoylistener.Filter, error) {
protocol, filterName, cluster, statPrefix, routePath string, ingress bool) (*envoylistener.Filter, error) {
switch protocol {
case "grpc":
@ -865,16 +866,16 @@ func makeListenerFilter(
fallthrough
default:
if useRDS {
return envoylistener.Filter{}, fmt.Errorf("RDS is not compatible with the tcp proxy filter")
return nil, fmt.Errorf("RDS is not compatible with the tcp proxy filter")
} else if cluster == "" {
return envoylistener.Filter{}, fmt.Errorf("cluster name is required for a tcp proxy filter")
return nil, fmt.Errorf("cluster name is required for a tcp proxy filter")
}
return makeTCPProxyFilter(filterName, cluster, statPrefix)
}
}
func makeTLSInspectorListenerFilter() (envoylistener.ListenerFilter, error) {
return envoylistener.ListenerFilter{Name: util.TlsInspector}, nil
func makeTLSInspectorListenerFilter() (*envoylistener.ListenerFilter, error) {
return &envoylistener.ListenerFilter{Name: wellknown.TlsInspector}, nil
}
func makeSNIFilterChainMatch(sniMatch string) *envoylistener.FilterChainMatch {
@ -883,12 +884,12 @@ func makeSNIFilterChainMatch(sniMatch string) *envoylistener.FilterChainMatch {
}
}
func makeSNIClusterFilter() (envoylistener.Filter, error) {
func makeSNIClusterFilter() (*envoylistener.Filter, error) {
// This filter has no config which is why we are not calling make
return envoylistener.Filter{Name: "envoy.filters.network.sni_cluster"}, nil
return &envoylistener.Filter{Name: "envoy.filters.network.sni_cluster"}, nil
}
func makeTCPProxyFilter(filterName, cluster, statPrefix string) (envoylistener.Filter, error) {
func makeTCPProxyFilter(filterName, cluster, statPrefix string) (*envoylistener.Filter, error) {
cfg := &envoytcp.TcpProxy{
StatPrefix: makeStatPrefix("tcp", statPrefix, filterName),
ClusterSpecifier: &envoytcp.TcpProxy_Cluster{Cluster: cluster},
@ -907,10 +908,10 @@ func makeHTTPFilter(
useRDS bool,
filterName, cluster, statPrefix, routePath string,
ingress, grpc, http2 bool,
) (envoylistener.Filter, error) {
op := envoyhttp.INGRESS
) (*envoylistener.Filter, error) {
op := envoyhttp.HttpConnectionManager_Tracing_INGRESS
if !ingress {
op = envoyhttp.EGRESS
op = envoyhttp.HttpConnectionManager_Tracing_EGRESS
}
proto := "http"
if grpc {
@ -919,7 +920,7 @@ func makeHTTPFilter(
cfg := &envoyhttp.HttpConnectionManager{
StatPrefix: makeStatPrefix(proto, statPrefix, filterName),
CodecType: envoyhttp.AUTO,
CodecType: envoyhttp.HttpConnectionManager_AUTO,
HttpFilters: []*envoyhttp.HttpFilter{
&envoyhttp.HttpFilter{
Name: "envoy.router",
@ -936,12 +937,12 @@ func makeHTTPFilter(
if useRDS {
if cluster != "" {
return envoylistener.Filter{}, fmt.Errorf("cannot specify cluster name when using RDS")
return nil, fmt.Errorf("cannot specify cluster name when using RDS")
}
cfg.RouteSpecifier = &envoyhttp.HttpConnectionManager_Rds{
Rds: &envoyhttp.Rds{
RouteConfigName: filterName,
ConfigSource: envoycore.ConfigSource{
ConfigSource: &envoycore.ConfigSource{
ConfigSourceSpecifier: &envoycore.ConfigSource_Ads{
Ads: &envoycore.AggregatedConfigSource{},
},
@ -950,10 +951,10 @@ func makeHTTPFilter(
}
} else {
if cluster == "" {
return envoylistener.Filter{}, fmt.Errorf("must specify cluster name when not using RDS")
return nil, fmt.Errorf("must specify cluster name when not using RDS")
}
route := envoyroute.Route{
Match: envoyroute.RouteMatch{
route := &envoyroute.Route{
Match: &envoyroute.RouteMatch{
PathSpecifier: &envoyroute.RouteMatch_Prefix{
Prefix: "/",
},
@ -979,11 +980,11 @@ func makeHTTPFilter(
cfg.RouteSpecifier = &envoyhttp.HttpConnectionManager_RouteConfig{
RouteConfig: &envoy.RouteConfiguration{
Name: filterName,
VirtualHosts: []envoyroute.VirtualHost{
VirtualHosts: []*envoyroute.VirtualHost{
{
Name: filterName,
Domains: []string{"*"},
Routes: []envoyroute.Route{
Routes: []*envoyroute.Route{
route,
},
},
@ -1000,14 +1001,14 @@ func makeHTTPFilter(
// Add grpc bridge before router
cfg.HttpFilters = append([]*envoyhttp.HttpFilter{{
Name: "envoy.grpc_http1_bridge",
ConfigType: &envoyhttp.HttpFilter_Config{Config: &types.Struct{}},
ConfigType: &envoyhttp.HttpFilter_Config{Config: &pbstruct.Struct{}},
}}, cfg.HttpFilters...)
}
return makeFilter("envoy.http_connection_manager", cfg)
}
func makeExtAuthFilter(token string) (envoylistener.Filter, error) {
func makeExtAuthFilter(token string) (*envoylistener.Filter, error) {
cfg := &extauthz.ExtAuthz{
StatPrefix: "connect_authz",
GrpcService: &envoycore.GrpcService{
@ -1032,15 +1033,15 @@ func makeExtAuthFilter(token string) (envoylistener.Filter, error) {
return makeFilter("envoy.ext_authz", cfg)
}
func makeFilter(name string, cfg proto.Message) (envoylistener.Filter, error) {
// Ridiculous dance to make that pbstruct into types.Struct by... encoding it
func makeFilter(name string, cfg proto.Message) (*envoylistener.Filter, error) {
// Ridiculous dance to make that struct into pbstruct.Struct by... encoding it
// as JSON and decoding again!!
cfgStruct, err := util.MessageToStruct(cfg)
cfgStruct, err := conversion.MessageToStruct(cfg)
if err != nil {
return envoylistener.Filter{}, err
return nil, err
}
return envoylistener.Filter{
return &envoylistener.Filter{
Name: name,
ConfigType: &envoylistener.Filter_Config{Config: cfgStruct},
}, nil

View File

@ -3,26 +3,26 @@ package xds
import (
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
envoycore "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/types"
prototypes "github.com/gogo/protobuf/types"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/wrappers"
)
func createResponse(typeURL string, version, nonce string, resources []proto.Message) (*envoy.DiscoveryResponse, error) {
anys := make([]types.Any, 0, len(resources))
anys := make([]*any.Any, 0, len(resources))
for _, r := range resources {
if r == nil {
continue
}
if any, ok := r.(*types.Any); ok {
anys = append(anys, *any)
if any, ok := r.(*any.Any); ok {
anys = append(anys, any)
continue
}
data, err := proto.Marshal(r)
if err != nil {
return nil, err
}
anys = append(anys, types.Any{
anys = append(anys, &any.Any{
TypeUrl: typeURL,
Value: data,
})
@ -36,8 +36,8 @@ func createResponse(typeURL string, version, nonce string, resources []proto.Mes
return resp, nil
}
func makeAddress(ip string, port int) envoycore.Address {
return envoycore.Address{
func makeAddress(ip string, port int) *envoycore.Address {
return &envoycore.Address{
Address: &envoycore.Address_SocketAddress{
SocketAddress: &envoycore.SocketAddress{
Address: ip,
@ -49,15 +49,10 @@ func makeAddress(ip string, port int) envoycore.Address {
}
}
func makeAddressPtr(ip string, port int) *envoycore.Address {
a := makeAddress(ip, port)
return &a
func makeUint32Value(n int) *wrappers.UInt32Value {
return &wrappers.UInt32Value{Value: uint32(n)}
}
func makeUint32Value(n int) *prototypes.UInt32Value {
return &prototypes.UInt32Value{Value: uint32(n)}
}
func makeBoolValue(n bool) *prototypes.BoolValue {
return &prototypes.BoolValue{Value: n}
func makeBoolValue(n bool) *wrappers.BoolValue {
return &wrappers.BoolValue{Value: n}
}

View File

@ -6,10 +6,10 @@ import (
"net"
"strings"
"github.com/gogo/protobuf/proto"
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
envoyroute "github.com/envoyproxy/go-control-plane/envoy/api/v2/route"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/hashicorp/consul/agent/proxycfg"
"github.com/hashicorp/consul/agent/structs"
)
@ -57,7 +57,7 @@ func routesFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.M
route := &envoy.RouteConfiguration{
Name: upstreamID,
VirtualHosts: []envoyroute.VirtualHost{virtualHost},
VirtualHosts: []*envoyroute.VirtualHost{virtualHost},
// ValidateClusters defaults to true when defined statically and false
// when done via RDS. Re-set the sane value of true to prevent
// null-routing traffic.
@ -163,8 +163,8 @@ func makeUpstreamRouteForDiscoveryChain(
routeName string,
chain *structs.CompiledDiscoveryChain,
serviceDomains []string,
) (envoyroute.VirtualHost, error) {
var routes []envoyroute.Route
) (*envoyroute.VirtualHost, error) {
var routes []*envoyroute.Route
startNode := chain.Nodes[chain.StartNode]
if startNode == nil {
@ -173,7 +173,7 @@ func makeUpstreamRouteForDiscoveryChain(
switch startNode.Type {
case structs.DiscoveryGraphNodeTypeRouter:
routes = make([]envoyroute.Route, 0, len(startNode.Routes))
routes = make([]*envoyroute.Route, 0, len(startNode.Routes))
for _, discoveryRoute := range startNode.Routes {
routeMatch := makeRouteMatchForDiscoveryRoute(discoveryRoute, chain.Protocol)
@ -188,14 +188,14 @@ func makeUpstreamRouteForDiscoveryChain(
case structs.DiscoveryGraphNodeTypeSplitter:
routeAction, err = makeRouteActionForSplitter(nextNode.Splits, chain)
if err != nil {
return envoyroute.VirtualHost{}, err
return nil, err
}
case structs.DiscoveryGraphNodeTypeResolver:
routeAction = makeRouteActionForSingleCluster(nextNode.Resolver.Target, chain)
default:
return envoyroute.VirtualHost{}, fmt.Errorf("unexpected graph node after route %q", nextNode.Type)
return nil, fmt.Errorf("unexpected graph node after route %q", nextNode.Type)
}
// TODO(rb): Better help handle the envoy case where you need (prefix=/foo/,rewrite=/) and (exact=/foo,rewrite=/) to do a full rewrite
@ -207,7 +207,7 @@ func makeUpstreamRouteForDiscoveryChain(
}
if destination.RequestTimeout > 0 {
routeAction.Route.Timeout = &destination.RequestTimeout
routeAction.Route.Timeout = ptypes.DurationProto(destination.RequestTimeout)
}
if destination.HasRetryFeatures() {
@ -233,7 +233,7 @@ func makeUpstreamRouteForDiscoveryChain(
}
}
routes = append(routes, envoyroute.Route{
routes = append(routes, &envoyroute.Route{
Match: routeMatch,
Action: routeAction,
})
@ -242,31 +242,31 @@ func makeUpstreamRouteForDiscoveryChain(
case structs.DiscoveryGraphNodeTypeSplitter:
routeAction, err := makeRouteActionForSplitter(startNode.Splits, chain)
if err != nil {
return envoyroute.VirtualHost{}, err
return nil, err
}
defaultRoute := envoyroute.Route{
defaultRoute := &envoyroute.Route{
Match: makeDefaultRouteMatch(),
Action: routeAction,
}
routes = []envoyroute.Route{defaultRoute}
routes = []*envoyroute.Route{defaultRoute}
case structs.DiscoveryGraphNodeTypeResolver:
routeAction := makeRouteActionForSingleCluster(startNode.Resolver.Target, chain)
defaultRoute := envoyroute.Route{
defaultRoute := &envoyroute.Route{
Match: makeDefaultRouteMatch(),
Action: routeAction,
}
routes = []envoyroute.Route{defaultRoute}
routes = []*envoyroute.Route{defaultRoute}
default:
panic("unknown first node in discovery chain of type: " + startNode.Type)
}
host := envoyroute.VirtualHost{
host := &envoyroute.VirtualHost{
Name: routeName,
Domains: serviceDomains,
Routes: routes,
@ -275,13 +275,13 @@ func makeUpstreamRouteForDiscoveryChain(
return host, nil
}
func makeRouteMatchForDiscoveryRoute(discoveryRoute *structs.DiscoveryRoute, protocol string) envoyroute.RouteMatch {
func makeRouteMatchForDiscoveryRoute(discoveryRoute *structs.DiscoveryRoute, protocol string) *envoyroute.RouteMatch {
match := discoveryRoute.Definition.Match
if match == nil || match.IsEmpty() {
return makeDefaultRouteMatch()
}
em := envoyroute.RouteMatch{}
em := &envoyroute.RouteMatch{}
switch {
case match.HTTP.PathExact != "":
@ -380,8 +380,8 @@ func makeRouteMatchForDiscoveryRoute(discoveryRoute *structs.DiscoveryRoute, pro
return em
}
func makeDefaultRouteMatch() envoyroute.RouteMatch {
return envoyroute.RouteMatch{
func makeDefaultRouteMatch() *envoyroute.RouteMatch {
return &envoyroute.RouteMatch{
PathSpecifier: &envoyroute.RouteMatch_Prefix{
Prefix: "/",
},

View File

@ -7,18 +7,11 @@ import (
"sync/atomic"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
envoy "github.com/envoyproxy/go-control-plane/envoy/api/v2"
envoyauthz "github.com/envoyproxy/go-control-plane/envoy/service/auth/v2"
envoyauthzalpha "github.com/envoyproxy/go-control-plane/envoy/service/auth/v2alpha"
envoydisco "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v2"
"github.com/gogo/googleapis/google/rpc"
"github.com/gogo/protobuf/proto"
"github.com/golang/protobuf/proto"
"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/agent/cache"
"github.com/hashicorp/consul/agent/connect"
@ -27,6 +20,12 @@ import (
"github.com/hashicorp/consul/logging"
"github.com/hashicorp/consul/tlsutil"
"github.com/hashicorp/go-hclog"
rpcstatus "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)
// ADSStream is a shorter way of referring to this thing...
@ -463,8 +462,8 @@ func (s *Server) DeltaAggregatedResources(_ envoydisco.AggregatedDiscoveryServic
func deniedResponse(reason string) (*envoyauthz.CheckResponse, error) {
return &envoyauthz.CheckResponse{
Status: &rpc.Status{
Code: int32(rpc.PERMISSION_DENIED),
Status: &rpcstatus.Status{
Code: int32(codes.PermissionDenied),
Message: "Denied: " + reason,
},
}, nil
@ -536,8 +535,8 @@ func (s *Server) Check(ctx context.Context, r *envoyauthz.CheckRequest) (*envoya
s.Logger.Debug("Connect AuthZ ALLOWED", "source", r.Attributes.Source.Principal,
"destination", r.Attributes.Destination.Principal, "reason", reason)
return &envoyauthz.CheckResponse{
Status: &rpc.Status{
Code: int32(rpc.OK),
Status: &rpcstatus.Status{
Code: int32(codes.OK),
Message: "ALLOWED: " + reason,
},
}, nil

View File

@ -171,7 +171,7 @@ func makeAttributeContextPeer(t testing.T, svc string) *envoyauth.AttributeConte
spiffeID := connect.TestSpiffeIDService(t, svc)
return &envoyauth.AttributeContext_Peer{
// We don't care about IP for now might later though
Address: makeAddressPtr("10.0.0.1", 1234),
Address: makeAddress("10.0.0.1", 1234),
// Note we don't set Service since that is an advisory only mechanism in
// Envoy triggered by self-declared headers. We rely on the actual TLS Peer
// identity.

9
go.mod
View File

@ -21,11 +21,10 @@ require (
github.com/digitalocean/godo v1.10.0 // indirect
github.com/docker/go-connections v0.3.0
github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0
github.com/envoyproxy/go-control-plane v0.8.0
github.com/envoyproxy/go-control-plane v0.9.5
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/gogo/googleapis v1.1.0
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/golang/protobuf v1.3.1
github.com/golang/protobuf v1.3.2
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/gofuzz v1.0.0
github.com/google/tcpproxy v0.0.0-20180808230851-dfa16c61dad2
@ -89,8 +88,8 @@ require (
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
google.golang.org/api v0.7.0 // indirect
google.golang.org/appengine v1.6.0 // indirect
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101 // indirect
google.golang.org/grpc v1.23.0
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
google.golang.org/grpc v1.25.1
gopkg.in/square/go-jose.v2 v2.4.1
k8s.io/api v0.16.9
k8s.io/apimachinery v0.16.9

28
go.sum
View File

@ -68,12 +68,16 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20200313221541-5f7e5dd04533 h1:8wZizuKuZVu5COB7EsBYxBQz8nRcXXn5d4Gt91eJLvU=
github.com/cncf/udpa/go v0.0.0-20200313221541-5f7e5dd04533/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/coredns/coredns v1.1.2 h1:bAFHrSsBeTeRG5W3Nf2su3lUGw7Npw2UKeCJm/3A638=
github.com/coredns/coredns v1.1.2/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0=
@ -110,10 +114,11 @@ github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0 h1:ZoRg
github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.8.0 h1:uE6Fp4fOcAJdc1wTQXLJ+SYistkbG1dNoi6Zs1+Ybvk=
github.com/envoyproxy/go-control-plane v0.8.0/go.mod h1:GSSbY9P1neVhdY7G4wu+IK1rk/dqhiCC/4ExuWJZVuk=
github.com/envoyproxy/protoc-gen-validate v0.0.14 h1:YBW6/cKy9prEGRYLnaGa4IDhzxZhRCtKsax8srGKDnM=
github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.5 h1:lRJIqDD8yjV1YyPRqecMdytjDLs2fTXq363aCib5xPU=
github.com/envoyproxy/go-control-plane v0.9.5/go.mod h1:OXl5to++W0ctG+EHWTFUjiypVxC/Y4VLc/KFU+al13s=
github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
@ -139,8 +144,6 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/gogo/googleapis v1.1.0 h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I=
@ -155,6 +158,8 @@ github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@ -277,7 +282,6 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/istio/gogo-genproto v0.0.0-20190124151557-6d926a6e6feb/go.mod h1:mvv8vRzGSduueppJLi6LhwN+hLFo0GeXquj6ixCv5xk=
github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ=
github.com/jackc/pgx v3.3.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da h1:FjHUJJ7oBW4G/9j1KzlHaXL09LyMVM9rupS39lncbXk=
@ -405,6 +409,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
@ -554,7 +560,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -604,16 +609,17 @@ google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRn
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101 h1:wuGevabY6r+ivPNagjUXGGxF+GqgMd+dBhjsxW4q9u4=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=

View File

@ -0,0 +1 @@
Google Inc.

View File

@ -1,4 +1,5 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@ -178,7 +179,7 @@ Apache License
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
@ -186,8 +187,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2015, Google Inc
Copyright 2018, GoGo Authors
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -200,4 +200,3 @@ Apache License
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,100 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: opencensus/proto/resource/v1/resource.proto
package v1
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Resource information.
type Resource struct {
// Type identifier for the resource.
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
// Set of labels that describe the resource.
Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Resource) Reset() { *m = Resource{} }
func (m *Resource) String() string { return proto.CompactTextString(m) }
func (*Resource) ProtoMessage() {}
func (*Resource) Descriptor() ([]byte, []int) {
return fileDescriptor_584700775a2fc762, []int{0}
}
func (m *Resource) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Resource.Unmarshal(m, b)
}
func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Resource.Marshal(b, m, deterministic)
}
func (m *Resource) XXX_Merge(src proto.Message) {
xxx_messageInfo_Resource.Merge(m, src)
}
func (m *Resource) XXX_Size() int {
return xxx_messageInfo_Resource.Size(m)
}
func (m *Resource) XXX_DiscardUnknown() {
xxx_messageInfo_Resource.DiscardUnknown(m)
}
var xxx_messageInfo_Resource proto.InternalMessageInfo
func (m *Resource) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *Resource) GetLabels() map[string]string {
if m != nil {
return m.Labels
}
return nil
}
func init() {
proto.RegisterType((*Resource)(nil), "opencensus.proto.resource.v1.Resource")
proto.RegisterMapType((map[string]string)(nil), "opencensus.proto.resource.v1.Resource.LabelsEntry")
}
func init() {
proto.RegisterFile("opencensus/proto/resource/v1/resource.proto", fileDescriptor_584700775a2fc762)
}
var fileDescriptor_584700775a2fc762 = []byte{
// 251 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xce, 0x2f, 0x48, 0xcd,
0x4b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x4a, 0x2d,
0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2f, 0x33, 0x84, 0xb3, 0xf5, 0xc0, 0x52, 0x42, 0x32, 0x08,
0xc5, 0x10, 0x11, 0x3d, 0xb8, 0x82, 0x32, 0x43, 0xa5, 0xa5, 0x8c, 0x5c, 0x1c, 0x41, 0x50, 0xbe,
0x90, 0x10, 0x17, 0x4b, 0x49, 0x65, 0x41, 0xaa, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x98,
0x2d, 0xe4, 0xc5, 0xc5, 0x96, 0x93, 0x98, 0x94, 0x9a, 0x53, 0x2c, 0xc1, 0xa4, 0xc0, 0xac, 0xc1,
0x6d, 0x64, 0xa4, 0x87, 0xcf, 0x3c, 0x3d, 0x98, 0x59, 0x7a, 0x3e, 0x60, 0x4d, 0xae, 0x79, 0x25,
0x45, 0x95, 0x41, 0x50, 0x13, 0xa4, 0x2c, 0xb9, 0xb8, 0x91, 0x84, 0x85, 0x04, 0xb8, 0x98, 0xb3,
0x53, 0x2b, 0xa1, 0xb6, 0x81, 0x98, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12,
0x4c, 0x60, 0x31, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1, 0x69, 0x06, 0x23, 0x97, 0x7c, 0x66, 0x3e,
0x5e, 0xbb, 0x9d, 0x78, 0x61, 0x96, 0x07, 0x80, 0xa4, 0x02, 0x18, 0xa3, 0x5c, 0xd3, 0x33, 0x4b,
0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x21, 0xba, 0x74, 0x33, 0xf3, 0x8a, 0x4b, 0x8a,
0x4a, 0x73, 0x53, 0xf3, 0x4a, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0xf4, 0x11, 0x06, 0xea, 0x42, 0x42,
0x32, 0x3d, 0x35, 0x4f, 0x37, 0x1d, 0x25, 0x40, 0x5f, 0x31, 0xc9, 0xf8, 0x17, 0xa4, 0xe6, 0x39,
0x43, 0xac, 0x05, 0x9b, 0x8d, 0xf0, 0x66, 0x98, 0x61, 0x12, 0x1b, 0x58, 0xa3, 0x31, 0x20, 0x00,
0x00, 0xff, 0xff, 0xcf, 0x32, 0xff, 0x46, 0x96, 0x01, 0x00, 0x00,
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,359 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: opencensus/proto/trace/v1/trace_config.proto
package v1
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// How spans should be sampled:
// - Always off
// - Always on
// - Always follow the parent Span's decision (off if no parent).
type ConstantSampler_ConstantDecision int32
const (
ConstantSampler_ALWAYS_OFF ConstantSampler_ConstantDecision = 0
ConstantSampler_ALWAYS_ON ConstantSampler_ConstantDecision = 1
ConstantSampler_ALWAYS_PARENT ConstantSampler_ConstantDecision = 2
)
var ConstantSampler_ConstantDecision_name = map[int32]string{
0: "ALWAYS_OFF",
1: "ALWAYS_ON",
2: "ALWAYS_PARENT",
}
var ConstantSampler_ConstantDecision_value = map[string]int32{
"ALWAYS_OFF": 0,
"ALWAYS_ON": 1,
"ALWAYS_PARENT": 2,
}
func (x ConstantSampler_ConstantDecision) String() string {
return proto.EnumName(ConstantSampler_ConstantDecision_name, int32(x))
}
func (ConstantSampler_ConstantDecision) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_5359209b41ff50c5, []int{2, 0}
}
// Global configuration of the trace service. All fields must be specified, or
// the default (zero) values will be used for each type.
type TraceConfig struct {
// The global default sampler used to make decisions on span sampling.
//
// Types that are valid to be assigned to Sampler:
// *TraceConfig_ProbabilitySampler
// *TraceConfig_ConstantSampler
// *TraceConfig_RateLimitingSampler
Sampler isTraceConfig_Sampler `protobuf_oneof:"sampler"`
// The global default max number of attributes per span.
MaxNumberOfAttributes int64 `protobuf:"varint,4,opt,name=max_number_of_attributes,json=maxNumberOfAttributes,proto3" json:"max_number_of_attributes,omitempty"`
// The global default max number of annotation events per span.
MaxNumberOfAnnotations int64 `protobuf:"varint,5,opt,name=max_number_of_annotations,json=maxNumberOfAnnotations,proto3" json:"max_number_of_annotations,omitempty"`
// The global default max number of message events per span.
MaxNumberOfMessageEvents int64 `protobuf:"varint,6,opt,name=max_number_of_message_events,json=maxNumberOfMessageEvents,proto3" json:"max_number_of_message_events,omitempty"`
// The global default max number of link entries per span.
MaxNumberOfLinks int64 `protobuf:"varint,7,opt,name=max_number_of_links,json=maxNumberOfLinks,proto3" json:"max_number_of_links,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TraceConfig) Reset() { *m = TraceConfig{} }
func (m *TraceConfig) String() string { return proto.CompactTextString(m) }
func (*TraceConfig) ProtoMessage() {}
func (*TraceConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_5359209b41ff50c5, []int{0}
}
func (m *TraceConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TraceConfig.Unmarshal(m, b)
}
func (m *TraceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TraceConfig.Marshal(b, m, deterministic)
}
func (m *TraceConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_TraceConfig.Merge(m, src)
}
func (m *TraceConfig) XXX_Size() int {
return xxx_messageInfo_TraceConfig.Size(m)
}
func (m *TraceConfig) XXX_DiscardUnknown() {
xxx_messageInfo_TraceConfig.DiscardUnknown(m)
}
var xxx_messageInfo_TraceConfig proto.InternalMessageInfo
type isTraceConfig_Sampler interface {
isTraceConfig_Sampler()
}
type TraceConfig_ProbabilitySampler struct {
ProbabilitySampler *ProbabilitySampler `protobuf:"bytes,1,opt,name=probability_sampler,json=probabilitySampler,proto3,oneof"`
}
type TraceConfig_ConstantSampler struct {
ConstantSampler *ConstantSampler `protobuf:"bytes,2,opt,name=constant_sampler,json=constantSampler,proto3,oneof"`
}
type TraceConfig_RateLimitingSampler struct {
RateLimitingSampler *RateLimitingSampler `protobuf:"bytes,3,opt,name=rate_limiting_sampler,json=rateLimitingSampler,proto3,oneof"`
}
func (*TraceConfig_ProbabilitySampler) isTraceConfig_Sampler() {}
func (*TraceConfig_ConstantSampler) isTraceConfig_Sampler() {}
func (*TraceConfig_RateLimitingSampler) isTraceConfig_Sampler() {}
func (m *TraceConfig) GetSampler() isTraceConfig_Sampler {
if m != nil {
return m.Sampler
}
return nil
}
func (m *TraceConfig) GetProbabilitySampler() *ProbabilitySampler {
if x, ok := m.GetSampler().(*TraceConfig_ProbabilitySampler); ok {
return x.ProbabilitySampler
}
return nil
}
func (m *TraceConfig) GetConstantSampler() *ConstantSampler {
if x, ok := m.GetSampler().(*TraceConfig_ConstantSampler); ok {
return x.ConstantSampler
}
return nil
}
func (m *TraceConfig) GetRateLimitingSampler() *RateLimitingSampler {
if x, ok := m.GetSampler().(*TraceConfig_RateLimitingSampler); ok {
return x.RateLimitingSampler
}
return nil
}
func (m *TraceConfig) GetMaxNumberOfAttributes() int64 {
if m != nil {
return m.MaxNumberOfAttributes
}
return 0
}
func (m *TraceConfig) GetMaxNumberOfAnnotations() int64 {
if m != nil {
return m.MaxNumberOfAnnotations
}
return 0
}
func (m *TraceConfig) GetMaxNumberOfMessageEvents() int64 {
if m != nil {
return m.MaxNumberOfMessageEvents
}
return 0
}
func (m *TraceConfig) GetMaxNumberOfLinks() int64 {
if m != nil {
return m.MaxNumberOfLinks
}
return 0
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*TraceConfig) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*TraceConfig_ProbabilitySampler)(nil),
(*TraceConfig_ConstantSampler)(nil),
(*TraceConfig_RateLimitingSampler)(nil),
}
}
// Sampler that tries to uniformly sample traces with a given probability.
// The probability of sampling a trace is equal to that of the specified probability.
type ProbabilitySampler struct {
// The desired probability of sampling. Must be within [0.0, 1.0].
SamplingProbability float64 `protobuf:"fixed64,1,opt,name=samplingProbability,proto3" json:"samplingProbability,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ProbabilitySampler) Reset() { *m = ProbabilitySampler{} }
func (m *ProbabilitySampler) String() string { return proto.CompactTextString(m) }
func (*ProbabilitySampler) ProtoMessage() {}
func (*ProbabilitySampler) Descriptor() ([]byte, []int) {
return fileDescriptor_5359209b41ff50c5, []int{1}
}
func (m *ProbabilitySampler) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ProbabilitySampler.Unmarshal(m, b)
}
func (m *ProbabilitySampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ProbabilitySampler.Marshal(b, m, deterministic)
}
func (m *ProbabilitySampler) XXX_Merge(src proto.Message) {
xxx_messageInfo_ProbabilitySampler.Merge(m, src)
}
func (m *ProbabilitySampler) XXX_Size() int {
return xxx_messageInfo_ProbabilitySampler.Size(m)
}
func (m *ProbabilitySampler) XXX_DiscardUnknown() {
xxx_messageInfo_ProbabilitySampler.DiscardUnknown(m)
}
var xxx_messageInfo_ProbabilitySampler proto.InternalMessageInfo
func (m *ProbabilitySampler) GetSamplingProbability() float64 {
if m != nil {
return m.SamplingProbability
}
return 0
}
// Sampler that always makes a constant decision on span sampling.
type ConstantSampler struct {
Decision ConstantSampler_ConstantDecision `protobuf:"varint,1,opt,name=decision,proto3,enum=opencensus.proto.trace.v1.ConstantSampler_ConstantDecision" json:"decision,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConstantSampler) Reset() { *m = ConstantSampler{} }
func (m *ConstantSampler) String() string { return proto.CompactTextString(m) }
func (*ConstantSampler) ProtoMessage() {}
func (*ConstantSampler) Descriptor() ([]byte, []int) {
return fileDescriptor_5359209b41ff50c5, []int{2}
}
func (m *ConstantSampler) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConstantSampler.Unmarshal(m, b)
}
func (m *ConstantSampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConstantSampler.Marshal(b, m, deterministic)
}
func (m *ConstantSampler) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConstantSampler.Merge(m, src)
}
func (m *ConstantSampler) XXX_Size() int {
return xxx_messageInfo_ConstantSampler.Size(m)
}
func (m *ConstantSampler) XXX_DiscardUnknown() {
xxx_messageInfo_ConstantSampler.DiscardUnknown(m)
}
var xxx_messageInfo_ConstantSampler proto.InternalMessageInfo
func (m *ConstantSampler) GetDecision() ConstantSampler_ConstantDecision {
if m != nil {
return m.Decision
}
return ConstantSampler_ALWAYS_OFF
}
// Sampler that tries to sample with a rate per time window.
type RateLimitingSampler struct {
// Rate per second.
Qps int64 `protobuf:"varint,1,opt,name=qps,proto3" json:"qps,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RateLimitingSampler) Reset() { *m = RateLimitingSampler{} }
func (m *RateLimitingSampler) String() string { return proto.CompactTextString(m) }
func (*RateLimitingSampler) ProtoMessage() {}
func (*RateLimitingSampler) Descriptor() ([]byte, []int) {
return fileDescriptor_5359209b41ff50c5, []int{3}
}
func (m *RateLimitingSampler) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RateLimitingSampler.Unmarshal(m, b)
}
func (m *RateLimitingSampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RateLimitingSampler.Marshal(b, m, deterministic)
}
func (m *RateLimitingSampler) XXX_Merge(src proto.Message) {
xxx_messageInfo_RateLimitingSampler.Merge(m, src)
}
func (m *RateLimitingSampler) XXX_Size() int {
return xxx_messageInfo_RateLimitingSampler.Size(m)
}
func (m *RateLimitingSampler) XXX_DiscardUnknown() {
xxx_messageInfo_RateLimitingSampler.DiscardUnknown(m)
}
var xxx_messageInfo_RateLimitingSampler proto.InternalMessageInfo
func (m *RateLimitingSampler) GetQps() int64 {
if m != nil {
return m.Qps
}
return 0
}
func init() {
proto.RegisterEnum("opencensus.proto.trace.v1.ConstantSampler_ConstantDecision", ConstantSampler_ConstantDecision_name, ConstantSampler_ConstantDecision_value)
proto.RegisterType((*TraceConfig)(nil), "opencensus.proto.trace.v1.TraceConfig")
proto.RegisterType((*ProbabilitySampler)(nil), "opencensus.proto.trace.v1.ProbabilitySampler")
proto.RegisterType((*ConstantSampler)(nil), "opencensus.proto.trace.v1.ConstantSampler")
proto.RegisterType((*RateLimitingSampler)(nil), "opencensus.proto.trace.v1.RateLimitingSampler")
}
func init() {
proto.RegisterFile("opencensus/proto/trace/v1/trace_config.proto", fileDescriptor_5359209b41ff50c5)
}
var fileDescriptor_5359209b41ff50c5 = []byte{
// 506 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xc1, 0x6e, 0xd3, 0x30,
0x18, 0xc7, 0x97, 0x76, 0x6c, 0xec, 0x9b, 0xb6, 0x05, 0x57, 0x43, 0xa9, 0xb4, 0xc3, 0x94, 0x0b,
0x13, 0x22, 0x09, 0x1d, 0x07, 0x84, 0x90, 0x90, 0xda, 0x6e, 0x15, 0x87, 0xd2, 0x56, 0xd9, 0x44,
0x05, 0x97, 0xe0, 0x64, 0x6e, 0xb0, 0x68, 0xec, 0x60, 0x3b, 0xd5, 0x78, 0x0d, 0xce, 0x3c, 0x04,
0xcf, 0xc5, 0x53, 0xa0, 0x3a, 0x21, 0x49, 0xdb, 0x6d, 0xe2, 0x96, 0xef, 0xfb, 0x7f, 0xbf, 0x9f,
0xad, 0xd8, 0x86, 0x17, 0x3c, 0x25, 0x2c, 0x22, 0x4c, 0x66, 0xd2, 0x4b, 0x05, 0x57, 0xdc, 0x53,
0x02, 0x47, 0xc4, 0x5b, 0x74, 0xf2, 0x8f, 0x20, 0xe2, 0x6c, 0x46, 0x63, 0x57, 0x67, 0xa8, 0x5d,
0x4d, 0xe7, 0x1d, 0x57, 0x0f, 0xb9, 0x8b, 0x8e, 0xfd, 0x6b, 0x1b, 0xf6, 0xaf, 0x97, 0x45, 0x5f,
0x03, 0xe8, 0x0b, 0xb4, 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 0x29, 0x04, 0x00, 0x00,
}

201
vendor/github.com/cncf/udpa/go/LICENSE generated vendored Normal file
View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,231 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: udpa/annotations/migrate.proto
package udpa_annotations
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type MigrateAnnotation struct {
Rename string `protobuf:"bytes,1,opt,name=rename,proto3" json:"rename,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MigrateAnnotation) Reset() { *m = MigrateAnnotation{} }
func (m *MigrateAnnotation) String() string { return proto.CompactTextString(m) }
func (*MigrateAnnotation) ProtoMessage() {}
func (*MigrateAnnotation) Descriptor() ([]byte, []int) {
return fileDescriptor_ba8191732d0e246d, []int{0}
}
func (m *MigrateAnnotation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MigrateAnnotation.Unmarshal(m, b)
}
func (m *MigrateAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MigrateAnnotation.Marshal(b, m, deterministic)
}
func (m *MigrateAnnotation) XXX_Merge(src proto.Message) {
xxx_messageInfo_MigrateAnnotation.Merge(m, src)
}
func (m *MigrateAnnotation) XXX_Size() int {
return xxx_messageInfo_MigrateAnnotation.Size(m)
}
func (m *MigrateAnnotation) XXX_DiscardUnknown() {
xxx_messageInfo_MigrateAnnotation.DiscardUnknown(m)
}
var xxx_messageInfo_MigrateAnnotation proto.InternalMessageInfo
func (m *MigrateAnnotation) GetRename() string {
if m != nil {
return m.Rename
}
return ""
}
type FieldMigrateAnnotation struct {
Rename string `protobuf:"bytes,1,opt,name=rename,proto3" json:"rename,omitempty"`
OneofPromotion string `protobuf:"bytes,2,opt,name=oneof_promotion,json=oneofPromotion,proto3" json:"oneof_promotion,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FieldMigrateAnnotation) Reset() { *m = FieldMigrateAnnotation{} }
func (m *FieldMigrateAnnotation) String() string { return proto.CompactTextString(m) }
func (*FieldMigrateAnnotation) ProtoMessage() {}
func (*FieldMigrateAnnotation) Descriptor() ([]byte, []int) {
return fileDescriptor_ba8191732d0e246d, []int{1}
}
func (m *FieldMigrateAnnotation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FieldMigrateAnnotation.Unmarshal(m, b)
}
func (m *FieldMigrateAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FieldMigrateAnnotation.Marshal(b, m, deterministic)
}
func (m *FieldMigrateAnnotation) XXX_Merge(src proto.Message) {
xxx_messageInfo_FieldMigrateAnnotation.Merge(m, src)
}
func (m *FieldMigrateAnnotation) XXX_Size() int {
return xxx_messageInfo_FieldMigrateAnnotation.Size(m)
}
func (m *FieldMigrateAnnotation) XXX_DiscardUnknown() {
xxx_messageInfo_FieldMigrateAnnotation.DiscardUnknown(m)
}
var xxx_messageInfo_FieldMigrateAnnotation proto.InternalMessageInfo
func (m *FieldMigrateAnnotation) GetRename() string {
if m != nil {
return m.Rename
}
return ""
}
func (m *FieldMigrateAnnotation) GetOneofPromotion() string {
if m != nil {
return m.OneofPromotion
}
return ""
}
type FileMigrateAnnotation struct {
MoveToPackage string `protobuf:"bytes,2,opt,name=move_to_package,json=moveToPackage,proto3" json:"move_to_package,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FileMigrateAnnotation) Reset() { *m = FileMigrateAnnotation{} }
func (m *FileMigrateAnnotation) String() string { return proto.CompactTextString(m) }
func (*FileMigrateAnnotation) ProtoMessage() {}
func (*FileMigrateAnnotation) Descriptor() ([]byte, []int) {
return fileDescriptor_ba8191732d0e246d, []int{2}
}
func (m *FileMigrateAnnotation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FileMigrateAnnotation.Unmarshal(m, b)
}
func (m *FileMigrateAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FileMigrateAnnotation.Marshal(b, m, deterministic)
}
func (m *FileMigrateAnnotation) XXX_Merge(src proto.Message) {
xxx_messageInfo_FileMigrateAnnotation.Merge(m, src)
}
func (m *FileMigrateAnnotation) XXX_Size() int {
return xxx_messageInfo_FileMigrateAnnotation.Size(m)
}
func (m *FileMigrateAnnotation) XXX_DiscardUnknown() {
xxx_messageInfo_FileMigrateAnnotation.DiscardUnknown(m)
}
var xxx_messageInfo_FileMigrateAnnotation proto.InternalMessageInfo
func (m *FileMigrateAnnotation) GetMoveToPackage() string {
if m != nil {
return m.MoveToPackage
}
return ""
}
var E_MessageMigrate = &proto.ExtensionDesc{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtensionType: (*MigrateAnnotation)(nil),
Field: 171962766,
Name: "udpa.annotations.message_migrate",
Tag: "bytes,171962766,opt,name=message_migrate",
Filename: "udpa/annotations/migrate.proto",
}
var E_FieldMigrate = &proto.ExtensionDesc{
ExtendedType: (*descriptor.FieldOptions)(nil),
ExtensionType: (*FieldMigrateAnnotation)(nil),
Field: 171962766,
Name: "udpa.annotations.field_migrate",
Tag: "bytes,171962766,opt,name=field_migrate",
Filename: "udpa/annotations/migrate.proto",
}
var E_EnumMigrate = &proto.ExtensionDesc{
ExtendedType: (*descriptor.EnumOptions)(nil),
ExtensionType: (*MigrateAnnotation)(nil),
Field: 171962766,
Name: "udpa.annotations.enum_migrate",
Tag: "bytes,171962766,opt,name=enum_migrate",
Filename: "udpa/annotations/migrate.proto",
}
var E_EnumValueMigrate = &proto.ExtensionDesc{
ExtendedType: (*descriptor.EnumValueOptions)(nil),
ExtensionType: (*MigrateAnnotation)(nil),
Field: 171962766,
Name: "udpa.annotations.enum_value_migrate",
Tag: "bytes,171962766,opt,name=enum_value_migrate",
Filename: "udpa/annotations/migrate.proto",
}
var E_FileMigrate = &proto.ExtensionDesc{
ExtendedType: (*descriptor.FileOptions)(nil),
ExtensionType: (*FileMigrateAnnotation)(nil),
Field: 171962766,
Name: "udpa.annotations.file_migrate",
Tag: "bytes,171962766,opt,name=file_migrate",
Filename: "udpa/annotations/migrate.proto",
}
func init() {
proto.RegisterType((*MigrateAnnotation)(nil), "udpa.annotations.MigrateAnnotation")
proto.RegisterType((*FieldMigrateAnnotation)(nil), "udpa.annotations.FieldMigrateAnnotation")
proto.RegisterType((*FileMigrateAnnotation)(nil), "udpa.annotations.FileMigrateAnnotation")
proto.RegisterExtension(E_MessageMigrate)
proto.RegisterExtension(E_FieldMigrate)
proto.RegisterExtension(E_EnumMigrate)
proto.RegisterExtension(E_EnumValueMigrate)
proto.RegisterExtension(E_FileMigrate)
}
func init() { proto.RegisterFile("udpa/annotations/migrate.proto", fileDescriptor_ba8191732d0e246d) }
var fileDescriptor_ba8191732d0e246d = []byte{
// 349 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,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a1, 0x70, 0x68, 0x69, 0xf9, 0x05, 0xe7, 0xb9, 0x38, 0x91, 0xa4, 0xc3, 0x21, 0x4d, 0x59,
0x08, 0x7e, 0xd1, 0x8a, 0x73, 0x41, 0xf3, 0xf8, 0xb4, 0x8c, 0x4f, 0x67, 0xf9, 0xc6, 0x93, 0x34,
0xf5, 0xf4, 0x3f, 0x3e, 0xbf, 0x9e, 0x07, 0xb5, 0x71, 0xe3, 0xf6, 0x8a, 0xfe, 0xac, 0x8e, 0x5a,
0x7f, 0xe2, 0xb5, 0x0b, 0xff, 0x62, 0x32, 0x41, 0xd2, 0x0a, 0x74, 0x1b, 0x5b, 0xde, 0x99, 0xc5,
0x33, 0x6d, 0x59, 0xb4, 0xb1, 0x4d, 0xab, 0xae, 0xd5, 0x6b, 0x06, 0x7b, 0xfa, 0x24, 0x24, 0x4d,
0x10, 0x19, 0xdf, 0xf2, 0x4e, 0x2d, 0xde, 0xa3, 0xc8, 0xf8, 0x61, 0xe1, 0x1a, 0xda, 0xb9, 0x04,
0xbd, 0x13, 0xc7, 0x80, 0x36, 0x2c, 0xce, 0x76, 0x75, 0x5e, 0x56, 0xe2, 0x5e, 0xf5, 0xce, 0x61,
0xcc, 0x2e, 0x94, 0xf7, 0x25, 0x78, 0x4d, 0x9a, 0x41, 0x14, 0xc3, 0x2f, 0x09, 0xf5, 0x23, 0xb1,
0x68, 0xa3, 0xaa, 0x42, 0x2b, 0x1e, 0x93, 0xd7, 0x08, 0x76, 0xf2, 0xa2, 0x6e, 0x4c, 0xef, 0xbe,
0x03, 0x00, 0x00, 0xff, 0xff, 0x62, 0x65, 0xc8, 0x45, 0x57, 0x03, 0x00, 0x00,
}

View File

@ -0,0 +1,246 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: udpa/annotations/migrate.proto
package udpa_annotations
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _migrate_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// 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.
func (m *MigrateAnnotation) Validate() error {
if m == nil {
return nil
}
// no validation rules for Rename
return nil
}
// MigrateAnnotationValidationError is the validation error returned by
// MigrateAnnotation.Validate if the designated constraints aren't met.
type MigrateAnnotationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e MigrateAnnotationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e MigrateAnnotationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e MigrateAnnotationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e MigrateAnnotationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e MigrateAnnotationValidationError) ErrorName() string {
return "MigrateAnnotationValidationError"
}
// Error satisfies the builtin error interface
func (e MigrateAnnotationValidationError) 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 %sMigrateAnnotation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = MigrateAnnotationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = MigrateAnnotationValidationError{}
// 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.
func (m *FieldMigrateAnnotation) Validate() error {
if m == nil {
return nil
}
// no validation rules for Rename
// no validation rules for OneofPromotion
return nil
}
// FieldMigrateAnnotationValidationError is the validation error returned by
// FieldMigrateAnnotation.Validate if the designated constraints aren't met.
type FieldMigrateAnnotationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FieldMigrateAnnotationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FieldMigrateAnnotationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FieldMigrateAnnotationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FieldMigrateAnnotationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FieldMigrateAnnotationValidationError) ErrorName() string {
return "FieldMigrateAnnotationValidationError"
}
// Error satisfies the builtin error interface
func (e FieldMigrateAnnotationValidationError) 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 %sFieldMigrateAnnotation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FieldMigrateAnnotationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FieldMigrateAnnotationValidationError{}
// 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.
func (m *FileMigrateAnnotation) Validate() error {
if m == nil {
return nil
}
// no validation rules for MoveToPackage
return nil
}
// FileMigrateAnnotationValidationError is the validation error returned by
// FileMigrateAnnotation.Validate if the designated constraints aren't met.
type FileMigrateAnnotationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FileMigrateAnnotationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FileMigrateAnnotationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FileMigrateAnnotationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FileMigrateAnnotationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FileMigrateAnnotationValidationError) ErrorName() string {
return "FileMigrateAnnotationValidationError"
}
// Error satisfies the builtin error interface
func (e FileMigrateAnnotationValidationError) 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 %sFileMigrateAnnotation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FileMigrateAnnotationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FileMigrateAnnotationValidationError{}

View File

@ -0,0 +1,50 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: udpa/annotations/sensitive.proto
package udpa_annotations
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
var E_Sensitive = &proto.ExtensionDesc{
ExtendedType: (*descriptor.FieldOptions)(nil),
ExtensionType: (*bool)(nil),
Field: 76569463,
Name: "udpa.annotations.sensitive",
Tag: "varint,76569463,opt,name=sensitive",
Filename: "udpa/annotations/sensitive.proto",
}
func init() {
proto.RegisterExtension(E_Sensitive)
}
func init() { proto.RegisterFile("udpa/annotations/sensitive.proto", fileDescriptor_abbd0dde0408189d) }
var fileDescriptor_abbd0dde0408189d = []byte{
// 134 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0x4d, 0x29, 0x48,
0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2f, 0x4e, 0xcd,
0x2b, 0xce, 0x2c, 0xc9, 0x2c, 0x4b, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x00, 0xa9,
0xd0, 0x43, 0x52, 0x21, 0xa5, 0x90, 0x9e, 0x9f, 0x9f, 0x9e, 0x93, 0xaa, 0x0f, 0x96, 0x4f, 0x2a,
0x4d, 0xd3, 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0x2f, 0x82, 0xe8, 0xb1, 0xb2,
0xe3, 0xe2, 0x84, 0x1b, 0x23, 0x24, 0xab, 0x07, 0x51, 0xaf, 0x07, 0x53, 0xaf, 0xe7, 0x96, 0x99,
0x9a, 0x93, 0xe2, 0x5f, 0x00, 0x36, 0x4d, 0xe2, 0xfb, 0xb6, 0x83, 0x2a, 0x0a, 0x8c, 0x1a, 0x1c,
0x41, 0x08, 0x2d, 0x49, 0x6c, 0x60, 0xa5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xba,
0xeb, 0x73, 0x9e, 0x00, 0x00, 0x00,
}

View File

@ -0,0 +1,37 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: udpa/annotations/sensitive.proto
package udpa_annotations
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _sensitive_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

View File

@ -0,0 +1,93 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: udpa/annotations/status.proto
package udpa_annotations
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type StatusAnnotation struct {
WorkInProgress bool `protobuf:"varint,1,opt,name=work_in_progress,json=workInProgress,proto3" json:"work_in_progress,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StatusAnnotation) Reset() { *m = StatusAnnotation{} }
func (m *StatusAnnotation) String() string { return proto.CompactTextString(m) }
func (*StatusAnnotation) ProtoMessage() {}
func (*StatusAnnotation) Descriptor() ([]byte, []int) {
return fileDescriptor_011cc2e7e491b0ff, []int{0}
}
func (m *StatusAnnotation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatusAnnotation.Unmarshal(m, b)
}
func (m *StatusAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StatusAnnotation.Marshal(b, m, deterministic)
}
func (m *StatusAnnotation) XXX_Merge(src proto.Message) {
xxx_messageInfo_StatusAnnotation.Merge(m, src)
}
func (m *StatusAnnotation) XXX_Size() int {
return xxx_messageInfo_StatusAnnotation.Size(m)
}
func (m *StatusAnnotation) XXX_DiscardUnknown() {
xxx_messageInfo_StatusAnnotation.DiscardUnknown(m)
}
var xxx_messageInfo_StatusAnnotation proto.InternalMessageInfo
func (m *StatusAnnotation) GetWorkInProgress() bool {
if m != nil {
return m.WorkInProgress
}
return false
}
var E_FileStatus = &proto.ExtensionDesc{
ExtendedType: (*descriptor.FileOptions)(nil),
ExtensionType: (*StatusAnnotation)(nil),
Field: 222707719,
Name: "udpa.annotations.file_status",
Tag: "bytes,222707719,opt,name=file_status",
Filename: "udpa/annotations/status.proto",
}
func init() {
proto.RegisterType((*StatusAnnotation)(nil), "udpa.annotations.StatusAnnotation")
proto.RegisterExtension(E_FileStatus)
}
func init() { proto.RegisterFile("udpa/annotations/status.proto", fileDescriptor_011cc2e7e491b0ff) }
var fileDescriptor_011cc2e7e491b0ff = []byte{
// 191 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0x4d, 0x29, 0x48,
0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2f, 0x2e, 0x49,
0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x00, 0x49, 0xeb, 0x21, 0x49,
0x4b, 0x29, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x83, 0xe5, 0x93, 0x4a, 0xd3, 0xf4, 0x53,
0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0xf2, 0x8b, 0x20, 0x7a, 0x94, 0x6c, 0xb8, 0x04, 0x82,
0xc1, 0x66, 0x38, 0xc2, 0xb5, 0x09, 0x69, 0x70, 0x09, 0x94, 0xe7, 0x17, 0x65, 0xc7, 0x67, 0xe6,
0xc5, 0x17, 0x14, 0xe5, 0xa7, 0x17, 0xa5, 0x16, 0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x04,
0xf1, 0x81, 0xc4, 0x3d, 0xf3, 0x02, 0xa0, 0xa2, 0x56, 0x29, 0x5c, 0xdc, 0x69, 0x99, 0x39, 0xa9,
0xf1, 0x10, 0x67, 0x08, 0xc9, 0xe8, 0x41, 0xec, 0xd3, 0x83, 0xd9, 0xa7, 0xe7, 0x96, 0x99, 0x93,
0xea, 0x5f, 0x00, 0x76, 0x8c, 0x44, 0x7b, 0xc3, 0xcc, 0x2c, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x25,
0x3d, 0x74, 0x87, 0xea, 0xa1, 0xbb, 0x21, 0x88, 0x0b, 0x64, 0x2e, 0x44, 0x34, 0x89, 0x0d, 0x6c,
0x9c, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xda, 0x3c, 0x97, 0x43, 0xff, 0x00, 0x00, 0x00,
}

View File

@ -0,0 +1,104 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: udpa/annotations/status.proto
package udpa_annotations
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _status_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// 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.
func (m *StatusAnnotation) Validate() error {
if m == nil {
return nil
}
// no validation rules for WorkInProgress
return nil
}
// StatusAnnotationValidationError is the validation error returned by
// StatusAnnotation.Validate if the designated constraints aren't met.
type StatusAnnotationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e StatusAnnotationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e StatusAnnotationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e StatusAnnotationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e StatusAnnotationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e StatusAnnotationValidationError) ErrorName() string { return "StatusAnnotationValidationError" }
// Error satisfies the builtin error interface
func (e StatusAnnotationValidationError) 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 %sStatusAnnotation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = StatusAnnotationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = StatusAnnotationValidationError{}

View File

@ -0,0 +1,94 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: udpa/annotations/versioning.proto
package udpa_annotations
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type VersioningAnnotation struct {
PreviousMessageType string `protobuf:"bytes,1,opt,name=previous_message_type,json=previousMessageType,proto3" json:"previous_message_type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *VersioningAnnotation) Reset() { *m = VersioningAnnotation{} }
func (m *VersioningAnnotation) String() string { return proto.CompactTextString(m) }
func (*VersioningAnnotation) ProtoMessage() {}
func (*VersioningAnnotation) Descriptor() ([]byte, []int) {
return fileDescriptor_5bc0544382e16cfc, []int{0}
}
func (m *VersioningAnnotation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_VersioningAnnotation.Unmarshal(m, b)
}
func (m *VersioningAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_VersioningAnnotation.Marshal(b, m, deterministic)
}
func (m *VersioningAnnotation) XXX_Merge(src proto.Message) {
xxx_messageInfo_VersioningAnnotation.Merge(m, src)
}
func (m *VersioningAnnotation) XXX_Size() int {
return xxx_messageInfo_VersioningAnnotation.Size(m)
}
func (m *VersioningAnnotation) XXX_DiscardUnknown() {
xxx_messageInfo_VersioningAnnotation.DiscardUnknown(m)
}
var xxx_messageInfo_VersioningAnnotation proto.InternalMessageInfo
func (m *VersioningAnnotation) GetPreviousMessageType() string {
if m != nil {
return m.PreviousMessageType
}
return ""
}
var E_Versioning = &proto.ExtensionDesc{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtensionType: (*VersioningAnnotation)(nil),
Field: 7881811,
Name: "udpa.annotations.versioning",
Tag: "bytes,7881811,opt,name=versioning",
Filename: "udpa/annotations/versioning.proto",
}
func init() {
proto.RegisterType((*VersioningAnnotation)(nil), "udpa.annotations.VersioningAnnotation")
proto.RegisterExtension(E_Versioning)
}
func init() { proto.RegisterFile("udpa/annotations/versioning.proto", fileDescriptor_5bc0544382e16cfc) }
var fileDescriptor_5bc0544382e16cfc = []byte{
// 193 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x4d, 0x29, 0x48,
0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2f, 0x4b, 0x2d,
0x2a, 0xce, 0xcc, 0xcf, 0xcb, 0xcc, 0x4b, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x00,
0x29, 0xd1, 0x43, 0x52, 0x22, 0xa5, 0x90, 0x9e, 0x9f, 0x9f, 0x9e, 0x93, 0xaa, 0x0f, 0x96, 0x4f,
0x2a, 0x4d, 0xd3, 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0x2f, 0x82, 0xe8, 0x51,
0xf2, 0xe2, 0x12, 0x09, 0x83, 0x9b, 0xe3, 0x08, 0xd7, 0x2a, 0x64, 0xc4, 0x25, 0x5a, 0x50, 0x94,
0x5a, 0x96, 0x99, 0x5f, 0x5a, 0x1c, 0x9f, 0x9b, 0x5a, 0x5c, 0x9c, 0x98, 0x9e, 0x1a, 0x5f, 0x52,
0x59, 0x90, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x24, 0x0c, 0x93, 0xf4, 0x85, 0xc8, 0x85,
0x54, 0x16, 0xa4, 0x5a, 0x65, 0x71, 0x71, 0x21, 0xdc, 0x24, 0x24, 0xaf, 0x07, 0xb1, 0x5c, 0x0f,
0x66, 0xb9, 0x1e, 0x54, 0xad, 0x7f, 0x01, 0xd8, 0x71, 0x12, 0x97, 0x3b, 0x1e, 0x32, 0x2b, 0x30,
0x6a, 0x70, 0x1b, 0xa9, 0xe9, 0xa1, 0x3b, 0x5c, 0x0f, 0x9b, 0x9b, 0x82, 0x90, 0x4c, 0x4f, 0x62,
0x03, 0x9b, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x9c, 0xb8, 0x85, 0x17, 0x01, 0x00,
0x00,
}

View File

@ -0,0 +1,106 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: udpa/annotations/versioning.proto
package udpa_annotations
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _versioning_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// 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.
func (m *VersioningAnnotation) Validate() error {
if m == nil {
return nil
}
// no validation rules for PreviousMessageType
return nil
}
// VersioningAnnotationValidationError is the validation error returned by
// VersioningAnnotation.Validate if the designated constraints aren't met.
type VersioningAnnotationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e VersioningAnnotationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e VersioningAnnotationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e VersioningAnnotationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e VersioningAnnotationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e VersioningAnnotationValidationError) ErrorName() string {
return "VersioningAnnotationValidationError"
}
// Error satisfies the builtin error interface
func (e VersioningAnnotationValidationError) 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 %sVersioningAnnotation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = VersioningAnnotationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = VersioningAnnotationValidationError{}

View File

@ -0,0 +1,66 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/annotations/deprecation.proto
package envoy_annotations
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
var E_DisallowedByDefault = &proto.ExtensionDesc{
ExtendedType: (*descriptor.FieldOptions)(nil),
ExtensionType: (*bool)(nil),
Field: 189503207,
Name: "envoy.annotations.disallowed_by_default",
Tag: "varint,189503207,opt,name=disallowed_by_default",
Filename: "envoy/annotations/deprecation.proto",
}
var E_DisallowedByDefaultEnum = &proto.ExtensionDesc{
ExtendedType: (*descriptor.EnumValueOptions)(nil),
ExtensionType: (*bool)(nil),
Field: 70100853,
Name: "envoy.annotations.disallowed_by_default_enum",
Tag: "varint,70100853,opt,name=disallowed_by_default_enum",
Filename: "envoy/annotations/deprecation.proto",
}
func init() {
proto.RegisterExtension(E_DisallowedByDefault)
proto.RegisterExtension(E_DisallowedByDefaultEnum)
}
func init() {
proto.RegisterFile("envoy/annotations/deprecation.proto", fileDescriptor_2fd079940089e0eb)
}
var fileDescriptor_2fd079940089e0eb = []byte{
// 197 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xcd, 0x2b, 0xcb,
0xaf, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x4f, 0x49,
0x2d, 0x28, 0x4a, 0x4d, 0x06, 0x73, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x04, 0xc1, 0x8a,
0xf4, 0x90, 0x14, 0x49, 0x29, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x83, 0x15, 0x24, 0x95,
0xa6, 0xe9, 0xa7, 0xa4, 0x16, 0x27, 0x17, 0x65, 0x16, 0x94, 0xe4, 0x17, 0x41, 0x34, 0x59, 0x85,
0x70, 0x89, 0xa6, 0x64, 0x16, 0x27, 0xe6, 0xe4, 0xe4, 0x97, 0xa7, 0xa6, 0xc4, 0x27, 0x55, 0xc6,
0xa7, 0xa4, 0xa6, 0x25, 0x96, 0xe6, 0x94, 0x08, 0xc9, 0xea, 0x41, 0xf4, 0xea, 0xc1, 0xf4, 0xea,
0xb9, 0x65, 0xa6, 0xe6, 0xa4, 0xf8, 0x17, 0x80, 0x4d, 0x96, 0x78, 0xbe, 0x76, 0x5d, 0x94, 0x02,
0xa3, 0x06, 0x47, 0x90, 0x30, 0x42, 0xbb, 0x53, 0xa5, 0x0b, 0x44, 0xb3, 0x55, 0x22, 0x97, 0x14,
0x56, 0x53, 0xe3, 0x53, 0xf3, 0x4a, 0x73, 0x85, 0x14, 0x31, 0x8c, 0x76, 0xcd, 0x2b, 0xcd, 0x0d,
0x4b, 0xcc, 0x29, 0x4d, 0x85, 0x19, 0xff, 0xf5, 0xdc, 0x36, 0x45, 0xb0, 0xf1, 0xe2, 0x58, 0x8c,
0x07, 0xa9, 0x4e, 0x62, 0x03, 0x6b, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xca, 0xf7,
0x3d, 0x1b, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,37 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/annotations/deprecation.proto
package envoy_annotations
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _deprecation_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

View File

@ -0,0 +1,92 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/annotations/resource.proto
package envoy_annotations
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type ResourceAnnotation struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ResourceAnnotation) Reset() { *m = ResourceAnnotation{} }
func (m *ResourceAnnotation) String() string { return proto.CompactTextString(m) }
func (*ResourceAnnotation) ProtoMessage() {}
func (*ResourceAnnotation) Descriptor() ([]byte, []int) {
return fileDescriptor_faafdcff915d6055, []int{0}
}
func (m *ResourceAnnotation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ResourceAnnotation.Unmarshal(m, b)
}
func (m *ResourceAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ResourceAnnotation.Marshal(b, m, deterministic)
}
func (m *ResourceAnnotation) XXX_Merge(src proto.Message) {
xxx_messageInfo_ResourceAnnotation.Merge(m, src)
}
func (m *ResourceAnnotation) XXX_Size() int {
return xxx_messageInfo_ResourceAnnotation.Size(m)
}
func (m *ResourceAnnotation) XXX_DiscardUnknown() {
xxx_messageInfo_ResourceAnnotation.DiscardUnknown(m)
}
var xxx_messageInfo_ResourceAnnotation proto.InternalMessageInfo
func (m *ResourceAnnotation) GetType() string {
if m != nil {
return m.Type
}
return ""
}
var E_Resource = &proto.ExtensionDesc{
ExtendedType: (*descriptor.ServiceOptions)(nil),
ExtensionType: (*ResourceAnnotation)(nil),
Field: 265073217,
Name: "envoy.annotations.resource",
Tag: "bytes,265073217,opt,name=resource",
Filename: "envoy/annotations/resource.proto",
}
func init() {
proto.RegisterType((*ResourceAnnotation)(nil), "envoy.annotations.ResourceAnnotation")
proto.RegisterExtension(E_Resource)
}
func init() { proto.RegisterFile("envoy/annotations/resource.proto", fileDescriptor_faafdcff915d6055) }
var fileDescriptor_faafdcff915d6055 = []byte{
// 172 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcd, 0x2b, 0xcb,
0xaf, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2f, 0x4a,
0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0xab,
0xd0, 0x43, 0x52, 0x21, 0xa5, 0x90, 0x9e, 0x9f, 0x9f, 0x9e, 0x93, 0xaa, 0x0f, 0x56, 0x90, 0x54,
0x9a, 0xa6, 0x9f, 0x92, 0x5a, 0x9c, 0x5c, 0x94, 0x59, 0x50, 0x92, 0x5f, 0x04, 0xd1, 0xa4, 0xa4,
0xc1, 0x25, 0x14, 0x04, 0x35, 0xc6, 0x11, 0xae, 0x51, 0x48, 0x88, 0x8b, 0xa5, 0xa4, 0xb2, 0x20,
0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xcc, 0xb6, 0x4a, 0xe5, 0xe2, 0x80, 0x59, 0x28,
0x24, 0xaf, 0x07, 0x31, 0x58, 0x0f, 0x66, 0xb0, 0x5e, 0x70, 0x6a, 0x51, 0x59, 0x66, 0x72, 0xaa,
0x7f, 0x01, 0xd8, 0x62, 0x89, 0x83, 0x4f, 0x36, 0xd5, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0xa9, 0xea,
0x61, 0xb8, 0x4a, 0x0f, 0xd3, 0xc2, 0x20, 0xb8, 0xd1, 0x49, 0x6c, 0x60, 0x23, 0x8d, 0x01, 0x01,
0x00, 0x00, 0xff, 0xff, 0x54, 0xc9, 0x37, 0x66, 0xf0, 0x00, 0x00, 0x00,
}

View File

@ -0,0 +1,106 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/annotations/resource.proto
package envoy_annotations
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _resource_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on ResourceAnnotation with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ResourceAnnotation) Validate() error {
if m == nil {
return nil
}
// no validation rules for Type
return nil
}
// ResourceAnnotationValidationError is the validation error returned by
// ResourceAnnotation.Validate if the designated constraints aren't met.
type ResourceAnnotationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ResourceAnnotationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ResourceAnnotationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ResourceAnnotationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ResourceAnnotationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ResourceAnnotationValidationError) ErrorName() string {
return "ResourceAnnotationValidationError"
}
// Error satisfies the builtin error interface
func (e ResourceAnnotationValidationError) 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 %sResourceAnnotation.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ResourceAnnotationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ResourceAnnotationValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/auth/cert.proto
package auth
package envoy_api_v2_auth
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _cert_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on TlsParameters with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
@ -112,6 +115,108 @@ var _ interface {
ErrorName() string
} = TlsParametersValidationError{}
// Validate checks the field values on PrivateKeyProvider with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *PrivateKeyProvider) Validate() error {
if m == nil {
return nil
}
if len(m.GetProviderName()) < 1 {
return PrivateKeyProviderValidationError{
field: "ProviderName",
reason: "value length must be at least 1 bytes",
}
}
switch m.ConfigType.(type) {
case *PrivateKeyProvider_Config:
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PrivateKeyProviderValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *PrivateKeyProvider_TypedConfig:
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PrivateKeyProviderValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// PrivateKeyProviderValidationError is the validation error returned by
// PrivateKeyProvider.Validate if the designated constraints aren't met.
type PrivateKeyProviderValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PrivateKeyProviderValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PrivateKeyProviderValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PrivateKeyProviderValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PrivateKeyProviderValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PrivateKeyProviderValidationError) ErrorName() string {
return "PrivateKeyProviderValidationError"
}
// Error satisfies the builtin error interface
func (e PrivateKeyProviderValidationError) 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 %sPrivateKeyProvider.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PrivateKeyProviderValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PrivateKeyProviderValidationError{}
// Validate checks the field values on TlsCertificate with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
@ -120,62 +225,52 @@ func (m *TlsCertificate) Validate() error {
return nil
}
{
tmp := m.GetCertificateChain()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "CertificateChain",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetCertificateChain()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "CertificateChain",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetPrivateKey()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "PrivateKey",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetPrivateKey()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "PrivateKey",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetPassword()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "Password",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetPrivateKeyProvider()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "PrivateKeyProvider",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetOcspStaple()
if v, ok := interface{}(m.GetPassword()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "Password",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "OcspStaple",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetOcspStaple()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: "OcspStaple",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -183,17 +278,12 @@ func (m *TlsCertificate) Validate() error {
for idx, item := range m.GetSignedCertificateTimestamp() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: fmt.Sprintf("SignedCertificateTimestamp[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsCertificateValidationError{
field: fmt.Sprintf("SignedCertificateTimestamp[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -275,17 +365,12 @@ func (m *TlsSessionTicketKeys) Validate() error {
for idx, item := range m.GetKeys() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsSessionTicketKeysValidationError{
field: fmt.Sprintf("Keys[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TlsSessionTicketKeysValidationError{
field: fmt.Sprintf("Keys[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -359,17 +444,12 @@ func (m *CertificateValidationContext) Validate() error {
return nil
}
{
tmp := m.GetTrustedCa()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "TrustedCa",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTrustedCa()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "TrustedCa",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -398,53 +478,60 @@ func (m *CertificateValidationContext) Validate() error {
}
{
tmp := m.GetRequireOcspStaple()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
for idx, item := range m.GetMatchSubjectAltNames() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "RequireOcspStaple",
field: fmt.Sprintf("MatchSubjectAltNames[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
{
tmp := m.GetRequireSignedCertificateTimestamp()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "RequireSignedCertificateTimestamp",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetRequireOcspStaple()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "RequireOcspStaple",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetCrl()
if v, ok := interface{}(m.GetRequireSignedCertificateTimestamp()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "RequireSignedCertificateTimestamp",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "Crl",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetCrl()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CertificateValidationContextValidationError{
field: "Crl",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for AllowExpiredCertificate
if _, ok := CertificateValidationContext_TrustChainVerification_name[int32(m.GetTrustChainVerification())]; !ok {
return CertificateValidationContextValidationError{
field: "TrustChainVerification",
reason: "value must be one of the defined enum values",
}
}
return nil
}
@ -513,17 +600,12 @@ func (m *CommonTlsContext) Validate() error {
return nil
}
{
tmp := m.GetTlsParams()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "TlsParams",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTlsParams()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "TlsParams",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -531,17 +613,12 @@ func (m *CommonTlsContext) Validate() error {
for idx, item := range m.GetTlsCertificates() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: fmt.Sprintf("TlsCertificates[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: fmt.Sprintf("TlsCertificates[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -558,17 +635,12 @@ func (m *CommonTlsContext) Validate() error {
for idx, item := range m.GetTlsCertificateSdsSecretConfigs() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: fmt.Sprintf("TlsCertificateSdsSecretConfigs[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: fmt.Sprintf("TlsCertificateSdsSecretConfigs[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -579,51 +651,36 @@ func (m *CommonTlsContext) Validate() error {
case *CommonTlsContext_ValidationContext:
{
tmp := m.GetValidationContext()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "ValidationContext",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetValidationContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "ValidationContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *CommonTlsContext_ValidationContextSdsSecretConfig:
{
tmp := m.GetValidationContextSdsSecretConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "ValidationContextSdsSecretConfig",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetValidationContextSdsSecretConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "ValidationContextSdsSecretConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *CommonTlsContext_CombinedValidationContext:
{
tmp := m.GetCombinedValidationContext()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "CombinedValidationContext",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetCombinedValidationContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContextValidationError{
field: "CombinedValidationContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -695,17 +752,12 @@ func (m *UpstreamTlsContext) Validate() error {
return nil
}
{
tmp := m.GetCommonTlsContext()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamTlsContextValidationError{
field: "CommonTlsContext",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetCommonTlsContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamTlsContextValidationError{
field: "CommonTlsContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -719,17 +771,12 @@ func (m *UpstreamTlsContext) Validate() error {
// no validation rules for AllowRenegotiation
{
tmp := m.GetMaxSessionKeys()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamTlsContextValidationError{
field: "MaxSessionKeys",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMaxSessionKeys()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamTlsContextValidationError{
field: "MaxSessionKeys",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -801,83 +848,80 @@ func (m *DownstreamTlsContext) Validate() error {
return nil
}
{
tmp := m.GetCommonTlsContext()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "CommonTlsContext",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetCommonTlsContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "CommonTlsContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetRequireClientCertificate()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "RequireClientCertificate",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetRequireClientCertificate()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "RequireClientCertificate",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetRequireSni()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "RequireSni",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetRequireSni()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "RequireSni",
reason: "embedded message failed validation",
cause: err,
}
}
}
if d := m.GetSessionTimeout(); d != nil {
dur, err := ptypes.Duration(d)
if err != nil {
return DownstreamTlsContextValidationError{
field: "SessionTimeout",
reason: "value is not a valid duration",
cause: err,
}
}
lt := time.Duration(4294967296*time.Second + 0*time.Nanosecond)
gte := time.Duration(0*time.Second + 0*time.Nanosecond)
if dur < gte || dur >= lt {
return DownstreamTlsContextValidationError{
field: "SessionTimeout",
reason: "value must be inside range [0s, 1193046h28m16s)",
}
}
}
switch m.SessionTicketKeysType.(type) {
case *DownstreamTlsContext_SessionTicketKeys:
{
tmp := m.GetSessionTicketKeys()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "SessionTicketKeys",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSessionTicketKeys()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "SessionTicketKeys",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *DownstreamTlsContext_SessionTicketKeysSdsSecretConfig:
{
tmp := m.GetSessionTicketKeysSdsSecretConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "SessionTicketKeysSdsSecretConfig",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSessionTicketKeysSdsSecretConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownstreamTlsContextValidationError{
field: "SessionTicketKeysSdsSecretConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -943,6 +987,81 @@ var _ interface {
ErrorName() string
} = DownstreamTlsContextValidationError{}
// Validate checks the field values on GenericSecret with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *GenericSecret) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetSecret()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GenericSecretValidationError{
field: "Secret",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// GenericSecretValidationError is the validation error returned by
// GenericSecret.Validate if the designated constraints aren't met.
type GenericSecretValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GenericSecretValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GenericSecretValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GenericSecretValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GenericSecretValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GenericSecretValidationError) ErrorName() string { return "GenericSecretValidationError" }
// Error satisfies the builtin error interface
func (e GenericSecretValidationError) 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 %sGenericSecret.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GenericSecretValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GenericSecretValidationError{}
// Validate checks the field values on SdsSecretConfig with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -953,17 +1072,12 @@ func (m *SdsSecretConfig) Validate() error {
// no validation rules for Name
{
tmp := m.GetSdsConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SdsSecretConfigValidationError{
field: "SdsConfig",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSdsConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SdsSecretConfigValidationError{
field: "SdsConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -1038,51 +1152,48 @@ func (m *Secret) Validate() error {
case *Secret_TlsCertificate:
{
tmp := m.GetTlsCertificate()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SecretValidationError{
field: "TlsCertificate",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTlsCertificate()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SecretValidationError{
field: "TlsCertificate",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *Secret_SessionTicketKeys:
{
tmp := m.GetSessionTicketKeys()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SecretValidationError{
field: "SessionTicketKeys",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSessionTicketKeys()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SecretValidationError{
field: "SessionTicketKeys",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *Secret_ValidationContext:
{
tmp := m.GetValidationContext()
if v, ok := interface{}(m.GetValidationContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SecretValidationError{
field: "ValidationContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
case *Secret_GenericSecret:
if err := v.Validate(); err != nil {
return SecretValidationError{
field: "ValidationContext",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetGenericSecret()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SecretValidationError{
field: "GenericSecret",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -1162,17 +1273,12 @@ func (m *CommonTlsContext_CombinedCertificateValidationContext) Validate() error
}
}
{
tmp := m.GetDefaultValidationContext()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContext_CombinedCertificateValidationContextValidationError{
field: "DefaultValidationContext",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetDefaultValidationContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContext_CombinedCertificateValidationContextValidationError{
field: "DefaultValidationContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -1184,17 +1290,12 @@ func (m *CommonTlsContext_CombinedCertificateValidationContext) Validate() error
}
}
{
tmp := m.GetValidationContextSdsSecretConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContext_CombinedCertificateValidationContextValidationError{
field: "ValidationContextSdsSecretConfig",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetValidationContextSdsSecretConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CommonTlsContext_CombinedCertificateValidationContextValidationError{
field: "ValidationContextSdsSecretConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/cluster/circuit_breaker.proto
package cluster
package envoy_api_v2_cluster
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
)
@ -32,11 +32,14 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
_ = core.RoutingPriority(0)
)
// define the regex for a UUID once up-front
var _circuit_breaker_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on CircuitBreakers with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -48,17 +51,12 @@ func (m *CircuitBreakers) Validate() error {
for idx, item := range m.GetThresholds() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakersValidationError{
field: fmt.Sprintf("Thresholds[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakersValidationError{
field: fmt.Sprintf("Thresholds[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -130,81 +128,71 @@ func (m *CircuitBreakers_Thresholds) Validate() error {
return nil
}
// no validation rules for Priority
if _, ok := core.RoutingPriority_name[int32(m.GetPriority())]; !ok {
return CircuitBreakers_ThresholdsValidationError{
field: "Priority",
reason: "value must be one of the defined enum values",
}
}
{
tmp := m.GetMaxConnections()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxConnections",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMaxConnections()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxConnections",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetMaxPendingRequests()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxPendingRequests",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMaxPendingRequests()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxPendingRequests",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetMaxRequests()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxRequests",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMaxRequests()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxRequests",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetMaxRetries()
if v, ok := interface{}(m.GetMaxRetries()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxRetries",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxRetries",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetRetryBudget()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "RetryBudget",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for TrackRemaining
{
tmp := m.GetMaxConnectionPools()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxConnectionPools",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMaxConnectionPools()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_ThresholdsValidationError{
field: "MaxConnectionPools",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -267,3 +255,91 @@ var _ interface {
Cause() error
ErrorName() string
} = CircuitBreakers_ThresholdsValidationError{}
// Validate checks the field values on CircuitBreakers_Thresholds_RetryBudget
// with the rules defined in the proto definition for this message. If any
// rules are violated, an error is returned.
func (m *CircuitBreakers_Thresholds_RetryBudget) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetBudgetPercent()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_Thresholds_RetryBudgetValidationError{
field: "BudgetPercent",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetMinRetryConcurrency()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CircuitBreakers_Thresholds_RetryBudgetValidationError{
field: "MinRetryConcurrency",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// CircuitBreakers_Thresholds_RetryBudgetValidationError is the validation
// error returned by CircuitBreakers_Thresholds_RetryBudget.Validate if the
// designated constraints aren't met.
type CircuitBreakers_Thresholds_RetryBudgetValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CircuitBreakers_Thresholds_RetryBudgetValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CircuitBreakers_Thresholds_RetryBudgetValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CircuitBreakers_Thresholds_RetryBudgetValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CircuitBreakers_Thresholds_RetryBudgetValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CircuitBreakers_Thresholds_RetryBudgetValidationError) ErrorName() string {
return "CircuitBreakers_Thresholds_RetryBudgetValidationError"
}
// Error satisfies the builtin error interface
func (e CircuitBreakers_Thresholds_RetryBudgetValidationError) 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 %sCircuitBreakers_Thresholds_RetryBudget.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CircuitBreakers_Thresholds_RetryBudgetValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CircuitBreakers_Thresholds_RetryBudgetValidationError{}

View File

@ -0,0 +1,100 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/cluster/filter.proto
package envoy_api_v2_cluster
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
any "github.com/golang/protobuf/ptypes/any"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Filter struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
TypedConfig *any.Any `protobuf:"bytes,2,opt,name=typed_config,json=typedConfig,proto3" json:"typed_config,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Filter) Reset() { *m = Filter{} }
func (m *Filter) String() string { return proto.CompactTextString(m) }
func (*Filter) ProtoMessage() {}
func (*Filter) Descriptor() ([]byte, []int) {
return fileDescriptor_8ce34c55b74b9243, []int{0}
}
func (m *Filter) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Filter.Unmarshal(m, b)
}
func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Filter.Marshal(b, m, deterministic)
}
func (m *Filter) XXX_Merge(src proto.Message) {
xxx_messageInfo_Filter.Merge(m, src)
}
func (m *Filter) XXX_Size() int {
return xxx_messageInfo_Filter.Size(m)
}
func (m *Filter) XXX_DiscardUnknown() {
xxx_messageInfo_Filter.DiscardUnknown(m)
}
var xxx_messageInfo_Filter proto.InternalMessageInfo
func (m *Filter) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Filter) GetTypedConfig() *any.Any {
if m != nil {
return m.TypedConfig
}
return nil
}
func init() {
proto.RegisterType((*Filter)(nil), "envoy.api.v2.cluster.Filter")
}
func init() { proto.RegisterFile("envoy/api/v2/cluster/filter.proto", fileDescriptor_8ce34c55b74b9243) }
var fileDescriptor_8ce34c55b74b9243 = []byte{
// 299 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x3d, 0x4e, 0xc3, 0x30,
0x14, 0x80, 0xe5, 0xa8, 0x14, 0x91, 0x32, 0xa0, 0xa8, 0xa2, 0x3f, 0x08, 0x14, 0x3a, 0x75, 0x7a,
0x96, 0xd2, 0x81, 0xb9, 0xa9, 0x60, 0x44, 0x55, 0x91, 0x18, 0x41, 0xaf, 0x8d, 0x13, 0x59, 0x4a,
0x6d, 0xcb, 0x71, 0x22, 0xb2, 0x71, 0x00, 0x24, 0x56, 0xce, 0xc0, 0x11, 0x38, 0x01, 0x2b, 0xd7,
0x60, 0x64, 0x64, 0x40, 0x08, 0x3b, 0x99, 0x80, 0xcd, 0xf2, 0xf7, 0x3d, 0xf9, 0x7b, 0xf6, 0x4f,
0x99, 0xa8, 0x64, 0x4d, 0x51, 0x71, 0x5a, 0x45, 0x74, 0x93, 0x97, 0x85, 0x61, 0x9a, 0xa6, 0x3c,
0x37, 0x4c, 0x83, 0xd2, 0xd2, 0xc8, 0xa0, 0x6f, 0x15, 0x40, 0xc5, 0xa1, 0x8a, 0xa0, 0x51, 0xc6,
0xa3, 0x4c, 0xca, 0x2c, 0x67, 0xd4, 0x3a, 0xeb, 0x32, 0xa5, 0x28, 0x6a, 0x37, 0x30, 0x3e, 0x29,
0x13, 0x85, 0x14, 0x85, 0x90, 0x06, 0x0d, 0x97, 0xa2, 0xa0, 0x5b, 0x9e, 0x69, 0x34, 0xac, 0xe1,
0xc7, 0xbf, 0x78, 0x61, 0xd0, 0x94, 0x45, 0x83, 0x07, 0x15, 0xe6, 0x3c, 0x41, 0xc3, 0x68, 0x7b,
0x70, 0x60, 0x72, 0xe3, 0x77, 0x2f, 0x6c, 0x58, 0x70, 0xe4, 0x77, 0x04, 0x6e, 0xd9, 0x90, 0x84,
0x64, 0xba, 0x17, 0xef, 0x7e, 0xc6, 0x1d, 0xed, 0x85, 0x64, 0x65, 0x2f, 0x83, 0x33, 0x7f, 0xdf,
0xd4, 0x8a, 0x25, 0xb7, 0x1b, 0x29, 0x52, 0x9e, 0x0d, 0xbd, 0x90, 0x4c, 0x7b, 0x51, 0x1f, 0x5c,
0x30, 0xb4, 0xc1, 0x30, 0x17, 0xf5, 0xaa, 0x67, 0xcd, 0x85, 0x15, 0xe3, 0x07, 0xf2, 0xf1, 0xf4,
0xf5, 0xb8, 0x33, 0x0a, 0x06, 0x6e, 0x63, 0x37, 0xdf, 0x6e, 0x0c, 0xd5, 0xec, 0xe5, 0xfe, 0xf5,
0xad, 0xeb, 0x1d, 0x10, 0x7f, 0xc2, 0x25, 0x58, 0x47, 0x69, 0x79, 0x57, 0xc3, 0x5f, 0x1f, 0x14,
0xf7, 0x5c, 0xeb, 0xf2, 0xe7, 0xb9, 0x25, 0x79, 0xf6, 0x0e, 0xcf, 0xad, 0x35, 0x57, 0x1c, 0xae,
0x23, 0x58, 0x38, 0xeb, 0xf2, 0xea, 0xfd, 0x3f, 0xb0, 0xee, 0xda, 0xd2, 0xd9, 0x77, 0x00, 0x00,
0x00, 0xff, 0xff, 0xfd, 0x82, 0xd5, 0x6d, 0xa3, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,118 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/cluster/filter.proto
package envoy_api_v2_cluster
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _filter_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on Filter with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Filter) Validate() error {
if m == nil {
return nil
}
if len(m.GetName()) < 1 {
return FilterValidationError{
field: "Name",
reason: "value length must be at least 1 bytes",
}
}
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// FilterValidationError is the validation error returned by Filter.Validate if
// the designated constraints aren't met.
type FilterValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FilterValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FilterValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FilterValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FilterValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FilterValidationError) ErrorName() string { return "FilterValidationError" }
// Error satisfies the builtin error interface
func (e FilterValidationError) 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 %sFilter.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FilterValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FilterValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/cluster/outlier_detection.proto
package cluster
package envoy_api_v2_cluster
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _outlier_detection_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on OutlierDetection with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -41,23 +44,18 @@ func (m *OutlierDetection) Validate() error {
return nil
}
{
tmp := m.GetConsecutive_5Xx()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "Consecutive_5Xx",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetConsecutive_5Xx()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "Consecutive_5Xx",
reason: "embedded message failed validation",
cause: err,
}
}
}
if d := m.GetInterval(); d != nil {
dur, err := types.DurationFromProto(d)
dur, err := ptypes.Duration(d)
if err != nil {
return OutlierDetectionValidationError{
field: "Interval",
@ -78,7 +76,7 @@ func (m *OutlierDetection) Validate() error {
}
if d := m.GetBaseEjectionTime(); d != nil {
dur, err := types.DurationFromProto(d)
dur, err := ptypes.Duration(d)
if err != nil {
return OutlierDetectionValidationError{
field: "BaseEjectionTime",
@ -131,62 +129,42 @@ func (m *OutlierDetection) Validate() error {
}
{
tmp := m.GetSuccessRateMinimumHosts()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "SuccessRateMinimumHosts",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSuccessRateMinimumHosts()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "SuccessRateMinimumHosts",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetSuccessRateRequestVolume()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "SuccessRateRequestVolume",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSuccessRateRequestVolume()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "SuccessRateRequestVolume",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetSuccessRateStdevFactor()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "SuccessRateStdevFactor",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSuccessRateStdevFactor()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "SuccessRateStdevFactor",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetConsecutiveGatewayFailure()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "ConsecutiveGatewayFailure",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetConsecutiveGatewayFailure()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "ConsecutiveGatewayFailure",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -202,6 +180,93 @@ func (m *OutlierDetection) Validate() error {
}
// no validation rules for SplitExternalLocalOriginErrors
if v, ok := interface{}(m.GetConsecutiveLocalOriginFailure()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "ConsecutiveLocalOriginFailure",
reason: "embedded message failed validation",
cause: err,
}
}
}
if wrapper := m.GetEnforcingConsecutiveLocalOriginFailure(); wrapper != nil {
if wrapper.GetValue() > 100 {
return OutlierDetectionValidationError{
field: "EnforcingConsecutiveLocalOriginFailure",
reason: "value must be less than or equal to 100",
}
}
}
if wrapper := m.GetEnforcingLocalOriginSuccessRate(); wrapper != nil {
if wrapper.GetValue() > 100 {
return OutlierDetectionValidationError{
field: "EnforcingLocalOriginSuccessRate",
reason: "value must be less than or equal to 100",
}
}
}
if wrapper := m.GetFailurePercentageThreshold(); wrapper != nil {
if wrapper.GetValue() > 100 {
return OutlierDetectionValidationError{
field: "FailurePercentageThreshold",
reason: "value must be less than or equal to 100",
}
}
}
if wrapper := m.GetEnforcingFailurePercentage(); wrapper != nil {
if wrapper.GetValue() > 100 {
return OutlierDetectionValidationError{
field: "EnforcingFailurePercentage",
reason: "value must be less than or equal to 100",
}
}
}
if wrapper := m.GetEnforcingFailurePercentageLocalOrigin(); wrapper != nil {
if wrapper.GetValue() > 100 {
return OutlierDetectionValidationError{
field: "EnforcingFailurePercentageLocalOrigin",
reason: "value must be less than or equal to 100",
}
}
}
if v, ok := interface{}(m.GetFailurePercentageMinimumHosts()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "FailurePercentageMinimumHosts",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetFailurePercentageRequestVolume()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return OutlierDetectionValidationError{
field: "FailurePercentageRequestVolume",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/address.proto
package core
package envoy_api_v2_core
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _address_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on Pipe with the rules defined in the proto
// definition for this message. If any rules are violated, an error is returned.
func (m *Pipe) Validate() error {
@ -47,6 +50,13 @@ func (m *Pipe) Validate() error {
}
}
if m.GetMode() > 511 {
return PipeValidationError{
field: "Mode",
reason: "value must be less than or equal to 511",
}
}
return nil
}
@ -217,47 +227,32 @@ func (m *TcpKeepalive) Validate() error {
return nil
}
{
tmp := m.GetKeepaliveProbes()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TcpKeepaliveValidationError{
field: "KeepaliveProbes",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetKeepaliveProbes()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TcpKeepaliveValidationError{
field: "KeepaliveProbes",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetKeepaliveTime()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TcpKeepaliveValidationError{
field: "KeepaliveTime",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetKeepaliveTime()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TcpKeepaliveValidationError{
field: "KeepaliveTime",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetKeepaliveInterval()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TcpKeepaliveValidationError{
field: "KeepaliveInterval",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetKeepaliveInterval()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TcpKeepaliveValidationError{
field: "KeepaliveInterval",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -326,32 +321,29 @@ func (m *BindConfig) Validate() error {
return nil
}
{
tmp := m.GetSourceAddress()
if m.GetSourceAddress() == nil {
return BindConfigValidationError{
field: "SourceAddress",
reason: "value is required",
}
}
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BindConfigValidationError{
field: "SourceAddress",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSourceAddress()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BindConfigValidationError{
field: "SourceAddress",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetFreebind()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BindConfigValidationError{
field: "Freebind",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetFreebind()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BindConfigValidationError{
field: "Freebind",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -359,17 +351,12 @@ func (m *BindConfig) Validate() error {
for idx, item := range m.GetSocketOptions() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BindConfigValidationError{
field: fmt.Sprintf("SocketOptions[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BindConfigValidationError{
field: fmt.Sprintf("SocketOptions[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -444,34 +431,24 @@ func (m *Address) Validate() error {
case *Address_SocketAddress:
{
tmp := m.GetSocketAddress()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AddressValidationError{
field: "SocketAddress",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSocketAddress()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AddressValidationError{
field: "SocketAddress",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *Address_Pipe:
{
tmp := m.GetPipe()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AddressValidationError{
field: "Pipe",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetPipe()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AddressValidationError{
field: "Pipe",
reason: "embedded message failed validation",
cause: err,
}
}
}

View File

@ -0,0 +1,101 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/core/backoff.proto
package envoy_api_v2_core
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
duration "github.com/golang/protobuf/ptypes/duration"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type BackoffStrategy struct {
BaseInterval *duration.Duration `protobuf:"bytes,1,opt,name=base_interval,json=baseInterval,proto3" json:"base_interval,omitempty"`
MaxInterval *duration.Duration `protobuf:"bytes,2,opt,name=max_interval,json=maxInterval,proto3" json:"max_interval,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BackoffStrategy) Reset() { *m = BackoffStrategy{} }
func (m *BackoffStrategy) String() string { return proto.CompactTextString(m) }
func (*BackoffStrategy) ProtoMessage() {}
func (*BackoffStrategy) Descriptor() ([]byte, []int) {
return fileDescriptor_743c92d7b5268904, []int{0}
}
func (m *BackoffStrategy) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BackoffStrategy.Unmarshal(m, b)
}
func (m *BackoffStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BackoffStrategy.Marshal(b, m, deterministic)
}
func (m *BackoffStrategy) XXX_Merge(src proto.Message) {
xxx_messageInfo_BackoffStrategy.Merge(m, src)
}
func (m *BackoffStrategy) XXX_Size() int {
return xxx_messageInfo_BackoffStrategy.Size(m)
}
func (m *BackoffStrategy) XXX_DiscardUnknown() {
xxx_messageInfo_BackoffStrategy.DiscardUnknown(m)
}
var xxx_messageInfo_BackoffStrategy proto.InternalMessageInfo
func (m *BackoffStrategy) GetBaseInterval() *duration.Duration {
if m != nil {
return m.BaseInterval
}
return nil
}
func (m *BackoffStrategy) GetMaxInterval() *duration.Duration {
if m != nil {
return m.MaxInterval
}
return nil
}
func init() {
proto.RegisterType((*BackoffStrategy)(nil), "envoy.api.v2.core.BackoffStrategy")
}
func init() { proto.RegisterFile("envoy/api/v2/core/backoff.proto", fileDescriptor_743c92d7b5268904) }
var fileDescriptor_743c92d7b5268904 = []byte{
// 310 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcd, 0x2b, 0xcb,
0xaf, 0xd4, 0x4f, 0x2c, 0xc8, 0xd4, 0x2f, 0x33, 0xd2, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x4a,
0x4c, 0xce, 0xce, 0x4f, 0x4b, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0x2b, 0xd0,
0x4b, 0x2c, 0xc8, 0xd4, 0x2b, 0x33, 0xd2, 0x03, 0x29, 0x90, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, 0xcf,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, 0xb4, 0xcc, 0x74, 0x70, 0xf0, 0xe9,
0x95, 0x19, 0xef, 0x6a, 0x38, 0x71, 0x91, 0x8d, 0x49, 0x80, 0x91, 0x4b, 0x3e, 0x33, 0x5f, 0x0f,
0xac, 0xa0, 0xa0, 0x28, 0xbf, 0xa2, 0x52, 0x0f, 0x23, 0xa8, 0x9d, 0x78, 0xa0, 0xfe, 0x0d, 0x00,
0xd9, 0x1b, 0xc0, 0x98, 0xc4, 0x06, 0x76, 0x80, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x2d,
0xa4, 0xc4, 0xb7, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,151 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/backoff.proto
package envoy_api_v2_core
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _backoff_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on BackoffStrategy with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *BackoffStrategy) Validate() error {
if m == nil {
return nil
}
if m.GetBaseInterval() == nil {
return BackoffStrategyValidationError{
field: "BaseInterval",
reason: "value is required",
}
}
if d := m.GetBaseInterval(); d != nil {
dur, err := ptypes.Duration(d)
if err != nil {
return BackoffStrategyValidationError{
field: "BaseInterval",
reason: "value is not a valid duration",
cause: err,
}
}
gte := time.Duration(0*time.Second + 1000000*time.Nanosecond)
if dur < gte {
return BackoffStrategyValidationError{
field: "BaseInterval",
reason: "value must be greater than or equal to 1ms",
}
}
}
if d := m.GetMaxInterval(); d != nil {
dur, err := ptypes.Duration(d)
if err != nil {
return BackoffStrategyValidationError{
field: "MaxInterval",
reason: "value is not a valid duration",
cause: err,
}
}
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
if dur <= gt {
return BackoffStrategyValidationError{
field: "MaxInterval",
reason: "value must be greater than 0s",
}
}
}
return nil
}
// BackoffStrategyValidationError is the validation error returned by
// BackoffStrategy.Validate if the designated constraints aren't met.
type BackoffStrategyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e BackoffStrategyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e BackoffStrategyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e BackoffStrategyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e BackoffStrategyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e BackoffStrategyValidationError) ErrorName() string { return "BackoffStrategyValidationError" }
// Error satisfies the builtin error interface
func (e BackoffStrategyValidationError) 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 %sBackoffStrategy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = BackoffStrategyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = BackoffStrategyValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/base.proto
package core
package envoy_api_v2_core
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _base_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on Locality with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Locality) Validate() error {
@ -103,6 +106,173 @@ var _ interface {
ErrorName() string
} = LocalityValidationError{}
// Validate checks the field values on BuildVersion with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *BuildVersion) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetVersion()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BuildVersionValidationError{
field: "Version",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return BuildVersionValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// BuildVersionValidationError is the validation error returned by
// BuildVersion.Validate if the designated constraints aren't met.
type BuildVersionValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e BuildVersionValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e BuildVersionValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e BuildVersionValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e BuildVersionValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e BuildVersionValidationError) ErrorName() string { return "BuildVersionValidationError" }
// Error satisfies the builtin error interface
func (e BuildVersionValidationError) 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 %sBuildVersion.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = BuildVersionValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = BuildVersionValidationError{}
// Validate checks the field values on Extension with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Extension) Validate() error {
if m == nil {
return nil
}
// no validation rules for Name
// no validation rules for Category
// no validation rules for TypeDescriptor
if v, ok := interface{}(m.GetVersion()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ExtensionValidationError{
field: "Version",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for Disabled
return nil
}
// ExtensionValidationError is the validation error returned by
// Extension.Validate if the designated constraints aren't met.
type ExtensionValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ExtensionValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ExtensionValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ExtensionValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ExtensionValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ExtensionValidationError) ErrorName() string { return "ExtensionValidationError" }
// Error satisfies the builtin error interface
func (e ExtensionValidationError) 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 %sExtension.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ExtensionValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ExtensionValidationError{}
// Validate checks the field values on Node with the rules defined in the proto
// definition for this message. If any rules are violated, an error is returned.
func (m *Node) Validate() error {
@ -114,38 +284,79 @@ func (m *Node) Validate() error {
// no validation rules for Cluster
{
tmp := m.GetMetadata()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return NodeValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return NodeValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetLocality()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return NodeValidationError{
field: "Locality",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return NodeValidationError{
field: "Locality",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for BuildVersion
// no validation rules for UserAgentName
for idx, item := range m.GetExtensions() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return NodeValidationError{
field: fmt.Sprintf("Extensions[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
for idx, item := range m.GetListeningAddresses() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return NodeValidationError{
field: fmt.Sprintf("ListeningAddresses[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
switch m.UserAgentVersionType.(type) {
case *Node_UserAgentVersion:
// no validation rules for UserAgentVersion
case *Node_UserAgentBuildVersion:
if v, ok := interface{}(m.GetUserAgentBuildVersion()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return NodeValidationError{
field: "UserAgentBuildVersion",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
@ -210,7 +421,22 @@ func (m *Metadata) Validate() error {
return nil
}
// no validation rules for FilterMetadata
for key, val := range m.GetFilterMetadata() {
_ = val
// no validation rules for FilterMetadata[key]
if v, ok := interface{}(val).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return MetadataValidationError{
field: fmt.Sprintf("FilterMetadata[%v]", key),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
@ -343,6 +569,97 @@ var _ interface {
ErrorName() string
} = RuntimeUInt32ValidationError{}
// Validate checks the field values on RuntimeFeatureFlag with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *RuntimeFeatureFlag) Validate() error {
if m == nil {
return nil
}
if m.GetDefaultValue() == nil {
return RuntimeFeatureFlagValidationError{
field: "DefaultValue",
reason: "value is required",
}
}
if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RuntimeFeatureFlagValidationError{
field: "DefaultValue",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(m.GetRuntimeKey()) < 1 {
return RuntimeFeatureFlagValidationError{
field: "RuntimeKey",
reason: "value length must be at least 1 bytes",
}
}
return nil
}
// RuntimeFeatureFlagValidationError is the validation error returned by
// RuntimeFeatureFlag.Validate if the designated constraints aren't met.
type RuntimeFeatureFlagValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RuntimeFeatureFlagValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RuntimeFeatureFlagValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RuntimeFeatureFlagValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RuntimeFeatureFlagValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RuntimeFeatureFlagValidationError) ErrorName() string {
return "RuntimeFeatureFlagValidationError"
}
// Error satisfies the builtin error interface
func (e RuntimeFeatureFlagValidationError) 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 %sRuntimeFeatureFlag.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RuntimeFeatureFlagValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RuntimeFeatureFlagValidationError{}
// Validate checks the field values on HeaderValue with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
@ -358,6 +675,13 @@ func (m *HeaderValue) Validate() error {
}
}
if !_HeaderValue_Key_Pattern.MatchString(m.GetKey()) {
return HeaderValueValidationError{
field: "Key",
reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
}
}
if len(m.GetValue()) > 16384 {
return HeaderValueValidationError{
field: "Value",
@ -365,6 +689,13 @@ func (m *HeaderValue) Validate() error {
}
}
if !_HeaderValue_Value_Pattern.MatchString(m.GetValue()) {
return HeaderValueValidationError{
field: "Value",
reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
}
}
return nil
}
@ -422,6 +753,10 @@ var _ interface {
ErrorName() string
} = HeaderValueValidationError{}
var _HeaderValue_Key_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
var _HeaderValue_Value_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
// Validate checks the field values on HeaderValueOption with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -437,32 +772,22 @@ func (m *HeaderValueOption) Validate() error {
}
}
{
tmp := m.GetHeader()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HeaderValueOptionValidationError{
field: "Header",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetHeader()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HeaderValueOptionValidationError{
field: "Header",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetAppend()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HeaderValueOptionValidationError{
field: "Append",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetAppend()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HeaderValueOptionValidationError{
field: "Append",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -536,17 +861,12 @@ func (m *HeaderMap) Validate() error {
for idx, item := range m.GetHeaders() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HeaderMapValidationError{
field: fmt.Sprintf("Headers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HeaderMapValidationError{
field: fmt.Sprintf("Headers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -711,6 +1031,289 @@ var _ interface {
ErrorName() string
} = DataSourceValidationError{}
// Validate checks the field values on RetryPolicy with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *RetryPolicy) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetRetryBackOff()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RetryPolicyValidationError{
field: "RetryBackOff",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetNumRetries()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RetryPolicyValidationError{
field: "NumRetries",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// RetryPolicyValidationError is the validation error returned by
// RetryPolicy.Validate if the designated constraints aren't met.
type RetryPolicyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RetryPolicyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RetryPolicyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RetryPolicyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RetryPolicyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RetryPolicyValidationError) ErrorName() string { return "RetryPolicyValidationError" }
// Error satisfies the builtin error interface
func (e RetryPolicyValidationError) 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 %sRetryPolicy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RetryPolicyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RetryPolicyValidationError{}
// Validate checks the field values on RemoteDataSource with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *RemoteDataSource) Validate() error {
if m == nil {
return nil
}
if m.GetHttpUri() == nil {
return RemoteDataSourceValidationError{
field: "HttpUri",
reason: "value is required",
}
}
if v, ok := interface{}(m.GetHttpUri()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RemoteDataSourceValidationError{
field: "HttpUri",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(m.GetSha256()) < 1 {
return RemoteDataSourceValidationError{
field: "Sha256",
reason: "value length must be at least 1 bytes",
}
}
if v, ok := interface{}(m.GetRetryPolicy()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RemoteDataSourceValidationError{
field: "RetryPolicy",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// RemoteDataSourceValidationError is the validation error returned by
// RemoteDataSource.Validate if the designated constraints aren't met.
type RemoteDataSourceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RemoteDataSourceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RemoteDataSourceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RemoteDataSourceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RemoteDataSourceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RemoteDataSourceValidationError) ErrorName() string { return "RemoteDataSourceValidationError" }
// Error satisfies the builtin error interface
func (e RemoteDataSourceValidationError) 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 %sRemoteDataSource.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RemoteDataSourceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RemoteDataSourceValidationError{}
// Validate checks the field values on AsyncDataSource with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *AsyncDataSource) Validate() error {
if m == nil {
return nil
}
switch m.Specifier.(type) {
case *AsyncDataSource_Local:
if v, ok := interface{}(m.GetLocal()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AsyncDataSourceValidationError{
field: "Local",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *AsyncDataSource_Remote:
if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return AsyncDataSourceValidationError{
field: "Remote",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
return AsyncDataSourceValidationError{
field: "Specifier",
reason: "value is required",
}
}
return nil
}
// AsyncDataSourceValidationError is the validation error returned by
// AsyncDataSource.Validate if the designated constraints aren't met.
type AsyncDataSourceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e AsyncDataSourceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e AsyncDataSourceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e AsyncDataSourceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e AsyncDataSourceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e AsyncDataSourceValidationError) ErrorName() string { return "AsyncDataSourceValidationError" }
// Error satisfies the builtin error interface
func (e AsyncDataSourceValidationError) 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 %sAsyncDataSource.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = AsyncDataSourceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = AsyncDataSourceValidationError{}
// Validate checks the field values on TransportSocket with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -730,34 +1333,24 @@ func (m *TransportSocket) Validate() error {
case *TransportSocket_Config:
{
tmp := m.GetConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TransportSocketValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TransportSocketValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *TransportSocket_TypedConfig:
{
tmp := m.GetTypedConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TransportSocketValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TransportSocketValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -821,100 +1414,6 @@ var _ interface {
ErrorName() string
} = TransportSocketValidationError{}
// Validate checks the field values on SocketOption with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *SocketOption) Validate() error {
if m == nil {
return nil
}
// no validation rules for Description
// no validation rules for Level
// no validation rules for Name
if _, ok := SocketOption_SocketState_name[int32(m.GetState())]; !ok {
return SocketOptionValidationError{
field: "State",
reason: "value must be one of the defined enum values",
}
}
switch m.Value.(type) {
case *SocketOption_IntValue:
// no validation rules for IntValue
case *SocketOption_BufValue:
// no validation rules for BufValue
default:
return SocketOptionValidationError{
field: "Value",
reason: "value is required",
}
}
return nil
}
// SocketOptionValidationError is the validation error returned by
// SocketOption.Validate if the designated constraints aren't met.
type SocketOptionValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SocketOptionValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SocketOptionValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SocketOptionValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SocketOptionValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SocketOptionValidationError) ErrorName() string { return "SocketOptionValidationError" }
// Error satisfies the builtin error interface
func (e SocketOptionValidationError) 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 %sSocketOption.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SocketOptionValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SocketOptionValidationError{}
// Validate checks the field values on RuntimeFractionalPercent with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
@ -930,17 +1429,12 @@ func (m *RuntimeFractionalPercent) Validate() error {
}
}
{
tmp := m.GetDefaultValue()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RuntimeFractionalPercentValidationError{
field: "DefaultValue",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetDefaultValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RuntimeFractionalPercentValidationError{
field: "DefaultValue",
reason: "embedded message failed validation",
cause: err,
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/config_source.proto
package core
package envoy_api_v2_core
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _config_source_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on ApiConfigSource with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -48,43 +51,47 @@ func (m *ApiConfigSource) Validate() error {
}
}
if _, ok := ApiVersion_name[int32(m.GetTransportApiVersion())]; !ok {
return ApiConfigSourceValidationError{
field: "TransportApiVersion",
reason: "value must be one of the defined enum values",
}
}
for idx, item := range m.GetGrpcServices() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ApiConfigSourceValidationError{
field: fmt.Sprintf("GrpcServices[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
{
tmp := m.GetRefreshDelay()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ApiConfigSourceValidationError{
field: "RefreshDelay",
field: fmt.Sprintf("GrpcServices[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if v, ok := interface{}(m.GetRefreshDelay()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ApiConfigSourceValidationError{
field: "RefreshDelay",
reason: "embedded message failed validation",
cause: err,
}
}
}
if d := m.GetRequestTimeout(); d != nil {
dur := *d
dur, err := ptypes.Duration(d)
if err != nil {
return ApiConfigSourceValidationError{
field: "RequestTimeout",
reason: "value is not a valid duration",
cause: err,
}
}
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
@ -97,21 +104,18 @@ func (m *ApiConfigSource) Validate() error {
}
{
tmp := m.GetRateLimitSettings()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ApiConfigSourceValidationError{
field: "RateLimitSettings",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetRateLimitSettings()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ApiConfigSourceValidationError{
field: "RateLimitSettings",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for SetNodeOnFirstMessageOnly
return nil
}
@ -236,6 +240,71 @@ var _ interface {
ErrorName() string
} = AggregatedConfigSourceValidationError{}
// Validate checks the field values on SelfConfigSource with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *SelfConfigSource) Validate() error {
if m == nil {
return nil
}
return nil
}
// SelfConfigSourceValidationError is the validation error returned by
// SelfConfigSource.Validate if the designated constraints aren't met.
type SelfConfigSourceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SelfConfigSourceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SelfConfigSourceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SelfConfigSourceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SelfConfigSourceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SelfConfigSourceValidationError) ErrorName() string { return "SelfConfigSourceValidationError" }
// Error satisfies the builtin error interface
func (e SelfConfigSourceValidationError) 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 %sSelfConfigSource.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SelfConfigSourceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SelfConfigSourceValidationError{}
// Validate checks the field values on RateLimitSettings with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -244,17 +313,12 @@ func (m *RateLimitSettings) Validate() error {
return nil
}
{
tmp := m.GetMaxTokens()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RateLimitSettingsValidationError{
field: "MaxTokens",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMaxTokens()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RateLimitSettingsValidationError{
field: "MaxTokens",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -337,21 +401,23 @@ func (m *ConfigSource) Validate() error {
return nil
}
{
tmp := m.GetInitialFetchTimeout()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigSourceValidationError{
field: "InitialFetchTimeout",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetInitialFetchTimeout()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigSourceValidationError{
field: "InitialFetchTimeout",
reason: "embedded message failed validation",
cause: err,
}
}
}
if _, ok := ApiVersion_name[int32(m.GetResourceApiVersion())]; !ok {
return ConfigSourceValidationError{
field: "ResourceApiVersion",
reason: "value must be one of the defined enum values",
}
}
switch m.ConfigSourceSpecifier.(type) {
case *ConfigSource_Path:
@ -359,34 +425,36 @@ func (m *ConfigSource) Validate() error {
case *ConfigSource_ApiConfigSource:
{
tmp := m.GetApiConfigSource()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigSourceValidationError{
field: "ApiConfigSource",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetApiConfigSource()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigSourceValidationError{
field: "ApiConfigSource",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *ConfigSource_Ads:
{
tmp := m.GetAds()
if v, ok := interface{}(m.GetAds()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigSourceValidationError{
field: "Ads",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
case *ConfigSource_Self:
if err := v.Validate(); err != nil {
return ConfigSourceValidationError{
field: "Ads",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSelf()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ConfigSourceValidationError{
field: "Self",
reason: "embedded message failed validation",
cause: err,
}
}
}

View File

@ -0,0 +1,118 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/core/event_service_config.proto
package envoy_api_v2_core
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type EventServiceConfig struct {
// Types that are valid to be assigned to ConfigSourceSpecifier:
// *EventServiceConfig_GrpcService
ConfigSourceSpecifier isEventServiceConfig_ConfigSourceSpecifier `protobuf_oneof:"config_source_specifier"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *EventServiceConfig) Reset() { *m = EventServiceConfig{} }
func (m *EventServiceConfig) String() string { return proto.CompactTextString(m) }
func (*EventServiceConfig) ProtoMessage() {}
func (*EventServiceConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_0289257eb2a50b92, []int{0}
}
func (m *EventServiceConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EventServiceConfig.Unmarshal(m, b)
}
func (m *EventServiceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EventServiceConfig.Marshal(b, m, deterministic)
}
func (m *EventServiceConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_EventServiceConfig.Merge(m, src)
}
func (m *EventServiceConfig) XXX_Size() int {
return xxx_messageInfo_EventServiceConfig.Size(m)
}
func (m *EventServiceConfig) XXX_DiscardUnknown() {
xxx_messageInfo_EventServiceConfig.DiscardUnknown(m)
}
var xxx_messageInfo_EventServiceConfig proto.InternalMessageInfo
type isEventServiceConfig_ConfigSourceSpecifier interface {
isEventServiceConfig_ConfigSourceSpecifier()
}
type EventServiceConfig_GrpcService struct {
GrpcService *GrpcService `protobuf:"bytes,1,opt,name=grpc_service,json=grpcService,proto3,oneof"`
}
func (*EventServiceConfig_GrpcService) isEventServiceConfig_ConfigSourceSpecifier() {}
func (m *EventServiceConfig) GetConfigSourceSpecifier() isEventServiceConfig_ConfigSourceSpecifier {
if m != nil {
return m.ConfigSourceSpecifier
}
return nil
}
func (m *EventServiceConfig) GetGrpcService() *GrpcService {
if x, ok := m.GetConfigSourceSpecifier().(*EventServiceConfig_GrpcService); ok {
return x.GrpcService
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*EventServiceConfig) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*EventServiceConfig_GrpcService)(nil),
}
}
func init() {
proto.RegisterType((*EventServiceConfig)(nil), "envoy.api.v2.core.EventServiceConfig")
}
func init() {
proto.RegisterFile("envoy/api/v2/core/event_service_config.proto", fileDescriptor_0289257eb2a50b92)
}
var fileDescriptor_0289257eb2a50b92 = []byte{
// 276 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4a, 0xc4, 0x30,
0x14, 0x86, 0xad, 0xe2, 0x2c, 0x3a, 0x2e, 0xb4, 0x88, 0x95, 0x01, 0xab, 0x88, 0x0b, 0x17, 0x92,
0x40, 0xe7, 0x06, 0x1d, 0x44, 0x97, 0x83, 0x1e, 0xa0, 0xc6, 0xcc, 0x9b, 0xf2, 0x40, 0xf3, 0x42,
0x92, 0x06, 0xbb, 0xf3, 0x06, 0x6e, 0x3d, 0x8b, 0x27, 0x70, 0xeb, 0x55, 0x5c, 0xb9, 0x12, 0x69,
0xd3, 0xe2, 0x40, 0x77, 0x09, 0xff, 0xfb, 0xff, 0xf7, 0xfd, 0x2f, 0xbe, 0x02, 0xe5, 0xa9, 0xe1,
0x42, 0x23, 0xf7, 0x39, 0x97, 0x64, 0x80, 0x83, 0x07, 0xe5, 0x4a, 0x0b, 0xc6, 0xa3, 0x84, 0x52,
0x92, 0x5a, 0x63, 0xc5, 0xb4, 0x21, 0x47, 0xc9, 0x41, 0x37, 0xcd, 0x84, 0x46, 0xe6, 0x73, 0xd6,
0x4e, 0xcf, 0x2e, 0xc6, 0x01, 0x95, 0xd1, 0x72, 0xf0, 0x07, 0xe3, 0x2c, 0xab, 0x57, 0x5a, 0x70,
0xa1, 0x14, 0x39, 0xe1, 0x90, 0x94, 0xe5, 0xcf, 0x58, 0x19, 0xe1, 0x06, 0xfd, 0x64, 0xa4, 0x5b,
0x27, 0x5c, 0x6d, 0x7b, 0x39, 0xf5, 0xe2, 0x09, 0x57, 0xc2, 0x01, 0x1f, 0x1e, 0x41, 0x38, 0x6f,
0xe2, 0xe4, 0xba, 0xc5, 0xbd, 0x0f, 0xdb, 0x16, 0x1d, 0x6c, 0xb2, 0x88, 0xf7, 0x36, 0x19, 0x8e,
0xa3, 0xb3, 0xe8, 0x72, 0x9a, 0x67, 0x6c, 0x44, 0xcf, 0x6e, 0x8c, 0x96, 0xbd, 0xf7, 0x76, 0xeb,
0x6e, 0x5a, 0xfd, 0x7f, 0x8b, 0x2c, 0x4e, 0x43, 0xf7, 0xd2, 0x52, 0x6d, 0x24, 0x94, 0x56, 0x83,
0xc4, 0x35, 0x82, 0x49, 0x76, 0x7e, 0x8a, 0xa8, 0x78, 0xf8, 0x7e, 0xff, 0x7d, 0xdb, 0x3d, 0x4a,
0x0e, 0x43, 0x6a, 0x7f, 0xa7, 0x2e, 0xd5, 0xcf, 0x3f, 0x5e, 0x3f, 0xbf, 0x26, 0xdb, 0xfb, 0x51,
0x7c, 0x8a, 0x14, 0xd6, 0x6a, 0x43, 0x2f, 0xcd, 0x98, 0xa0, 0x48, 0xc7, 0xfc, 0xcb, 0xb6, 0xda,
0x32, 0x7a, 0x9c, 0x74, 0x1d, 0xe7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x56, 0x93, 0xc8, 0xf3,
0xa4, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,126 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/event_service_config.proto
package envoy_api_v2_core
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _event_service_config_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on EventServiceConfig with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *EventServiceConfig) Validate() error {
if m == nil {
return nil
}
switch m.ConfigSourceSpecifier.(type) {
case *EventServiceConfig_GrpcService:
if v, ok := interface{}(m.GetGrpcService()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return EventServiceConfigValidationError{
field: "GrpcService",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
return EventServiceConfigValidationError{
field: "ConfigSourceSpecifier",
reason: "value is required",
}
}
return nil
}
// EventServiceConfigValidationError is the validation error returned by
// EventServiceConfig.Validate if the designated constraints aren't met.
type EventServiceConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e EventServiceConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e EventServiceConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e EventServiceConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e EventServiceConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e EventServiceConfigValidationError) ErrorName() string {
return "EventServiceConfigValidationError"
}
// Error satisfies the builtin error interface
func (e EventServiceConfigValidationError) 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 %sEventServiceConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = EventServiceConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = EventServiceConfigValidationError{}

View File

@ -0,0 +1,141 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/core/grpc_method_list.proto
package envoy_api_v2_core
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type GrpcMethodList struct {
Services []*GrpcMethodList_Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GrpcMethodList) Reset() { *m = GrpcMethodList{} }
func (m *GrpcMethodList) String() string { return proto.CompactTextString(m) }
func (*GrpcMethodList) ProtoMessage() {}
func (*GrpcMethodList) Descriptor() ([]byte, []int) {
return fileDescriptor_63bac5d4aa07ee79, []int{0}
}
func (m *GrpcMethodList) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GrpcMethodList.Unmarshal(m, b)
}
func (m *GrpcMethodList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GrpcMethodList.Marshal(b, m, deterministic)
}
func (m *GrpcMethodList) XXX_Merge(src proto.Message) {
xxx_messageInfo_GrpcMethodList.Merge(m, src)
}
func (m *GrpcMethodList) XXX_Size() int {
return xxx_messageInfo_GrpcMethodList.Size(m)
}
func (m *GrpcMethodList) XXX_DiscardUnknown() {
xxx_messageInfo_GrpcMethodList.DiscardUnknown(m)
}
var xxx_messageInfo_GrpcMethodList proto.InternalMessageInfo
func (m *GrpcMethodList) GetServices() []*GrpcMethodList_Service {
if m != nil {
return m.Services
}
return nil
}
type GrpcMethodList_Service struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
MethodNames []string `protobuf:"bytes,2,rep,name=method_names,json=methodNames,proto3" json:"method_names,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GrpcMethodList_Service) Reset() { *m = GrpcMethodList_Service{} }
func (m *GrpcMethodList_Service) String() string { return proto.CompactTextString(m) }
func (*GrpcMethodList_Service) ProtoMessage() {}
func (*GrpcMethodList_Service) Descriptor() ([]byte, []int) {
return fileDescriptor_63bac5d4aa07ee79, []int{0, 0}
}
func (m *GrpcMethodList_Service) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GrpcMethodList_Service.Unmarshal(m, b)
}
func (m *GrpcMethodList_Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GrpcMethodList_Service.Marshal(b, m, deterministic)
}
func (m *GrpcMethodList_Service) XXX_Merge(src proto.Message) {
xxx_messageInfo_GrpcMethodList_Service.Merge(m, src)
}
func (m *GrpcMethodList_Service) XXX_Size() int {
return xxx_messageInfo_GrpcMethodList_Service.Size(m)
}
func (m *GrpcMethodList_Service) XXX_DiscardUnknown() {
xxx_messageInfo_GrpcMethodList_Service.DiscardUnknown(m)
}
var xxx_messageInfo_GrpcMethodList_Service proto.InternalMessageInfo
func (m *GrpcMethodList_Service) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *GrpcMethodList_Service) GetMethodNames() []string {
if m != nil {
return m.MethodNames
}
return nil
}
func init() {
proto.RegisterType((*GrpcMethodList)(nil), "envoy.api.v2.core.GrpcMethodList")
proto.RegisterType((*GrpcMethodList_Service)(nil), "envoy.api.v2.core.GrpcMethodList.Service")
}
func init() {
proto.RegisterFile("envoy/api/v2/core/grpc_method_list.proto", fileDescriptor_63bac5d4aa07ee79)
}
var fileDescriptor_63bac5d4aa07ee79 = []byte{
// 304 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x4f, 0x4a, 0x03, 0x31,
0x1c, 0x85, 0xc9, 0xf4, 0x7f, 0x2a, 0xa2, 0xa3, 0x68, 0xa9, 0xa8, 0x83, 0xab, 0x11, 0x21, 0x81,
0xf6, 0x06, 0x01, 0x71, 0xa3, 0x52, 0xda, 0xad, 0x50, 0xe2, 0x4c, 0x1c, 0x03, 0x9d, 0x24, 0x24,
0x69, 0xb0, 0x3b, 0x6f, 0x20, 0xb8, 0xf2, 0x10, 0x9e, 0xc0, 0x13, 0xb8, 0xf5, 0x2a, 0x2e, 0xbb,
0x10, 0x99, 0xc9, 0x28, 0x94, 0xd9, 0x25, 0xbf, 0xef, 0x3d, 0xf8, 0x78, 0x30, 0x66, 0xc2, 0xc9,
0x15, 0xa6, 0x8a, 0x63, 0x37, 0xc2, 0x89, 0xd4, 0x0c, 0x67, 0x5a, 0x25, 0xf3, 0x9c, 0xd9, 0x47,
0x99, 0xce, 0x17, 0xdc, 0x58, 0xa4, 0xb4, 0xb4, 0x32, 0xdc, 0x2d, 0x93, 0x88, 0x2a, 0x8e, 0xdc,
0x08, 0x15, 0xc9, 0xe1, 0xc9, 0x32, 0x55, 0x14, 0x53, 0x21, 0xa4, 0xa5, 0x96, 0x4b, 0x61, 0x70,
0xce, 0x33, 0x4d, 0x2d, 0xf3, 0x95, 0xe1, 0x71, 0x8d, 0x1b, 0x4b, 0xed, 0xd2, 0x54, 0xf8, 0xd0,
0xd1, 0x05, 0x4f, 0xa9, 0x65, 0xf8, 0xef, 0xe1, 0xc1, 0xd9, 0x3b, 0x80, 0xdb, 0x57, 0x5a, 0x25,
0x37, 0xa5, 0xc4, 0x35, 0x37, 0x36, 0xbc, 0x84, 0x5d, 0xc3, 0xb4, 0xe3, 0x09, 0x33, 0x03, 0x10,
0x35, 0xe2, 0xfe, 0xe8, 0x1c, 0xd5, 0x84, 0xd0, 0x66, 0x09, 0xcd, 0x7c, 0x63, 0xfa, 0x5f, 0x1d,
0xce, 0x60, 0xa7, 0x3a, 0x86, 0x47, 0xb0, 0x29, 0x68, 0xce, 0x06, 0x20, 0x02, 0x71, 0x8f, 0x74,
0xd6, 0xa4, 0xa9, 0x83, 0x08, 0x4c, 0xcb, 0x63, 0x78, 0x01, 0xb7, 0xaa, 0x05, 0x8a, 0xaf, 0x19,
0x04, 0x51, 0x23, 0xee, 0x91, 0xee, 0x9a, 0xb4, 0x5e, 0x41, 0xd0, 0x05, 0xd3, 0xbe, 0xa7, 0xb7,
0x05, 0x24, 0x77, 0xdf, 0x6f, 0x3f, 0x2f, 0xad, 0x83, 0x70, 0xdf, 0x0b, 0x25, 0x52, 0x3c, 0xf0,
0xcc, 0x0b, 0xb9, 0xf1, 0xc7, 0xf3, 0xe7, 0x57, 0x3b, 0xd8, 0x01, 0xf0, 0x94, 0x4b, 0x6f, 0xac,
0xb4, 0x7c, 0x5a, 0xd5, 0xe5, 0xc9, 0xde, 0xa6, 0xfd, 0xa4, 0x98, 0x62, 0x02, 0xee, 0xdb, 0xe5,
0x26, 0xe3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0x34, 0x3a, 0xc6, 0xaa, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,198 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/grpc_method_list.proto
package envoy_api_v2_core
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _grpc_method_list_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on GrpcMethodList with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *GrpcMethodList) Validate() error {
if m == nil {
return nil
}
for idx, item := range m.GetServices() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcMethodListValidationError{
field: fmt.Sprintf("Services[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// GrpcMethodListValidationError is the validation error returned by
// GrpcMethodList.Validate if the designated constraints aren't met.
type GrpcMethodListValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GrpcMethodListValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GrpcMethodListValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GrpcMethodListValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GrpcMethodListValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GrpcMethodListValidationError) ErrorName() string { return "GrpcMethodListValidationError" }
// Error satisfies the builtin error interface
func (e GrpcMethodListValidationError) 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 %sGrpcMethodList.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GrpcMethodListValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GrpcMethodListValidationError{}
// Validate checks the field values on GrpcMethodList_Service with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *GrpcMethodList_Service) Validate() error {
if m == nil {
return nil
}
if len(m.GetName()) < 1 {
return GrpcMethodList_ServiceValidationError{
field: "Name",
reason: "value length must be at least 1 bytes",
}
}
if len(m.GetMethodNames()) < 1 {
return GrpcMethodList_ServiceValidationError{
field: "MethodNames",
reason: "value must contain at least 1 item(s)",
}
}
return nil
}
// GrpcMethodList_ServiceValidationError is the validation error returned by
// GrpcMethodList_Service.Validate if the designated constraints aren't met.
type GrpcMethodList_ServiceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GrpcMethodList_ServiceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GrpcMethodList_ServiceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GrpcMethodList_ServiceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GrpcMethodList_ServiceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GrpcMethodList_ServiceValidationError) ErrorName() string {
return "GrpcMethodList_ServiceValidationError"
}
// Error satisfies the builtin error interface
func (e GrpcMethodList_ServiceValidationError) 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 %sGrpcMethodList_Service.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GrpcMethodList_ServiceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GrpcMethodList_ServiceValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/grpc_service.proto
package core
package envoy_api_v2_core
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _grpc_service_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on GrpcService with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
@ -41,17 +44,12 @@ func (m *GrpcService) Validate() error {
return nil
}
{
tmp := m.GetTimeout()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: "Timeout",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: "Timeout",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -59,17 +57,12 @@ func (m *GrpcService) Validate() error {
for idx, item := range m.GetInitialMetadata() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: fmt.Sprintf("InitialMetadata[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: fmt.Sprintf("InitialMetadata[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -80,34 +73,24 @@ func (m *GrpcService) Validate() error {
case *GrpcService_EnvoyGrpc_:
{
tmp := m.GetEnvoyGrpc()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: "EnvoyGrpc",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetEnvoyGrpc()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: "EnvoyGrpc",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *GrpcService_GoogleGrpc_:
{
tmp := m.GetGoogleGrpc()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: "GoogleGrpc",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetGoogleGrpc()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcServiceValidationError{
field: "GoogleGrpc",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -266,17 +249,12 @@ func (m *GrpcService_GoogleGrpc) Validate() error {
}
}
{
tmp := m.GetChannelCredentials()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpcValidationError{
field: "ChannelCredentials",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetChannelCredentials()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpcValidationError{
field: "ChannelCredentials",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -284,17 +262,12 @@ func (m *GrpcService_GoogleGrpc) Validate() error {
for idx, item := range m.GetCallCredentials() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpcValidationError{
field: fmt.Sprintf("CallCredentials[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpcValidationError{
field: fmt.Sprintf("CallCredentials[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -310,17 +283,12 @@ func (m *GrpcService_GoogleGrpc) Validate() error {
// no validation rules for CredentialsFactoryName
{
tmp := m.GetConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpcValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpcValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -392,47 +360,32 @@ func (m *GrpcService_GoogleGrpc_SslCredentials) Validate() error {
return nil
}
{
tmp := m.GetRootCerts()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_SslCredentialsValidationError{
field: "RootCerts",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetRootCerts()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_SslCredentialsValidationError{
field: "RootCerts",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetPrivateKey()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_SslCredentialsValidationError{
field: "PrivateKey",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetPrivateKey()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_SslCredentialsValidationError{
field: "PrivateKey",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetCertChain()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_SslCredentialsValidationError{
field: "CertChain",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetCertChain()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_SslCredentialsValidationError{
field: "CertChain",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -578,51 +531,36 @@ func (m *GrpcService_GoogleGrpc_ChannelCredentials) Validate() error {
case *GrpcService_GoogleGrpc_ChannelCredentials_SslCredentials:
{
tmp := m.GetSslCredentials()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{
field: "SslCredentials",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSslCredentials()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{
field: "SslCredentials",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *GrpcService_GoogleGrpc_ChannelCredentials_GoogleDefault:
{
tmp := m.GetGoogleDefault()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{
field: "GoogleDefault",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetGoogleDefault()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{
field: "GoogleDefault",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *GrpcService_GoogleGrpc_ChannelCredentials_LocalCredentials:
{
tmp := m.GetLocalCredentials()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{
field: "LocalCredentials",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetLocalCredentials()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_ChannelCredentialsValidationError{
field: "LocalCredentials",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -710,17 +648,12 @@ func (m *GrpcService_GoogleGrpc_CallCredentials) Validate() error {
case *GrpcService_GoogleGrpc_CallCredentials_GoogleComputeEngine:
{
tmp := m.GetGoogleComputeEngine()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "GoogleComputeEngine",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetGoogleComputeEngine()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "GoogleComputeEngine",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -730,51 +663,48 @@ func (m *GrpcService_GoogleGrpc_CallCredentials) Validate() error {
case *GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJwtAccess:
{
tmp := m.GetServiceAccountJwtAccess()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "ServiceAccountJwtAccess",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetServiceAccountJwtAccess()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "ServiceAccountJwtAccess",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *GrpcService_GoogleGrpc_CallCredentials_GoogleIam:
{
tmp := m.GetGoogleIam()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "GoogleIam",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetGoogleIam()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "GoogleIam",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *GrpcService_GoogleGrpc_CallCredentials_FromPlugin:
{
tmp := m.GetFromPlugin()
if v, ok := interface{}(m.GetFromPlugin()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "FromPlugin",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
case *GrpcService_GoogleGrpc_CallCredentials_StsService_:
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "FromPlugin",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetStsService()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentialsValidationError{
field: "StsService",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -1026,34 +956,24 @@ func (m *GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin) V
case *GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_Config:
{
tmp := m.GetConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_TypedConfig:
{
tmp := m.GetTypedConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -1128,3 +1048,107 @@ var _ interface {
Cause() error
ErrorName() string
} = GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPluginValidationError{}
// Validate checks the field values on
// GrpcService_GoogleGrpc_CallCredentials_StsService with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *GrpcService_GoogleGrpc_CallCredentials_StsService) Validate() error {
if m == nil {
return nil
}
// no validation rules for TokenExchangeServiceUri
// no validation rules for Resource
// no validation rules for Audience
// no validation rules for Scope
// no validation rules for RequestedTokenType
if len(m.GetSubjectTokenPath()) < 1 {
return GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{
field: "SubjectTokenPath",
reason: "value length must be at least 1 bytes",
}
}
if len(m.GetSubjectTokenType()) < 1 {
return GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{
field: "SubjectTokenType",
reason: "value length must be at least 1 bytes",
}
}
// no validation rules for ActorTokenPath
// no validation rules for ActorTokenType
return nil
}
// GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError is the
// validation error returned by
// GrpcService_GoogleGrpc_CallCredentials_StsService.Validate if the
// designated constraints aren't met.
type GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Field() string {
return e.field
}
// Reason function returns reason value.
func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Reason() string {
return e.reason
}
// Cause function returns cause value.
func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Cause() error {
return e.cause
}
// Key function returns key value.
func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) ErrorName() string {
return "GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError"
}
// Error satisfies the builtin error interface
func (e GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError) 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 %sGrpcService_GoogleGrpc_CallCredentials_StsService.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GrpcService_GoogleGrpc_CallCredentials_StsServiceValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/health_check.proto
package core
package envoy_api_v2_core
import (
"bytes"
@ -15,7 +15,9 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
_type "github.com/envoyproxy/go-control-plane/envoy/type"
)
// ensure the imports are used
@ -30,9 +32,14 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
_ = _type.CodecClientType(0)
)
// define the regex for a UUID once up-front
var _health_check_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on HealthCheck with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
@ -49,7 +56,14 @@ func (m *HealthCheck) Validate() error {
}
if d := m.GetTimeout(); d != nil {
dur := *d
dur, err := ptypes.Duration(d)
if err != nil {
return HealthCheckValidationError{
field: "Timeout",
reason: "value is not a valid duration",
cause: err,
}
}
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
@ -70,7 +84,14 @@ func (m *HealthCheck) Validate() error {
}
if d := m.GetInterval(); d != nil {
dur := *d
dur, err := ptypes.Duration(d)
if err != nil {
return HealthCheckValidationError{
field: "Interval",
reason: "value is not a valid duration",
cause: err,
}
}
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
@ -83,85 +104,84 @@ func (m *HealthCheck) Validate() error {
}
{
tmp := m.GetIntervalJitter()
if v, ok := interface{}(m.GetInitialJitter()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "InitialJitter",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "IntervalJitter",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetIntervalJitter()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "IntervalJitter",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for IntervalJitterPercent
{
tmp := m.GetUnhealthyThreshold()
if m.GetUnhealthyThreshold() == nil {
return HealthCheckValidationError{
field: "UnhealthyThreshold",
reason: "value is required",
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "UnhealthyThreshold",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetUnhealthyThreshold()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "UnhealthyThreshold",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetHealthyThreshold()
if m.GetHealthyThreshold() == nil {
return HealthCheckValidationError{
field: "HealthyThreshold",
reason: "value is required",
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "HealthyThreshold",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetHealthyThreshold()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "HealthyThreshold",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetAltPort()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "AltPort",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetAltPort()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "AltPort",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetReuseConnection()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "ReuseConnection",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetReuseConnection()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "ReuseConnection",
reason: "embedded message failed validation",
cause: err,
}
}
}
if d := m.GetNoTrafficInterval(); d != nil {
dur, err := types.DurationFromProto(d)
dur, err := ptypes.Duration(d)
if err != nil {
return HealthCheckValidationError{
field: "NoTrafficInterval",
@ -182,7 +202,7 @@ func (m *HealthCheck) Validate() error {
}
if d := m.GetUnhealthyInterval(); d != nil {
dur, err := types.DurationFromProto(d)
dur, err := ptypes.Duration(d)
if err != nil {
return HealthCheckValidationError{
field: "UnhealthyInterval",
@ -203,7 +223,7 @@ func (m *HealthCheck) Validate() error {
}
if d := m.GetUnhealthyEdgeInterval(); d != nil {
dur, err := types.DurationFromProto(d)
dur, err := ptypes.Duration(d)
if err != nil {
return HealthCheckValidationError{
field: "UnhealthyEdgeInterval",
@ -224,7 +244,7 @@ func (m *HealthCheck) Validate() error {
}
if d := m.GetHealthyEdgeInterval(); d != nil {
dur, err := types.DurationFromProto(d)
dur, err := ptypes.Duration(d)
if err != nil {
return HealthCheckValidationError{
field: "HealthyEdgeInterval",
@ -246,74 +266,74 @@ func (m *HealthCheck) Validate() error {
// no validation rules for EventLogPath
if v, ok := interface{}(m.GetEventService()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "EventService",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for AlwaysLogHealthCheckFailures
if v, ok := interface{}(m.GetTlsOptions()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "TlsOptions",
reason: "embedded message failed validation",
cause: err,
}
}
}
switch m.HealthChecker.(type) {
case *HealthCheck_HttpHealthCheck_:
{
tmp := m.GetHttpHealthCheck()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "HttpHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetHttpHealthCheck()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "HttpHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *HealthCheck_TcpHealthCheck_:
{
tmp := m.GetTcpHealthCheck()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "TcpHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTcpHealthCheck()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "TcpHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *HealthCheck_GrpcHealthCheck_:
{
tmp := m.GetGrpcHealthCheck()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "GrpcHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetGrpcHealthCheck()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "GrpcHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *HealthCheck_CustomHealthCheck_:
{
tmp := m.GetCustomHealthCheck()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "CustomHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetCustomHealthCheck()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheckValidationError{
field: "CustomHealthCheck",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -489,32 +509,22 @@ func (m *HealthCheck_HttpHealthCheck) Validate() error {
}
}
{
tmp := m.GetSend()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: "Send",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSend()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: "Send",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetReceive()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: "Receive",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetReceive()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: "Receive",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -531,17 +541,12 @@ func (m *HealthCheck_HttpHealthCheck) Validate() error {
for idx, item := range m.GetRequestHeadersToAdd() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -553,23 +558,35 @@ func (m *HealthCheck_HttpHealthCheck) Validate() error {
for idx, item := range m.GetExpectedStatuses() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: fmt.Sprintf("ExpectedStatuses[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: fmt.Sprintf("ExpectedStatuses[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if _, ok := _type.CodecClientType_name[int32(m.GetCodecClientType())]; !ok {
return HealthCheck_HttpHealthCheckValidationError{
field: "CodecClientType",
reason: "value must be one of the defined enum values",
}
}
if v, ok := interface{}(m.GetServiceNameMatcher()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_HttpHealthCheckValidationError{
field: "ServiceNameMatcher",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
@ -638,17 +655,12 @@ func (m *HealthCheck_TcpHealthCheck) Validate() error {
return nil
}
{
tmp := m.GetSend()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_TcpHealthCheckValidationError{
field: "Send",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetSend()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_TcpHealthCheckValidationError{
field: "Send",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -656,17 +668,12 @@ func (m *HealthCheck_TcpHealthCheck) Validate() error {
for idx, item := range m.GetReceive() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_TcpHealthCheckValidationError{
field: fmt.Sprintf("Receive[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_TcpHealthCheckValidationError{
field: fmt.Sprintf("Receive[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -893,34 +900,24 @@ func (m *HealthCheck_CustomHealthCheck) Validate() error {
case *HealthCheck_CustomHealthCheck_Config:
{
tmp := m.GetConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_CustomHealthCheckValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_CustomHealthCheckValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *HealthCheck_CustomHealthCheck_TypedConfig:
{
tmp := m.GetTypedConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_CustomHealthCheckValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HealthCheck_CustomHealthCheckValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -986,3 +983,70 @@ var _ interface {
Cause() error
ErrorName() string
} = HealthCheck_CustomHealthCheckValidationError{}
// Validate checks the field values on HealthCheck_TlsOptions with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *HealthCheck_TlsOptions) Validate() error {
if m == nil {
return nil
}
return nil
}
// HealthCheck_TlsOptionsValidationError is the validation error returned by
// HealthCheck_TlsOptions.Validate if the designated constraints aren't met.
type HealthCheck_TlsOptionsValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e HealthCheck_TlsOptionsValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e HealthCheck_TlsOptionsValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e HealthCheck_TlsOptionsValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e HealthCheck_TlsOptionsValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e HealthCheck_TlsOptionsValidationError) ErrorName() string {
return "HealthCheck_TlsOptionsValidationError"
}
// Error satisfies the builtin error interface
func (e HealthCheck_TlsOptionsValidationError) 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 %sHealthCheck_TlsOptions.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = HealthCheck_TlsOptionsValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = HealthCheck_TlsOptionsValidationError{}

View File

@ -1,57 +1,37 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/core/http_uri.proto
package core
package envoy_api_v2_core
import (
fmt "fmt"
io "io"
math "math"
time "time"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
_ "github.com/gogo/protobuf/types"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
proto "github.com/golang/protobuf/proto"
duration "github.com/golang/protobuf/ptypes/duration"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Envoy external URI descriptor
type HttpUri struct {
// The HTTP server URI. It should be a full FQDN with protocol, host and path.
//
// Example:
//
// .. code-block:: yaml
//
// uri: https://www.googleapis.com/oauth2/v1/certs
//
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
// Specify how `uri` is to be fetched. Today, this requires an explicit
// cluster, but in the future we may support dynamic cluster creation or
// inline DNS resolution. See `issue
// <https://github.com/envoyproxy/envoy/issues/1606>`_.
//
// Types that are valid to be assigned to HttpUpstreamType:
// *HttpUri_Cluster
HttpUpstreamType isHttpUri_HttpUpstreamType `protobuf_oneof:"http_upstream_type"`
// Sets the maximum duration in milliseconds that a response can take to arrive upon request.
Timeout *time.Duration `protobuf:"bytes,3,opt,name=timeout,proto3,stdduration" json:"timeout,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
HttpUpstreamType isHttpUri_HttpUpstreamType `protobuf_oneof:"http_upstream_type"`
Timeout *duration.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *HttpUri) Reset() { *m = HttpUri{} }
@ -60,26 +40,18 @@ func (*HttpUri) ProtoMessage() {}
func (*HttpUri) Descriptor() ([]byte, []int) {
return fileDescriptor_1660b946db74c078, []int{0}
}
func (m *HttpUri) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
return xxx_messageInfo_HttpUri.Unmarshal(m, b)
}
func (m *HttpUri) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_HttpUri.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
return xxx_messageInfo_HttpUri.Marshal(b, m, deterministic)
}
func (m *HttpUri) XXX_Merge(src proto.Message) {
xxx_messageInfo_HttpUri.Merge(m, src)
}
func (m *HttpUri) XXX_Size() int {
return m.Size()
return xxx_messageInfo_HttpUri.Size(m)
}
func (m *HttpUri) XXX_DiscardUnknown() {
xxx_messageInfo_HttpUri.DiscardUnknown(m)
@ -87,10 +59,15 @@ func (m *HttpUri) XXX_DiscardUnknown() {
var xxx_messageInfo_HttpUri proto.InternalMessageInfo
func (m *HttpUri) GetUri() string {
if m != nil {
return m.Uri
}
return ""
}
type isHttpUri_HttpUpstreamType interface {
isHttpUri_HttpUpstreamType()
MarshalTo([]byte) (int, error)
Size() int
}
type HttpUri_Cluster struct {
@ -106,13 +83,6 @@ func (m *HttpUri) GetHttpUpstreamType() isHttpUri_HttpUpstreamType {
return nil
}
func (m *HttpUri) GetUri() string {
if m != nil {
return m.Uri
}
return ""
}
func (m *HttpUri) GetCluster() string {
if x, ok := m.GetHttpUpstreamType().(*HttpUri_Cluster); ok {
return x.Cluster
@ -120,64 +90,20 @@ func (m *HttpUri) GetCluster() string {
return ""
}
func (m *HttpUri) GetTimeout() *time.Duration {
func (m *HttpUri) GetTimeout() *duration.Duration {
if m != nil {
return m.Timeout
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*HttpUri) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _HttpUri_OneofMarshaler, _HttpUri_OneofUnmarshaler, _HttpUri_OneofSizer, []interface{}{
// XXX_OneofWrappers is for the internal use of the proto package.
func (*HttpUri) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*HttpUri_Cluster)(nil),
}
}
func _HttpUri_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*HttpUri)
// http_upstream_type
switch x := m.HttpUpstreamType.(type) {
case *HttpUri_Cluster:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Cluster)
case nil:
default:
return fmt.Errorf("HttpUri.HttpUpstreamType has unexpected type %T", x)
}
return nil
}
func _HttpUri_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*HttpUri)
switch tag {
case 2: // http_upstream_type.cluster
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.HttpUpstreamType = &HttpUri_Cluster{x}
return true, err
default:
return false, nil
}
}
func _HttpUri_OneofSizer(msg proto.Message) (n int) {
m := msg.(*HttpUri)
// http_upstream_type
switch x := m.HttpUpstreamType.(type) {
case *HttpUri_Cluster:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Cluster)))
n += len(x.Cluster)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
func init() {
proto.RegisterType((*HttpUri)(nil), "envoy.api.v2.core.HttpUri")
}
@ -185,397 +111,26 @@ func init() {
func init() { proto.RegisterFile("envoy/api/v2/core/http_uri.proto", fileDescriptor_1660b946db74c078) }
var fileDescriptor_1660b946db74c078 = []byte{
// 301 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xb1, 0x4a, 0x33, 0x41,
0x10, 0xc7, 0x33, 0xb9, 0x2f, 0x5f, 0xcc, 0x6a, 0xe3, 0x22, 0x78, 0x26, 0x70, 0x39, 0x04, 0x21,
0xd5, 0x2e, 0x9c, 0xb5, 0xcd, 0x61, 0x91, 0x46, 0x08, 0x01, 0xeb, 0xb0, 0x49, 0xd6, 0x73, 0x21,
0xc9, 0x2c, 0x9b, 0xd9, 0xc3, 0xbc, 0x89, 0xcf, 0xe0, 0x13, 0xa8, 0x55, 0x4a, 0x4b, 0xdf, 0x40,
0x49, 0x97, 0xb7, 0x90, 0xbb, 0xcb, 0x35, 0xda, 0xfd, 0x99, 0xf9, 0xed, 0xf0, 0xdb, 0x3f, 0x8b,
0xf5, 0x2a, 0xc7, 0x8d, 0x54, 0xd6, 0xc8, 0x3c, 0x91, 0x33, 0x74, 0x5a, 0x3e, 0x12, 0xd9, 0x89,
0x77, 0x46, 0x58, 0x87, 0x84, 0xfc, 0xb4, 0x24, 0x84, 0xb2, 0x46, 0xe4, 0x89, 0x28, 0x88, 0x6e,
0x94, 0x21, 0x66, 0x0b, 0x2d, 0x4b, 0x60, 0xea, 0x1f, 0xe4, 0xdc, 0x3b, 0x45, 0x06, 0x57, 0xd5,
0x93, 0xee, 0x59, 0x86, 0x19, 0x96, 0x51, 0x16, 0xe9, 0x30, 0x3d, 0xcf, 0xd5, 0xc2, 0xcc, 0x15,
0x69, 0x59, 0x87, 0x6a, 0x71, 0xf9, 0x06, 0xac, 0x3d, 0x24, 0xb2, 0xf7, 0xce, 0xf0, 0x1e, 0x0b,
0xbc, 0x33, 0x21, 0xc4, 0x30, 0xe8, 0xa4, 0x9d, 0xf7, 0xfd, 0x36, 0xf8, 0xe7, 0x9a, 0x31, 0x8c,
0x8b, 0x29, 0xbf, 0x62, 0xed, 0xd9, 0xc2, 0xaf, 0x49, 0xbb, 0xb0, 0xf9, 0x0b, 0x18, 0x36, 0xc6,
0xf5, 0x8e, 0xdf, 0xb1, 0x36, 0x99, 0xa5, 0x46, 0x4f, 0x61, 0x10, 0xc3, 0xe0, 0x38, 0xb9, 0x10,
0x95, 0xb0, 0xa8, 0x85, 0xc5, 0xed, 0x41, 0x38, 0x0d, 0x9f, 0xbf, 0xfa, 0x50, 0x5c, 0x69, 0xbd,
0x40, 0x33, 0x69, 0xd4, 0xe9, 0x08, 0xc6, 0xf5, 0x8d, 0xb4, 0xc7, 0x78, 0x55, 0x89, 0x5d, 0x93,
0xd3, 0x6a, 0x39, 0xa1, 0x8d, 0xd5, 0xbc, 0xf5, 0xba, 0xdf, 0x06, 0x90, 0xde, 0x7c, 0xec, 0x22,
0xf8, 0xdc, 0x45, 0xf0, 0xbd, 0x8b, 0x80, 0xf5, 0x0d, 0x8a, 0xb2, 0x2e, 0xeb, 0xf0, 0x69, 0x23,
0xfe, 0x34, 0x97, 0x9e, 0x1c, 0xfe, 0x39, 0x2a, 0x44, 0x46, 0x30, 0xfd, 0x5f, 0x1a, 0x5d, 0xff,
0x04, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x3f, 0x9d, 0x68, 0x87, 0x01, 0x00, 0x00,
// 323 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xbd, 0x4e, 0x32, 0x41,
0x14, 0x86, 0x19, 0xe0, 0x63, 0x3f, 0x47, 0x0b, 0x9d, 0x18, 0x05, 0x12, 0x71, 0xa3, 0x0d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x6e, 0x2b, 0x24, 0xc3, 0xe3, 0xa8, 0xc7, 0xcb, 0x56,
0xbc, 0x6e, 0xc5, 0xef, 0xab, 0x56, 0x92, 0xee, 0x65, 0xf0, 0x46, 0xda, 0xff, 0x49, 0xd4, 0x98,
0xd6, 0x57, 0xb2, 0x47, 0x59, 0x69, 0xca, 0xa6, 0xe8, 0xb4, 0xda, 0xce, 0x71, 0x67, 0x35, 0x6b,
0x7d, 0x4b, 0x22, 0x67, 0x5f, 0x2f, 0x3f, 0xcf, 0xff, 0x2e, 0xd8, 0x79, 0xa9, 0x6e, 0x09, 0xc9,
0xda, 0xc4, 0x85, 0x3a, 0x9e, 0x8d, 0xde, 0x9f, 0x3e, 0x3e, 0x3b, 0xcd, 0x53, 0x42, 0xaf, 0x0d,
0xf0, 0x22, 0x60, 0x1d, 0x3c, 0xee, 0xf8, 0x81, 0x66, 0x79, 0x52, 0x75, 0x9d, 0xe4, 0x0f, 0x4d,
0xc8, 0xa2, 0x53, 0x7c, 0x36, 0xfa, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xef, 0x44, 0x45, 0xb4,
0x01, 0x00, 0x00,
}
func (m *HttpUri) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *HttpUri) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Uri) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintHttpUri(dAtA, i, uint64(len(m.Uri)))
i += copy(dAtA[i:], m.Uri)
}
if m.HttpUpstreamType != nil {
nn1, err := m.HttpUpstreamType.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += nn1
}
if m.Timeout != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintHttpUri(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Timeout)))
n2, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Timeout, dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *HttpUri_Cluster) MarshalTo(dAtA []byte) (int, error) {
i := 0
dAtA[i] = 0x12
i++
i = encodeVarintHttpUri(dAtA, i, uint64(len(m.Cluster)))
i += copy(dAtA[i:], m.Cluster)
return i, nil
}
func encodeVarintHttpUri(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *HttpUri) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Uri)
if l > 0 {
n += 1 + l + sovHttpUri(uint64(l))
}
if m.HttpUpstreamType != nil {
n += m.HttpUpstreamType.Size()
}
if m.Timeout != nil {
l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Timeout)
n += 1 + l + sovHttpUri(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *HttpUri_Cluster) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Cluster)
n += 1 + l + sovHttpUri(uint64(l))
return n
}
func sovHttpUri(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozHttpUri(x uint64) (n int) {
return sovHttpUri(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *HttpUri) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowHttpUri
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: HttpUri: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: HttpUri: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowHttpUri
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthHttpUri
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthHttpUri
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Uri = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowHttpUri
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthHttpUri
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthHttpUri
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.HttpUpstreamType = &HttpUri_Cluster{string(dAtA[iNdEx:postIndex])}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowHttpUri
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthHttpUri
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthHttpUri
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Timeout == nil {
m.Timeout = new(time.Duration)
}
if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.Timeout, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipHttpUri(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthHttpUri
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthHttpUri
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipHttpUri(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowHttpUri
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowHttpUri
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowHttpUri
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthHttpUri
}
iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthHttpUri
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowHttpUri
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipHttpUri(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthHttpUri
}
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthHttpUri = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowHttpUri = fmt.Errorf("proto: integer overflow")
)

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/http_uri.proto
package core
package envoy_api_v2_core
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _http_uri_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on HttpUri with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *HttpUri) Validate() error {
@ -54,6 +57,27 @@ func (m *HttpUri) Validate() error {
}
}
if d := m.GetTimeout(); d != nil {
dur, err := ptypes.Duration(d)
if err != nil {
return HttpUriValidationError{
field: "Timeout",
reason: "value is not a valid duration",
cause: err,
}
}
gte := time.Duration(0*time.Second + 0*time.Nanosecond)
if dur < gte {
return HttpUriValidationError{
field: "Timeout",
reason: "value must be greater than or equal to 0s",
}
}
}
switch m.HttpUpstreamType.(type) {
case *HttpUri_Cluster:

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/protocol.proto
package core
package envoy_api_v2_core
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _protocol_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on TcpProtocolOptions with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
@ -100,6 +103,78 @@ var _ interface {
ErrorName() string
} = TcpProtocolOptionsValidationError{}
// Validate checks the field values on UpstreamHttpProtocolOptions with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *UpstreamHttpProtocolOptions) Validate() error {
if m == nil {
return nil
}
// no validation rules for AutoSni
// no validation rules for AutoSanValidation
return nil
}
// UpstreamHttpProtocolOptionsValidationError is the validation error returned
// by UpstreamHttpProtocolOptions.Validate if the designated constraints
// aren't met.
type UpstreamHttpProtocolOptionsValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e UpstreamHttpProtocolOptionsValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e UpstreamHttpProtocolOptionsValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e UpstreamHttpProtocolOptionsValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e UpstreamHttpProtocolOptionsValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e UpstreamHttpProtocolOptionsValidationError) ErrorName() string {
return "UpstreamHttpProtocolOptionsValidationError"
}
// Error satisfies the builtin error interface
func (e UpstreamHttpProtocolOptionsValidationError) 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 %sUpstreamHttpProtocolOptions.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = UpstreamHttpProtocolOptionsValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = UpstreamHttpProtocolOptionsValidationError{}
// Validate checks the field values on HttpProtocolOptions with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
@ -108,17 +183,43 @@ func (m *HttpProtocolOptions) Validate() error {
return nil
}
{
tmp := m.GetIdleTimeout()
if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HttpProtocolOptionsValidationError{
field: "IdleTimeout",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if v, ok := interface{}(m.GetMaxConnectionDuration()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HttpProtocolOptionsValidationError{
field: "MaxConnectionDuration",
reason: "embedded message failed validation",
cause: err,
}
}
}
if err := v.Validate(); err != nil {
return HttpProtocolOptionsValidationError{
field: "IdleTimeout",
reason: "embedded message failed validation",
cause: err,
}
if wrapper := m.GetMaxHeadersCount(); wrapper != nil {
if wrapper.GetValue() < 1 {
return HttpProtocolOptionsValidationError{
field: "MaxHeadersCount",
reason: "value must be greater than or equal to 1",
}
}
}
if v, ok := interface{}(m.GetMaxStreamDuration()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return HttpProtocolOptionsValidationError{
field: "MaxStreamDuration",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -190,17 +291,12 @@ func (m *Http1ProtocolOptions) Validate() error {
return nil
}
{
tmp := m.GetAllowAbsoluteUrl()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http1ProtocolOptionsValidationError{
field: "AllowAbsoluteUrl",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetAllowAbsoluteUrl()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http1ProtocolOptionsValidationError{
field: "AllowAbsoluteUrl",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -209,6 +305,18 @@ func (m *Http1ProtocolOptions) Validate() error {
// no validation rules for DefaultHostForHttp_10
if v, ok := interface{}(m.GetHeaderKeyFormat()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http1ProtocolOptionsValidationError{
field: "HeaderKeyFormat",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for EnableTrailers
return nil
}
@ -276,17 +384,12 @@ func (m *Http2ProtocolOptions) Validate() error {
return nil
}
{
tmp := m.GetHpackTableSize()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http2ProtocolOptionsValidationError{
field: "HpackTableSize",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetHpackTableSize()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http2ProtocolOptionsValidationError{
field: "HpackTableSize",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -328,6 +431,76 @@ func (m *Http2ProtocolOptions) Validate() error {
// no validation rules for AllowMetadata
if wrapper := m.GetMaxOutboundFrames(); wrapper != nil {
if wrapper.GetValue() < 1 {
return Http2ProtocolOptionsValidationError{
field: "MaxOutboundFrames",
reason: "value must be greater than or equal to 1",
}
}
}
if wrapper := m.GetMaxOutboundControlFrames(); wrapper != nil {
if wrapper.GetValue() < 1 {
return Http2ProtocolOptionsValidationError{
field: "MaxOutboundControlFrames",
reason: "value must be greater than or equal to 1",
}
}
}
if v, ok := interface{}(m.GetMaxConsecutiveInboundFramesWithEmptyPayload()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http2ProtocolOptionsValidationError{
field: "MaxConsecutiveInboundFramesWithEmptyPayload",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetMaxInboundPriorityFramesPerStream()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http2ProtocolOptionsValidationError{
field: "MaxInboundPriorityFramesPerStream",
reason: "embedded message failed validation",
cause: err,
}
}
}
if wrapper := m.GetMaxInboundWindowUpdateFramesPerDataFrameSent(); wrapper != nil {
if wrapper.GetValue() < 1 {
return Http2ProtocolOptionsValidationError{
field: "MaxInboundWindowUpdateFramesPerDataFrameSent",
reason: "value must be greater than or equal to 1",
}
}
}
// no validation rules for StreamErrorOnInvalidHttpMessaging
for idx, item := range m.GetCustomSettingsParameters() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http2ProtocolOptionsValidationError{
field: fmt.Sprintf("CustomSettingsParameters[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
@ -395,17 +568,12 @@ func (m *GrpcProtocolOptions) Validate() error {
return nil
}
{
tmp := m.GetHttp2ProtocolOptions()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcProtocolOptionsValidationError{
field: "Http2ProtocolOptions",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetHttp2ProtocolOptions()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return GrpcProtocolOptionsValidationError{
field: "Http2ProtocolOptions",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -468,3 +636,270 @@ var _ interface {
Cause() error
ErrorName() string
} = GrpcProtocolOptionsValidationError{}
// Validate checks the field values on Http1ProtocolOptions_HeaderKeyFormat
// with the rules defined in the proto definition for this message. If any
// rules are violated, an error is returned.
func (m *Http1ProtocolOptions_HeaderKeyFormat) Validate() error {
if m == nil {
return nil
}
switch m.HeaderFormat.(type) {
case *Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_:
if v, ok := interface{}(m.GetProperCaseWords()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http1ProtocolOptions_HeaderKeyFormatValidationError{
field: "ProperCaseWords",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
return Http1ProtocolOptions_HeaderKeyFormatValidationError{
field: "HeaderFormat",
reason: "value is required",
}
}
return nil
}
// Http1ProtocolOptions_HeaderKeyFormatValidationError is the validation error
// returned by Http1ProtocolOptions_HeaderKeyFormat.Validate if the designated
// constraints aren't met.
type Http1ProtocolOptions_HeaderKeyFormatValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) ErrorName() string {
return "Http1ProtocolOptions_HeaderKeyFormatValidationError"
}
// Error satisfies the builtin error interface
func (e Http1ProtocolOptions_HeaderKeyFormatValidationError) 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 %sHttp1ProtocolOptions_HeaderKeyFormat.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Http1ProtocolOptions_HeaderKeyFormatValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Http1ProtocolOptions_HeaderKeyFormatValidationError{}
// Validate checks the field values on
// Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords) Validate() error {
if m == nil {
return nil
}
return nil
}
// Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError is the
// validation error returned by
// Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords.Validate if the
// designated constraints aren't met.
type Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Field() string {
return e.field
}
// Reason function returns reason value.
func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Reason() string {
return e.reason
}
// Cause function returns cause value.
func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Cause() error {
return e.cause
}
// Key function returns key value.
func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) ErrorName() string {
return "Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError"
}
// Error satisfies the builtin error interface
func (e Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError) 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 %sHttp1ProtocolOptions_HeaderKeyFormat_ProperCaseWords.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWordsValidationError{}
// Validate checks the field values on Http2ProtocolOptions_SettingsParameter
// with the rules defined in the proto definition for this message. If any
// rules are violated, an error is returned.
func (m *Http2ProtocolOptions_SettingsParameter) Validate() error {
if m == nil {
return nil
}
if wrapper := m.GetIdentifier(); wrapper != nil {
if val := wrapper.GetValue(); val < 1 || val > 65536 {
return Http2ProtocolOptions_SettingsParameterValidationError{
field: "Identifier",
reason: "value must be inside range [1, 65536]",
}
}
} else {
return Http2ProtocolOptions_SettingsParameterValidationError{
field: "Identifier",
reason: "value is required and must not be nil.",
}
}
if m.GetValue() == nil {
return Http2ProtocolOptions_SettingsParameterValidationError{
field: "Value",
reason: "value is required",
}
}
if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Http2ProtocolOptions_SettingsParameterValidationError{
field: "Value",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// Http2ProtocolOptions_SettingsParameterValidationError is the validation
// error returned by Http2ProtocolOptions_SettingsParameter.Validate if the
// designated constraints aren't met.
type Http2ProtocolOptions_SettingsParameterValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e Http2ProtocolOptions_SettingsParameterValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e Http2ProtocolOptions_SettingsParameterValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e Http2ProtocolOptions_SettingsParameterValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e Http2ProtocolOptions_SettingsParameterValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e Http2ProtocolOptions_SettingsParameterValidationError) ErrorName() string {
return "Http2ProtocolOptions_SettingsParameterValidationError"
}
// Error satisfies the builtin error interface
func (e Http2ProtocolOptions_SettingsParameterValidationError) 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 %sHttp2ProtocolOptions_SettingsParameter.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Http2ProtocolOptions_SettingsParameterValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Http2ProtocolOptions_SettingsParameterValidationError{}

View File

@ -0,0 +1,201 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/core/socket_option.proto
package envoy_api_v2_core
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type SocketOption_SocketState int32
const (
SocketOption_STATE_PREBIND SocketOption_SocketState = 0
SocketOption_STATE_BOUND SocketOption_SocketState = 1
SocketOption_STATE_LISTENING SocketOption_SocketState = 2
)
var SocketOption_SocketState_name = map[int32]string{
0: "STATE_PREBIND",
1: "STATE_BOUND",
2: "STATE_LISTENING",
}
var SocketOption_SocketState_value = map[string]int32{
"STATE_PREBIND": 0,
"STATE_BOUND": 1,
"STATE_LISTENING": 2,
}
func (x SocketOption_SocketState) String() string {
return proto.EnumName(SocketOption_SocketState_name, int32(x))
}
func (SocketOption_SocketState) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_188daec7f82db149, []int{0, 0}
}
type SocketOption struct {
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
Level int64 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
Name int64 `protobuf:"varint,3,opt,name=name,proto3" json:"name,omitempty"`
// Types that are valid to be assigned to Value:
// *SocketOption_IntValue
// *SocketOption_BufValue
Value isSocketOption_Value `protobuf_oneof:"value"`
State SocketOption_SocketState `protobuf:"varint,6,opt,name=state,proto3,enum=envoy.api.v2.core.SocketOption_SocketState" json:"state,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SocketOption) Reset() { *m = SocketOption{} }
func (m *SocketOption) String() string { return proto.CompactTextString(m) }
func (*SocketOption) ProtoMessage() {}
func (*SocketOption) Descriptor() ([]byte, []int) {
return fileDescriptor_188daec7f82db149, []int{0}
}
func (m *SocketOption) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SocketOption.Unmarshal(m, b)
}
func (m *SocketOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SocketOption.Marshal(b, m, deterministic)
}
func (m *SocketOption) XXX_Merge(src proto.Message) {
xxx_messageInfo_SocketOption.Merge(m, src)
}
func (m *SocketOption) XXX_Size() int {
return xxx_messageInfo_SocketOption.Size(m)
}
func (m *SocketOption) XXX_DiscardUnknown() {
xxx_messageInfo_SocketOption.DiscardUnknown(m)
}
var xxx_messageInfo_SocketOption proto.InternalMessageInfo
func (m *SocketOption) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *SocketOption) GetLevel() int64 {
if m != nil {
return m.Level
}
return 0
}
func (m *SocketOption) GetName() int64 {
if m != nil {
return m.Name
}
return 0
}
type isSocketOption_Value interface {
isSocketOption_Value()
}
type SocketOption_IntValue struct {
IntValue int64 `protobuf:"varint,4,opt,name=int_value,json=intValue,proto3,oneof"`
}
type SocketOption_BufValue struct {
BufValue []byte `protobuf:"bytes,5,opt,name=buf_value,json=bufValue,proto3,oneof"`
}
func (*SocketOption_IntValue) isSocketOption_Value() {}
func (*SocketOption_BufValue) isSocketOption_Value() {}
func (m *SocketOption) GetValue() isSocketOption_Value {
if m != nil {
return m.Value
}
return nil
}
func (m *SocketOption) GetIntValue() int64 {
if x, ok := m.GetValue().(*SocketOption_IntValue); ok {
return x.IntValue
}
return 0
}
func (m *SocketOption) GetBufValue() []byte {
if x, ok := m.GetValue().(*SocketOption_BufValue); ok {
return x.BufValue
}
return nil
}
func (m *SocketOption) GetState() SocketOption_SocketState {
if m != nil {
return m.State
}
return SocketOption_STATE_PREBIND
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*SocketOption) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*SocketOption_IntValue)(nil),
(*SocketOption_BufValue)(nil),
}
}
func init() {
proto.RegisterEnum("envoy.api.v2.core.SocketOption_SocketState", SocketOption_SocketState_name, SocketOption_SocketState_value)
proto.RegisterType((*SocketOption)(nil), "envoy.api.v2.core.SocketOption")
}
func init() {
proto.RegisterFile("envoy/api/v2/core/socket_option.proto", fileDescriptor_188daec7f82db149)
}
var fileDescriptor_188daec7f82db149 = []byte{
// 392 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xd1, 0xca, 0xd3, 0x30,
0x14, 0xc7, 0xbf, 0x74, 0x5f, 0xc7, 0xb7, 0x6c, 0xba, 0x2e, 0x0e, 0x2d, 0x83, 0x69, 0x19, 0x08,
0x05, 0xa1, 0x85, 0xed, 0x09, 0x0c, 0x9b, 0x3a, 0x94, 0x6e, 0xb4, 0xd3, 0x0b, 0x6f, 0x46, 0xd6,
0x65, 0x23, 0xd8, 0x25, 0xa5, 0x4d, 0x8b, 0xbb, 0x13, 0x5f, 0xc0, 0x5b, 0x9f, 0x45, 0x5f, 0xc0,
0x5b, 0x5f, 0xc5, 0x2b, 0xf1, 0x42, 0x24, 0xc9, 0x84, 0xc2, 0xee, 0x72, 0xfe, 0xbf, 0x73, 0xca,
0xef, 0xf4, 0xc0, 0xa7, 0x94, 0xd7, 0xe2, 0x1c, 0x92, 0x9c, 0x85, 0xf5, 0x34, 0x4c, 0x45, 0x41,
0xc3, 0x52, 0xa4, 0x1f, 0xa8, 0xdc, 0x8a, 0x5c, 0x32, 0xc1, 0x83, 0xbc, 0x10, 0x52, 0xa0, 0x81,
0x6e, 0x0b, 0x48, 0xce, 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xbc, 0x7a, 0x1b, 0xcd,
0x1d, 0x80, 0x1e, 0xc0, 0xbe, 0x09, 0xde, 0x2c, 0x93, 0xcd, 0x22, 0x5a, 0x46, 0x2f, 0x1d, 0x0b,
0xf7, 0xa0, 0xad, 0x7d, 0x51, 0xeb, 0x37, 0x06, 0xf8, 0xfd, 0xaf, 0xaf, 0x7f, 0xbf, 0xd8, 0x0f,
0xd1, 0xd0, 0xa8, 0xa5, 0x82, 0x1f, 0xd8, 0xd1, 0xa8, 0xd5, 0xb3, 0x6f, 0x9f, 0x7e, 0xfc, 0x6c,
0x5b, 0x0e, 0x80, 0x4f, 0x98, 0x30, 0xee, 0x79, 0x21, 0x3e, 0x9e, 0xaf, 0xd7, 0xc0, 0x83, 0xe6,
0x1e, 0x6b, 0x75, 0x97, 0x35, 0xd8, 0xb5, 0xf5, 0x81, 0x66, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff,
0x90, 0xf7, 0x3c, 0x3d, 0x34, 0x02, 0x00, 0x00,
}

View File

@ -0,0 +1,131 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/core/socket_option.proto
package envoy_api_v2_core
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _socket_option_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on SocketOption with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *SocketOption) Validate() error {
if m == nil {
return nil
}
// no validation rules for Description
// no validation rules for Level
// no validation rules for Name
if _, ok := SocketOption_SocketState_name[int32(m.GetState())]; !ok {
return SocketOptionValidationError{
field: "State",
reason: "value must be one of the defined enum values",
}
}
switch m.Value.(type) {
case *SocketOption_IntValue:
// no validation rules for IntValue
case *SocketOption_BufValue:
// no validation rules for BufValue
default:
return SocketOptionValidationError{
field: "Value",
reason: "value is required",
}
}
return nil
}
// SocketOptionValidationError is the validation error returned by
// SocketOption.Validate if the designated constraints aren't met.
type SocketOptionValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SocketOptionValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SocketOptionValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SocketOptionValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SocketOptionValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SocketOptionValidationError) ErrorName() string { return "SocketOptionValidationError" }
// Error satisfies the builtin error interface
func (e SocketOptionValidationError) 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 %sSocketOption.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SocketOptionValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SocketOptionValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/discovery.proto
package v2
package envoy_api_v2
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _discovery_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on DiscoveryRequest with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
@ -43,17 +46,12 @@ func (m *DiscoveryRequest) Validate() error {
// no validation rules for VersionInfo
{
tmp := m.GetNode()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryRequestValidationError{
field: "Node",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryRequestValidationError{
field: "Node",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -62,17 +60,12 @@ func (m *DiscoveryRequest) Validate() error {
// no validation rules for ResponseNonce
{
tmp := m.GetErrorDetail()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryRequestValidationError{
field: "ErrorDetail",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetErrorDetail()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryRequestValidationError{
field: "ErrorDetail",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -147,17 +140,12 @@ func (m *DiscoveryResponse) Validate() error {
for idx, item := range m.GetResources() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryResponseValidationError{
field: fmt.Sprintf("Resources[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryResponseValidationError{
field: fmt.Sprintf("Resources[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -170,17 +158,12 @@ func (m *DiscoveryResponse) Validate() error {
// no validation rules for Nonce
{
tmp := m.GetControlPlane()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryResponseValidationError{
field: "ControlPlane",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetControlPlane()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DiscoveryResponseValidationError{
field: "ControlPlane",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -252,17 +235,12 @@ func (m *DeltaDiscoveryRequest) Validate() error {
return nil
}
{
tmp := m.GetNode()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DeltaDiscoveryRequestValidationError{
field: "Node",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DeltaDiscoveryRequestValidationError{
field: "Node",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -273,17 +251,12 @@ func (m *DeltaDiscoveryRequest) Validate() error {
// no validation rules for ResponseNonce
{
tmp := m.GetErrorDetail()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DeltaDiscoveryRequestValidationError{
field: "ErrorDetail",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetErrorDetail()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DeltaDiscoveryRequestValidationError{
field: "ErrorDetail",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -360,23 +333,20 @@ func (m *DeltaDiscoveryResponse) Validate() error {
for idx, item := range m.GetResources() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DeltaDiscoveryResponseValidationError{
field: fmt.Sprintf("Resources[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DeltaDiscoveryResponseValidationError{
field: fmt.Sprintf("Resources[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
// no validation rules for TypeUrl
// no validation rules for Nonce
return nil
@ -449,17 +419,12 @@ func (m *Resource) Validate() error {
// no validation rules for Version
{
tmp := m.GetResource()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ResourceValidationError{
field: "Resource",
reason: "embedded message failed validation",
cause: err,
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/eds.proto
package v2
package envoy_api_v2
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,277 +30,25 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// Validate checks the field values on ClusterLoadAssignment with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ClusterLoadAssignment) Validate() error {
if m == nil {
return nil
}
// define the regex for a UUID once up-front
var _eds_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
if len(m.GetClusterName()) < 1 {
return ClusterLoadAssignmentValidationError{
field: "ClusterName",
reason: "value length must be at least 1 bytes",
}
}
for idx, item := range m.GetEndpoints() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignmentValidationError{
field: fmt.Sprintf("Endpoints[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
// no validation rules for NamedEndpoints
{
tmp := m.GetPolicy()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignmentValidationError{
field: "Policy",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// ClusterLoadAssignmentValidationError is the validation error returned by
// ClusterLoadAssignment.Validate if the designated constraints aren't met.
type ClusterLoadAssignmentValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ClusterLoadAssignmentValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ClusterLoadAssignmentValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ClusterLoadAssignmentValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ClusterLoadAssignmentValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ClusterLoadAssignmentValidationError) ErrorName() string {
return "ClusterLoadAssignmentValidationError"
}
// Error satisfies the builtin error interface
func (e ClusterLoadAssignmentValidationError) 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 %sClusterLoadAssignment.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ClusterLoadAssignmentValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ClusterLoadAssignmentValidationError{}
// Validate checks the field values on ClusterLoadAssignment_Policy with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ClusterLoadAssignment_Policy) Validate() error {
if m == nil {
return nil
}
for idx, item := range m.GetDropOverloads() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignment_PolicyValidationError{
field: fmt.Sprintf("DropOverloads[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
if wrapper := m.GetOverprovisioningFactor(); wrapper != nil {
if wrapper.GetValue() <= 0 {
return ClusterLoadAssignment_PolicyValidationError{
field: "OverprovisioningFactor",
reason: "value must be greater than 0",
}
}
}
if d := m.GetEndpointStaleAfter(); d != nil {
dur, err := types.DurationFromProto(d)
if err != nil {
return ClusterLoadAssignment_PolicyValidationError{
field: "EndpointStaleAfter",
reason: "value is not a valid duration",
cause: err,
}
}
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
if dur <= gt {
return ClusterLoadAssignment_PolicyValidationError{
field: "EndpointStaleAfter",
reason: "value must be greater than 0s",
}
}
}
return nil
}
// ClusterLoadAssignment_PolicyValidationError is the validation error returned
// by ClusterLoadAssignment_Policy.Validate if the designated constraints
// aren't met.
type ClusterLoadAssignment_PolicyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ClusterLoadAssignment_PolicyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ClusterLoadAssignment_PolicyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ClusterLoadAssignment_PolicyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ClusterLoadAssignment_PolicyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ClusterLoadAssignment_PolicyValidationError) ErrorName() string {
return "ClusterLoadAssignment_PolicyValidationError"
}
// Error satisfies the builtin error interface
func (e ClusterLoadAssignment_PolicyValidationError) 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 %sClusterLoadAssignment_Policy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ClusterLoadAssignment_PolicyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ClusterLoadAssignment_PolicyValidationError{}
// Validate checks the field values on
// ClusterLoadAssignment_Policy_DropOverload with the rules defined in the
// Validate checks the field values on EdsDummy with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *ClusterLoadAssignment_Policy_DropOverload) Validate() error {
func (m *EdsDummy) Validate() error {
if m == nil {
return nil
}
if len(m.GetCategory()) < 1 {
return ClusterLoadAssignment_Policy_DropOverloadValidationError{
field: "Category",
reason: "value length must be at least 1 bytes",
}
}
{
tmp := m.GetDropPercentage()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignment_Policy_DropOverloadValidationError{
field: "DropPercentage",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// ClusterLoadAssignment_Policy_DropOverloadValidationError is the validation
// error returned by ClusterLoadAssignment_Policy_DropOverload.Validate if the
// designated constraints aren't met.
type ClusterLoadAssignment_Policy_DropOverloadValidationError struct {
// EdsDummyValidationError is the validation error returned by
// EdsDummy.Validate if the designated constraints aren't met.
type EdsDummyValidationError struct {
field string
reason string
cause error
@ -308,24 +56,22 @@ type ClusterLoadAssignment_Policy_DropOverloadValidationError struct {
}
// Field function returns field value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Field() string { return e.field }
func (e EdsDummyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Reason() string { return e.reason }
func (e EdsDummyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Cause() error { return e.cause }
func (e EdsDummyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Key() bool { return e.key }
func (e EdsDummyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) ErrorName() string {
return "ClusterLoadAssignment_Policy_DropOverloadValidationError"
}
func (e EdsDummyValidationError) ErrorName() string { return "EdsDummyValidationError" }
// Error satisfies the builtin error interface
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Error() string {
func (e EdsDummyValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@ -337,14 +83,14 @@ func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Error() string
}
return fmt.Sprintf(
"invalid %sClusterLoadAssignment_Policy_DropOverload.%s: %s%s",
"invalid %sEdsDummy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ClusterLoadAssignment_Policy_DropOverloadValidationError{}
var _ error = EdsDummyValidationError{}
var _ interface {
Field() string
@ -352,4 +98,4 @@ var _ interface {
Key() bool
Cause() error
ErrorName() string
} = ClusterLoadAssignment_Policy_DropOverloadValidationError{}
} = EdsDummyValidationError{}

View File

@ -0,0 +1,258 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/endpoint.proto
package envoy_api_v2
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
endpoint "github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint"
_type "github.com/envoyproxy/go-control-plane/envoy/type"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
duration "github.com/golang/protobuf/ptypes/duration"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
_ "google.golang.org/genproto/googleapis/api/annotations"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type ClusterLoadAssignment struct {
ClusterName string `protobuf:"bytes,1,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"`
Endpoints []*endpoint.LocalityLbEndpoints `protobuf:"bytes,2,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
NamedEndpoints map[string]*endpoint.Endpoint `protobuf:"bytes,5,rep,name=named_endpoints,json=namedEndpoints,proto3" json:"named_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Policy *ClusterLoadAssignment_Policy `protobuf:"bytes,4,opt,name=policy,proto3" json:"policy,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ClusterLoadAssignment) Reset() { *m = ClusterLoadAssignment{} }
func (m *ClusterLoadAssignment) String() string { return proto.CompactTextString(m) }
func (*ClusterLoadAssignment) ProtoMessage() {}
func (*ClusterLoadAssignment) Descriptor() ([]byte, []int) {
return fileDescriptor_8dd3a9d301e6758b, []int{0}
}
func (m *ClusterLoadAssignment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ClusterLoadAssignment.Unmarshal(m, b)
}
func (m *ClusterLoadAssignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ClusterLoadAssignment.Marshal(b, m, deterministic)
}
func (m *ClusterLoadAssignment) XXX_Merge(src proto.Message) {
xxx_messageInfo_ClusterLoadAssignment.Merge(m, src)
}
func (m *ClusterLoadAssignment) XXX_Size() int {
return xxx_messageInfo_ClusterLoadAssignment.Size(m)
}
func (m *ClusterLoadAssignment) XXX_DiscardUnknown() {
xxx_messageInfo_ClusterLoadAssignment.DiscardUnknown(m)
}
var xxx_messageInfo_ClusterLoadAssignment proto.InternalMessageInfo
func (m *ClusterLoadAssignment) GetClusterName() string {
if m != nil {
return m.ClusterName
}
return ""
}
func (m *ClusterLoadAssignment) GetEndpoints() []*endpoint.LocalityLbEndpoints {
if m != nil {
return m.Endpoints
}
return nil
}
func (m *ClusterLoadAssignment) GetNamedEndpoints() map[string]*endpoint.Endpoint {
if m != nil {
return m.NamedEndpoints
}
return nil
}
func (m *ClusterLoadAssignment) GetPolicy() *ClusterLoadAssignment_Policy {
if m != nil {
return m.Policy
}
return nil
}
type ClusterLoadAssignment_Policy struct {
DropOverloads []*ClusterLoadAssignment_Policy_DropOverload `protobuf:"bytes,2,rep,name=drop_overloads,json=dropOverloads,proto3" json:"drop_overloads,omitempty"`
OverprovisioningFactor *wrappers.UInt32Value `protobuf:"bytes,3,opt,name=overprovisioning_factor,json=overprovisioningFactor,proto3" json:"overprovisioning_factor,omitempty"`
EndpointStaleAfter *duration.Duration `protobuf:"bytes,4,opt,name=endpoint_stale_after,json=endpointStaleAfter,proto3" json:"endpoint_stale_after,omitempty"`
DisableOverprovisioning bool `protobuf:"varint,5,opt,name=disable_overprovisioning,json=disableOverprovisioning,proto3" json:"disable_overprovisioning,omitempty"` // Deprecated: Do not use.
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ClusterLoadAssignment_Policy) Reset() { *m = ClusterLoadAssignment_Policy{} }
func (m *ClusterLoadAssignment_Policy) String() string { return proto.CompactTextString(m) }
func (*ClusterLoadAssignment_Policy) ProtoMessage() {}
func (*ClusterLoadAssignment_Policy) Descriptor() ([]byte, []int) {
return fileDescriptor_8dd3a9d301e6758b, []int{0, 0}
}
func (m *ClusterLoadAssignment_Policy) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ClusterLoadAssignment_Policy.Unmarshal(m, b)
}
func (m *ClusterLoadAssignment_Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ClusterLoadAssignment_Policy.Marshal(b, m, deterministic)
}
func (m *ClusterLoadAssignment_Policy) XXX_Merge(src proto.Message) {
xxx_messageInfo_ClusterLoadAssignment_Policy.Merge(m, src)
}
func (m *ClusterLoadAssignment_Policy) XXX_Size() int {
return xxx_messageInfo_ClusterLoadAssignment_Policy.Size(m)
}
func (m *ClusterLoadAssignment_Policy) XXX_DiscardUnknown() {
xxx_messageInfo_ClusterLoadAssignment_Policy.DiscardUnknown(m)
}
var xxx_messageInfo_ClusterLoadAssignment_Policy proto.InternalMessageInfo
func (m *ClusterLoadAssignment_Policy) GetDropOverloads() []*ClusterLoadAssignment_Policy_DropOverload {
if m != nil {
return m.DropOverloads
}
return nil
}
func (m *ClusterLoadAssignment_Policy) GetOverprovisioningFactor() *wrappers.UInt32Value {
if m != nil {
return m.OverprovisioningFactor
}
return nil
}
func (m *ClusterLoadAssignment_Policy) GetEndpointStaleAfter() *duration.Duration {
if m != nil {
return m.EndpointStaleAfter
}
return nil
}
// Deprecated: Do not use.
func (m *ClusterLoadAssignment_Policy) GetDisableOverprovisioning() bool {
if m != nil {
return m.DisableOverprovisioning
}
return false
}
type ClusterLoadAssignment_Policy_DropOverload struct {
Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"`
DropPercentage *_type.FractionalPercent `protobuf:"bytes,2,opt,name=drop_percentage,json=dropPercentage,proto3" json:"drop_percentage,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ClusterLoadAssignment_Policy_DropOverload) Reset() {
*m = ClusterLoadAssignment_Policy_DropOverload{}
}
func (m *ClusterLoadAssignment_Policy_DropOverload) String() string { return proto.CompactTextString(m) }
func (*ClusterLoadAssignment_Policy_DropOverload) ProtoMessage() {}
func (*ClusterLoadAssignment_Policy_DropOverload) Descriptor() ([]byte, []int) {
return fileDescriptor_8dd3a9d301e6758b, []int{0, 0, 0}
}
func (m *ClusterLoadAssignment_Policy_DropOverload) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ClusterLoadAssignment_Policy_DropOverload.Unmarshal(m, b)
}
func (m *ClusterLoadAssignment_Policy_DropOverload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ClusterLoadAssignment_Policy_DropOverload.Marshal(b, m, deterministic)
}
func (m *ClusterLoadAssignment_Policy_DropOverload) XXX_Merge(src proto.Message) {
xxx_messageInfo_ClusterLoadAssignment_Policy_DropOverload.Merge(m, src)
}
func (m *ClusterLoadAssignment_Policy_DropOverload) XXX_Size() int {
return xxx_messageInfo_ClusterLoadAssignment_Policy_DropOverload.Size(m)
}
func (m *ClusterLoadAssignment_Policy_DropOverload) XXX_DiscardUnknown() {
xxx_messageInfo_ClusterLoadAssignment_Policy_DropOverload.DiscardUnknown(m)
}
var xxx_messageInfo_ClusterLoadAssignment_Policy_DropOverload proto.InternalMessageInfo
func (m *ClusterLoadAssignment_Policy_DropOverload) GetCategory() string {
if m != nil {
return m.Category
}
return ""
}
func (m *ClusterLoadAssignment_Policy_DropOverload) GetDropPercentage() *_type.FractionalPercent {
if m != nil {
return m.DropPercentage
}
return nil
}
func init() {
proto.RegisterType((*ClusterLoadAssignment)(nil), "envoy.api.v2.ClusterLoadAssignment")
proto.RegisterMapType((map[string]*endpoint.Endpoint)(nil), "envoy.api.v2.ClusterLoadAssignment.NamedEndpointsEntry")
proto.RegisterType((*ClusterLoadAssignment_Policy)(nil), "envoy.api.v2.ClusterLoadAssignment.Policy")
proto.RegisterType((*ClusterLoadAssignment_Policy_DropOverload)(nil), "envoy.api.v2.ClusterLoadAssignment.Policy.DropOverload")
}
func init() { proto.RegisterFile("envoy/api/v2/endpoint.proto", fileDescriptor_8dd3a9d301e6758b) }
var fileDescriptor_8dd3a9d301e6758b = []byte{
// 645 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4d, 0x6e, 0xd3, 0x40,
0x14, 0xc7, 0x6b, 0xa7, 0x09, 0xe9, 0xf4, 0x53, 0xc3, 0x47, 0x8d, 0x69, 0x21, 0x82, 0x4d, 0x95,
0x85, 0x2d, 0xa5, 0x42, 0x45, 0x48, 0x2c, 0x6a, 0xda, 0x0a, 0x50, 0x45, 0x23, 0xa3, 0xb2, 0xac,
0x99, 0xd8, 0x13, 0x6b, 0x84, 0x33, 0x33, 0x1a, 0x8f, 0x0d, 0x16, 0x1b, 0x6e, 0xc0, 0x96, 0x33,
0x70, 0x04, 0x4e, 0xc0, 0x96, 0x23, 0x70, 0x05, 0x96, 0x45,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0xd0, 0x18, 0x75, 0xd4, 0xb4, 0x76, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xef, 0xcb, 0xbf,
0xb6, 0x09, 0x05, 0x00, 0x00,
}

View File

@ -0,0 +1,355 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/endpoint.proto
package envoy_api_v2
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _endpoint_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on ClusterLoadAssignment with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ClusterLoadAssignment) Validate() error {
if m == nil {
return nil
}
if len(m.GetClusterName()) < 1 {
return ClusterLoadAssignmentValidationError{
field: "ClusterName",
reason: "value length must be at least 1 bytes",
}
}
for idx, item := range m.GetEndpoints() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignmentValidationError{
field: fmt.Sprintf("Endpoints[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
for key, val := range m.GetNamedEndpoints() {
_ = val
// no validation rules for NamedEndpoints[key]
if v, ok := interface{}(val).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignmentValidationError{
field: fmt.Sprintf("NamedEndpoints[%v]", key),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if v, ok := interface{}(m.GetPolicy()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignmentValidationError{
field: "Policy",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// ClusterLoadAssignmentValidationError is the validation error returned by
// ClusterLoadAssignment.Validate if the designated constraints aren't met.
type ClusterLoadAssignmentValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ClusterLoadAssignmentValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ClusterLoadAssignmentValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ClusterLoadAssignmentValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ClusterLoadAssignmentValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ClusterLoadAssignmentValidationError) ErrorName() string {
return "ClusterLoadAssignmentValidationError"
}
// Error satisfies the builtin error interface
func (e ClusterLoadAssignmentValidationError) 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 %sClusterLoadAssignment.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ClusterLoadAssignmentValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ClusterLoadAssignmentValidationError{}
// Validate checks the field values on ClusterLoadAssignment_Policy with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ClusterLoadAssignment_Policy) Validate() error {
if m == nil {
return nil
}
for idx, item := range m.GetDropOverloads() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignment_PolicyValidationError{
field: fmt.Sprintf("DropOverloads[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if wrapper := m.GetOverprovisioningFactor(); wrapper != nil {
if wrapper.GetValue() <= 0 {
return ClusterLoadAssignment_PolicyValidationError{
field: "OverprovisioningFactor",
reason: "value must be greater than 0",
}
}
}
if d := m.GetEndpointStaleAfter(); d != nil {
dur, err := ptypes.Duration(d)
if err != nil {
return ClusterLoadAssignment_PolicyValidationError{
field: "EndpointStaleAfter",
reason: "value is not a valid duration",
cause: err,
}
}
gt := time.Duration(0*time.Second + 0*time.Nanosecond)
if dur <= gt {
return ClusterLoadAssignment_PolicyValidationError{
field: "EndpointStaleAfter",
reason: "value must be greater than 0s",
}
}
}
// no validation rules for DisableOverprovisioning
return nil
}
// ClusterLoadAssignment_PolicyValidationError is the validation error returned
// by ClusterLoadAssignment_Policy.Validate if the designated constraints
// aren't met.
type ClusterLoadAssignment_PolicyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ClusterLoadAssignment_PolicyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ClusterLoadAssignment_PolicyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ClusterLoadAssignment_PolicyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ClusterLoadAssignment_PolicyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ClusterLoadAssignment_PolicyValidationError) ErrorName() string {
return "ClusterLoadAssignment_PolicyValidationError"
}
// Error satisfies the builtin error interface
func (e ClusterLoadAssignment_PolicyValidationError) 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 %sClusterLoadAssignment_Policy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ClusterLoadAssignment_PolicyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ClusterLoadAssignment_PolicyValidationError{}
// Validate checks the field values on
// ClusterLoadAssignment_Policy_DropOverload with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *ClusterLoadAssignment_Policy_DropOverload) Validate() error {
if m == nil {
return nil
}
if len(m.GetCategory()) < 1 {
return ClusterLoadAssignment_Policy_DropOverloadValidationError{
field: "Category",
reason: "value length must be at least 1 bytes",
}
}
if v, ok := interface{}(m.GetDropPercentage()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterLoadAssignment_Policy_DropOverloadValidationError{
field: "DropPercentage",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// ClusterLoadAssignment_Policy_DropOverloadValidationError is the validation
// error returned by ClusterLoadAssignment_Policy_DropOverload.Validate if the
// designated constraints aren't met.
type ClusterLoadAssignment_Policy_DropOverloadValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) ErrorName() string {
return "ClusterLoadAssignment_Policy_DropOverloadValidationError"
}
// Error satisfies the builtin error interface
func (e ClusterLoadAssignment_Policy_DropOverloadValidationError) 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 %sClusterLoadAssignment_Policy_DropOverload.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ClusterLoadAssignment_Policy_DropOverloadValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ClusterLoadAssignment_Policy_DropOverloadValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/endpoint/endpoint.proto
package endpoint
package envoy_api_v2_endpoint
import (
"bytes"
@ -15,9 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -32,411 +30,8 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = core.HealthStatus(0)
_ = ptypes.DynamicAny{}
)
// Validate checks the field values on Endpoint with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Endpoint) Validate() error {
if m == nil {
return nil
}
{
tmp := m.GetAddress()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return EndpointValidationError{
field: "Address",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
{
tmp := m.GetHealthCheckConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return EndpointValidationError{
field: "HealthCheckConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// EndpointValidationError is the validation error returned by
// Endpoint.Validate if the designated constraints aren't met.
type EndpointValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e EndpointValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e EndpointValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e EndpointValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e EndpointValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e EndpointValidationError) ErrorName() string { return "EndpointValidationError" }
// Error satisfies the builtin error interface
func (e EndpointValidationError) 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 %sEndpoint.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = EndpointValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = EndpointValidationError{}
// Validate checks the field values on LbEndpoint with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *LbEndpoint) Validate() error {
if m == nil {
return nil
}
// no validation rules for HealthStatus
{
tmp := m.GetMetadata()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LbEndpointValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if wrapper := m.GetLoadBalancingWeight(); wrapper != nil {
if val := wrapper.GetValue(); val < 1 || val > 128 {
return LbEndpointValidationError{
field: "LoadBalancingWeight",
reason: "value must be inside range [1, 128]",
}
}
}
switch m.HostIdentifier.(type) {
case *LbEndpoint_Endpoint:
{
tmp := m.GetEndpoint()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LbEndpointValidationError{
field: "Endpoint",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
case *LbEndpoint_EndpointName:
// no validation rules for EndpointName
}
return nil
}
// LbEndpointValidationError is the validation error returned by
// LbEndpoint.Validate if the designated constraints aren't met.
type LbEndpointValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LbEndpointValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LbEndpointValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LbEndpointValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LbEndpointValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LbEndpointValidationError) ErrorName() string { return "LbEndpointValidationError" }
// Error satisfies the builtin error interface
func (e LbEndpointValidationError) 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 %sLbEndpoint.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LbEndpointValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LbEndpointValidationError{}
// Validate checks the field values on LocalityLbEndpoints with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *LocalityLbEndpoints) Validate() error {
if m == nil {
return nil
}
{
tmp := m.GetLocality()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LocalityLbEndpointsValidationError{
field: "Locality",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
for idx, item := range m.GetLbEndpoints() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LocalityLbEndpointsValidationError{
field: fmt.Sprintf("LbEndpoints[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
if wrapper := m.GetLoadBalancingWeight(); wrapper != nil {
if val := wrapper.GetValue(); val < 1 || val > 128 {
return LocalityLbEndpointsValidationError{
field: "LoadBalancingWeight",
reason: "value must be inside range [1, 128]",
}
}
}
if m.GetPriority() > 128 {
return LocalityLbEndpointsValidationError{
field: "Priority",
reason: "value must be less than or equal to 128",
}
}
return nil
}
// LocalityLbEndpointsValidationError is the validation error returned by
// LocalityLbEndpoints.Validate if the designated constraints aren't met.
type LocalityLbEndpointsValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LocalityLbEndpointsValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LocalityLbEndpointsValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LocalityLbEndpointsValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LocalityLbEndpointsValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LocalityLbEndpointsValidationError) ErrorName() string {
return "LocalityLbEndpointsValidationError"
}
// Error satisfies the builtin error interface
func (e LocalityLbEndpointsValidationError) 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 %sLocalityLbEndpoints.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LocalityLbEndpointsValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LocalityLbEndpointsValidationError{}
// Validate checks the field values on Endpoint_HealthCheckConfig with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *Endpoint_HealthCheckConfig) Validate() error {
if m == nil {
return nil
}
if m.GetPortValue() > 65535 {
return Endpoint_HealthCheckConfigValidationError{
field: "PortValue",
reason: "value must be less than or equal to 65535",
}
}
return nil
}
// Endpoint_HealthCheckConfigValidationError is the validation error returned
// by Endpoint_HealthCheckConfig.Validate if the designated constraints aren't met.
type Endpoint_HealthCheckConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e Endpoint_HealthCheckConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e Endpoint_HealthCheckConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e Endpoint_HealthCheckConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e Endpoint_HealthCheckConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e Endpoint_HealthCheckConfigValidationError) ErrorName() string {
return "Endpoint_HealthCheckConfigValidationError"
}
// Error satisfies the builtin error interface
func (e Endpoint_HealthCheckConfigValidationError) 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 %sEndpoint_HealthCheckConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Endpoint_HealthCheckConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Endpoint_HealthCheckConfigValidationError{}
// define the regex for a UUID once up-front
var _endpoint_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

View File

@ -0,0 +1,341 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/endpoint/endpoint_components.proto
package envoy_api_v2_endpoint
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Endpoint struct {
Address *core.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
HealthCheckConfig *Endpoint_HealthCheckConfig `protobuf:"bytes,2,opt,name=health_check_config,json=healthCheckConfig,proto3" json:"health_check_config,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Endpoint) Reset() { *m = Endpoint{} }
func (m *Endpoint) String() string { return proto.CompactTextString(m) }
func (*Endpoint) ProtoMessage() {}
func (*Endpoint) Descriptor() ([]byte, []int) {
return fileDescriptor_2d96d13bf4e60dd1, []int{0}
}
func (m *Endpoint) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Endpoint.Unmarshal(m, b)
}
func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Endpoint.Marshal(b, m, deterministic)
}
func (m *Endpoint) XXX_Merge(src proto.Message) {
xxx_messageInfo_Endpoint.Merge(m, src)
}
func (m *Endpoint) XXX_Size() int {
return xxx_messageInfo_Endpoint.Size(m)
}
func (m *Endpoint) XXX_DiscardUnknown() {
xxx_messageInfo_Endpoint.DiscardUnknown(m)
}
var xxx_messageInfo_Endpoint proto.InternalMessageInfo
func (m *Endpoint) GetAddress() *core.Address {
if m != nil {
return m.Address
}
return nil
}
func (m *Endpoint) GetHealthCheckConfig() *Endpoint_HealthCheckConfig {
if m != nil {
return m.HealthCheckConfig
}
return nil
}
type Endpoint_HealthCheckConfig struct {
PortValue uint32 `protobuf:"varint,1,opt,name=port_value,json=portValue,proto3" json:"port_value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Endpoint_HealthCheckConfig) Reset() { *m = Endpoint_HealthCheckConfig{} }
func (m *Endpoint_HealthCheckConfig) String() string { return proto.CompactTextString(m) }
func (*Endpoint_HealthCheckConfig) ProtoMessage() {}
func (*Endpoint_HealthCheckConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_2d96d13bf4e60dd1, []int{0, 0}
}
func (m *Endpoint_HealthCheckConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Endpoint_HealthCheckConfig.Unmarshal(m, b)
}
func (m *Endpoint_HealthCheckConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Endpoint_HealthCheckConfig.Marshal(b, m, deterministic)
}
func (m *Endpoint_HealthCheckConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_Endpoint_HealthCheckConfig.Merge(m, src)
}
func (m *Endpoint_HealthCheckConfig) XXX_Size() int {
return xxx_messageInfo_Endpoint_HealthCheckConfig.Size(m)
}
func (m *Endpoint_HealthCheckConfig) XXX_DiscardUnknown() {
xxx_messageInfo_Endpoint_HealthCheckConfig.DiscardUnknown(m)
}
var xxx_messageInfo_Endpoint_HealthCheckConfig proto.InternalMessageInfo
func (m *Endpoint_HealthCheckConfig) GetPortValue() uint32 {
if m != nil {
return m.PortValue
}
return 0
}
type LbEndpoint struct {
// Types that are valid to be assigned to HostIdentifier:
// *LbEndpoint_Endpoint
// *LbEndpoint_EndpointName
HostIdentifier isLbEndpoint_HostIdentifier `protobuf_oneof:"host_identifier"`
HealthStatus core.HealthStatus `protobuf:"varint,2,opt,name=health_status,json=healthStatus,proto3,enum=envoy.api.v2.core.HealthStatus" json:"health_status,omitempty"`
Metadata *core.Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
LoadBalancingWeight *wrappers.UInt32Value `protobuf:"bytes,4,opt,name=load_balancing_weight,json=loadBalancingWeight,proto3" json:"load_balancing_weight,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LbEndpoint) Reset() { *m = LbEndpoint{} }
func (m *LbEndpoint) String() string { return proto.CompactTextString(m) }
func (*LbEndpoint) ProtoMessage() {}
func (*LbEndpoint) Descriptor() ([]byte, []int) {
return fileDescriptor_2d96d13bf4e60dd1, []int{1}
}
func (m *LbEndpoint) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LbEndpoint.Unmarshal(m, b)
}
func (m *LbEndpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LbEndpoint.Marshal(b, m, deterministic)
}
func (m *LbEndpoint) XXX_Merge(src proto.Message) {
xxx_messageInfo_LbEndpoint.Merge(m, src)
}
func (m *LbEndpoint) XXX_Size() int {
return xxx_messageInfo_LbEndpoint.Size(m)
}
func (m *LbEndpoint) XXX_DiscardUnknown() {
xxx_messageInfo_LbEndpoint.DiscardUnknown(m)
}
var xxx_messageInfo_LbEndpoint proto.InternalMessageInfo
type isLbEndpoint_HostIdentifier interface {
isLbEndpoint_HostIdentifier()
}
type LbEndpoint_Endpoint struct {
Endpoint *Endpoint `protobuf:"bytes,1,opt,name=endpoint,proto3,oneof"`
}
type LbEndpoint_EndpointName struct {
EndpointName string `protobuf:"bytes,5,opt,name=endpoint_name,json=endpointName,proto3,oneof"`
}
func (*LbEndpoint_Endpoint) isLbEndpoint_HostIdentifier() {}
func (*LbEndpoint_EndpointName) isLbEndpoint_HostIdentifier() {}
func (m *LbEndpoint) GetHostIdentifier() isLbEndpoint_HostIdentifier {
if m != nil {
return m.HostIdentifier
}
return nil
}
func (m *LbEndpoint) GetEndpoint() *Endpoint {
if x, ok := m.GetHostIdentifier().(*LbEndpoint_Endpoint); ok {
return x.Endpoint
}
return nil
}
func (m *LbEndpoint) GetEndpointName() string {
if x, ok := m.GetHostIdentifier().(*LbEndpoint_EndpointName); ok {
return x.EndpointName
}
return ""
}
func (m *LbEndpoint) GetHealthStatus() core.HealthStatus {
if m != nil {
return m.HealthStatus
}
return core.HealthStatus_UNKNOWN
}
func (m *LbEndpoint) GetMetadata() *core.Metadata {
if m != nil {
return m.Metadata
}
return nil
}
func (m *LbEndpoint) GetLoadBalancingWeight() *wrappers.UInt32Value {
if m != nil {
return m.LoadBalancingWeight
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*LbEndpoint) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*LbEndpoint_Endpoint)(nil),
(*LbEndpoint_EndpointName)(nil),
}
}
type LocalityLbEndpoints struct {
Locality *core.Locality `protobuf:"bytes,1,opt,name=locality,proto3" json:"locality,omitempty"`
LbEndpoints []*LbEndpoint `protobuf:"bytes,2,rep,name=lb_endpoints,json=lbEndpoints,proto3" json:"lb_endpoints,omitempty"`
LoadBalancingWeight *wrappers.UInt32Value `protobuf:"bytes,3,opt,name=load_balancing_weight,json=loadBalancingWeight,proto3" json:"load_balancing_weight,omitempty"`
Priority uint32 `protobuf:"varint,5,opt,name=priority,proto3" json:"priority,omitempty"`
Proximity *wrappers.UInt32Value `protobuf:"bytes,6,opt,name=proximity,proto3" json:"proximity,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LocalityLbEndpoints) Reset() { *m = LocalityLbEndpoints{} }
func (m *LocalityLbEndpoints) String() string { return proto.CompactTextString(m) }
func (*LocalityLbEndpoints) ProtoMessage() {}
func (*LocalityLbEndpoints) Descriptor() ([]byte, []int) {
return fileDescriptor_2d96d13bf4e60dd1, []int{2}
}
func (m *LocalityLbEndpoints) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LocalityLbEndpoints.Unmarshal(m, b)
}
func (m *LocalityLbEndpoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LocalityLbEndpoints.Marshal(b, m, deterministic)
}
func (m *LocalityLbEndpoints) XXX_Merge(src proto.Message) {
xxx_messageInfo_LocalityLbEndpoints.Merge(m, src)
}
func (m *LocalityLbEndpoints) XXX_Size() int {
return xxx_messageInfo_LocalityLbEndpoints.Size(m)
}
func (m *LocalityLbEndpoints) XXX_DiscardUnknown() {
xxx_messageInfo_LocalityLbEndpoints.DiscardUnknown(m)
}
var xxx_messageInfo_LocalityLbEndpoints proto.InternalMessageInfo
func (m *LocalityLbEndpoints) GetLocality() *core.Locality {
if m != nil {
return m.Locality
}
return nil
}
func (m *LocalityLbEndpoints) GetLbEndpoints() []*LbEndpoint {
if m != nil {
return m.LbEndpoints
}
return nil
}
func (m *LocalityLbEndpoints) GetLoadBalancingWeight() *wrappers.UInt32Value {
if m != nil {
return m.LoadBalancingWeight
}
return nil
}
func (m *LocalityLbEndpoints) GetPriority() uint32 {
if m != nil {
return m.Priority
}
return 0
}
func (m *LocalityLbEndpoints) GetProximity() *wrappers.UInt32Value {
if m != nil {
return m.Proximity
}
return nil
}
func init() {
proto.RegisterType((*Endpoint)(nil), "envoy.api.v2.endpoint.Endpoint")
proto.RegisterType((*Endpoint_HealthCheckConfig)(nil), "envoy.api.v2.endpoint.Endpoint.HealthCheckConfig")
proto.RegisterType((*LbEndpoint)(nil), "envoy.api.v2.endpoint.LbEndpoint")
proto.RegisterType((*LocalityLbEndpoints)(nil), "envoy.api.v2.endpoint.LocalityLbEndpoints")
}
func init() {
proto.RegisterFile("envoy/api/v2/endpoint/endpoint_components.proto", fileDescriptor_2d96d13bf4e60dd1)
}
var fileDescriptor_2d96d13bf4e60dd1 = []byte{
// 628 bytes of a gzipped FileDescriptorProto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 0x28,
0x1d, 0xc1, 0xdd, 0xf0, 0xcf, 0xf7, 0xbf, 0xdf, 0x6a, 0x2d, 0x6c, 0xe7, 0x9e, 0xf3, 0x9f, 0xd5,
0xc8, 0x73, 0xba, 0xfb, 0xe3, 0xfc, 0xe7, 0x45, 0xbd, 0xf2, 0xc0, 0x42, 0x4f, 0xb8, 0xcc, 0x83,
0xc9, 0xc8, 0x67, 0xd3, 0x33, 0x72, 0x57, 0x4d, 0x2c, 0xfb, 0xe5, 0xff, 0xde, 0x71, 0xa6, 0xe0,
0xd8, 0xea, 0xd6, 0xb5, 0x94, 0xdd, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x16, 0x0f, 0x37,
0x32, 0x05, 0x00, 0x00,
}

View File

@ -0,0 +1,425 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/endpoint/endpoint_components.proto
package envoy_api_v2_endpoint
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
)
// 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)
_ = ptypes.DynamicAny{}
_ = core.HealthStatus(0)
)
// define the regex for a UUID once up-front
var _endpoint_components_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on Endpoint with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Endpoint) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return EndpointValidationError{
field: "Address",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetHealthCheckConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return EndpointValidationError{
field: "HealthCheckConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// EndpointValidationError is the validation error returned by
// Endpoint.Validate if the designated constraints aren't met.
type EndpointValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e EndpointValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e EndpointValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e EndpointValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e EndpointValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e EndpointValidationError) ErrorName() string { return "EndpointValidationError" }
// Error satisfies the builtin error interface
func (e EndpointValidationError) 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 %sEndpoint.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = EndpointValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = EndpointValidationError{}
// Validate checks the field values on LbEndpoint with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *LbEndpoint) Validate() error {
if m == nil {
return nil
}
// no validation rules for HealthStatus
if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LbEndpointValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
if wrapper := m.GetLoadBalancingWeight(); wrapper != nil {
if wrapper.GetValue() < 1 {
return LbEndpointValidationError{
field: "LoadBalancingWeight",
reason: "value must be greater than or equal to 1",
}
}
}
switch m.HostIdentifier.(type) {
case *LbEndpoint_Endpoint:
if v, ok := interface{}(m.GetEndpoint()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LbEndpointValidationError{
field: "Endpoint",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *LbEndpoint_EndpointName:
// no validation rules for EndpointName
}
return nil
}
// LbEndpointValidationError is the validation error returned by
// LbEndpoint.Validate if the designated constraints aren't met.
type LbEndpointValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LbEndpointValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LbEndpointValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LbEndpointValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LbEndpointValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LbEndpointValidationError) ErrorName() string { return "LbEndpointValidationError" }
// Error satisfies the builtin error interface
func (e LbEndpointValidationError) 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 %sLbEndpoint.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LbEndpointValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LbEndpointValidationError{}
// Validate checks the field values on LocalityLbEndpoints with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *LocalityLbEndpoints) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LocalityLbEndpointsValidationError{
field: "Locality",
reason: "embedded message failed validation",
cause: err,
}
}
}
for idx, item := range m.GetLbEndpoints() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LocalityLbEndpointsValidationError{
field: fmt.Sprintf("LbEndpoints[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if wrapper := m.GetLoadBalancingWeight(); wrapper != nil {
if wrapper.GetValue() < 1 {
return LocalityLbEndpointsValidationError{
field: "LoadBalancingWeight",
reason: "value must be greater than or equal to 1",
}
}
}
if m.GetPriority() > 128 {
return LocalityLbEndpointsValidationError{
field: "Priority",
reason: "value must be less than or equal to 128",
}
}
if v, ok := interface{}(m.GetProximity()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return LocalityLbEndpointsValidationError{
field: "Proximity",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// LocalityLbEndpointsValidationError is the validation error returned by
// LocalityLbEndpoints.Validate if the designated constraints aren't met.
type LocalityLbEndpointsValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e LocalityLbEndpointsValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e LocalityLbEndpointsValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e LocalityLbEndpointsValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e LocalityLbEndpointsValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e LocalityLbEndpointsValidationError) ErrorName() string {
return "LocalityLbEndpointsValidationError"
}
// Error satisfies the builtin error interface
func (e LocalityLbEndpointsValidationError) 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 %sLocalityLbEndpoints.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = LocalityLbEndpointsValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = LocalityLbEndpointsValidationError{}
// Validate checks the field values on Endpoint_HealthCheckConfig with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *Endpoint_HealthCheckConfig) Validate() error {
if m == nil {
return nil
}
if m.GetPortValue() > 65535 {
return Endpoint_HealthCheckConfigValidationError{
field: "PortValue",
reason: "value must be less than or equal to 65535",
}
}
return nil
}
// Endpoint_HealthCheckConfigValidationError is the validation error returned
// by Endpoint_HealthCheckConfig.Validate if the designated constraints aren't met.
type Endpoint_HealthCheckConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e Endpoint_HealthCheckConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e Endpoint_HealthCheckConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e Endpoint_HealthCheckConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e Endpoint_HealthCheckConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e Endpoint_HealthCheckConfigValidationError) ErrorName() string {
return "Endpoint_HealthCheckConfigValidationError"
}
// Error satisfies the builtin error interface
func (e Endpoint_HealthCheckConfigValidationError) 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 %sEndpoint_HealthCheckConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Endpoint_HealthCheckConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Endpoint_HealthCheckConfigValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/endpoint/load_report.proto
package endpoint
package envoy_api_v2_endpoint
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,9 +30,12 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _load_report_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on UpstreamLocalityStats with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
@ -41,17 +44,12 @@ func (m *UpstreamLocalityStats) Validate() error {
return nil
}
{
tmp := m.GetLocality()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamLocalityStatsValidationError{
field: "Locality",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetLocality()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamLocalityStatsValidationError{
field: "Locality",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -62,20 +60,17 @@ func (m *UpstreamLocalityStats) Validate() error {
// no validation rules for TotalErrorRequests
// no validation rules for TotalIssuedRequests
for idx, item := range m.GetLoadMetricStats() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamLocalityStatsValidationError{
field: fmt.Sprintf("LoadMetricStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamLocalityStatsValidationError{
field: fmt.Sprintf("LoadMetricStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -85,17 +80,12 @@ func (m *UpstreamLocalityStats) Validate() error {
for idx, item := range m.GetUpstreamEndpointStats() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamLocalityStatsValidationError{
field: fmt.Sprintf("UpstreamEndpointStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamLocalityStatsValidationError{
field: fmt.Sprintf("UpstreamEndpointStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -171,32 +161,22 @@ func (m *UpstreamEndpointStats) Validate() error {
return nil
}
{
tmp := m.GetAddress()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamEndpointStatsValidationError{
field: "Address",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamEndpointStatsValidationError{
field: "Address",
reason: "embedded message failed validation",
cause: err,
}
}
}
{
tmp := m.GetMetadata()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamEndpointStatsValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamEndpointStatsValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -207,20 +187,17 @@ func (m *UpstreamEndpointStats) Validate() error {
// no validation rules for TotalErrorRequests
// no validation rules for TotalIssuedRequests
for idx, item := range m.GetLoadMetricStats() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamEndpointStatsValidationError{
field: fmt.Sprintf("LoadMetricStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UpstreamEndpointStatsValidationError{
field: fmt.Sprintf("LoadMetricStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -386,17 +363,12 @@ func (m *ClusterStats) Validate() error {
for idx, item := range m.GetUpstreamLocalityStats() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterStatsValidationError{
field: fmt.Sprintf("UpstreamLocalityStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterStatsValidationError{
field: fmt.Sprintf("UpstreamLocalityStats[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
@ -408,34 +380,24 @@ func (m *ClusterStats) Validate() error {
for idx, item := range m.GetDroppedRequests() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterStatsValidationError{
field: fmt.Sprintf("DroppedRequests[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterStatsValidationError{
field: fmt.Sprintf("DroppedRequests[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
{
tmp := m.GetLoadReportInterval()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterStatsValidationError{
field: "LoadReportInterval",
reason: "embedded message failed validation",
cause: err,
}
if v, ok := interface{}(m.GetLoadReportInterval()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ClusterStatsValidationError{
field: "LoadReportInterval",
reason: "embedded message failed validation",
cause: err,
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/lds.proto
package v2
package envoy_api_v2
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,228 +30,25 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// Validate checks the field values on Listener with the rules defined in the
// define the regex for a UUID once up-front
var _lds_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on LdsDummy 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 {
func (m *LdsDummy) Validate() error {
if m == nil {
return nil
}
// no validation rules for Name
{
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,
}
}
}
}
if len(m.GetFilterChains()) < 1 {
return ListenerValidationError{
field: "FilterChains",
reason: "value must contain at least 1 item(s)",
}
}
for idx, item := range m.GetFilterChains() {
_, _ = idx, item
{
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,
}
}
}
}
}
{
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,
}
}
}
}
{
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,
}
}
}
}
{
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,
}
}
}
}
{
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,
}
}
}
}
// no validation rules for DrainType
for idx, item := range m.GetListenerFilters() {
_, _ = idx, item
{
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 {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "ListenerFiltersTimeout",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
{
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,
}
}
}
}
{
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,
}
}
}
}
for idx, item := range m.GetSocketOptions() {
_, _ = idx, item
{
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,
}
}
}
}
}
{
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,
}
}
}
}
return nil
}
// ListenerValidationError is the validation error returned by
// Listener.Validate if the designated constraints aren't met.
type ListenerValidationError struct {
// LdsDummyValidationError is the validation error returned by
// LdsDummy.Validate if the designated constraints aren't met.
type LdsDummyValidationError struct {
field string
reason string
cause error
@ -259,22 +56,22 @@ type ListenerValidationError struct {
}
// Field function returns field value.
func (e ListenerValidationError) Field() string { return e.field }
func (e LdsDummyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListenerValidationError) Reason() string { return e.reason }
func (e LdsDummyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListenerValidationError) Cause() error { return e.cause }
func (e LdsDummyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListenerValidationError) Key() bool { return e.key }
func (e LdsDummyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListenerValidationError) ErrorName() string { return "ListenerValidationError" }
func (e LdsDummyValidationError) ErrorName() string { return "LdsDummyValidationError" }
// Error satisfies the builtin error interface
func (e ListenerValidationError) Error() string {
func (e LdsDummyValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@ -286,14 +83,14 @@ func (e ListenerValidationError) Error() string {
}
return fmt.Sprintf(
"invalid %sListener.%s: %s%s",
"invalid %sLdsDummy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListenerValidationError{}
var _ error = LdsDummyValidationError{}
var _ interface {
Field() string
@ -301,86 +98,4 @@ var _ interface {
Key() bool
Cause() error
ErrorName() string
} = ListenerValidationError{}
// 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
}
{
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,
}
}
}
}
return nil
}
// Listener_DeprecatedV1ValidationError is the validation error returned by
// Listener_DeprecatedV1.Validate if the designated constraints aren't met.
type Listener_DeprecatedV1ValidationError struct {
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"
}
// Error satisfies the builtin error interface
func (e Listener_DeprecatedV1ValidationError) 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 %sListener_DeprecatedV1.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Listener_DeprecatedV1ValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Listener_DeprecatedV1ValidationError{}
} = LdsDummyValidationError{}

View File

@ -0,0 +1,475 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/listener.proto
package envoy_api_v2
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
listener "github.com/envoyproxy/go-control-plane/envoy/api/v2/listener"
v21 "github.com/envoyproxy/go-control-plane/envoy/config/filter/accesslog/v2"
v2 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v2"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
duration "github.com/golang/protobuf/ptypes/duration"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
_ "google.golang.org/genproto/googleapis/api/annotations"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Listener_DrainType int32
const (
Listener_DEFAULT Listener_DrainType = 0
Listener_MODIFY_ONLY Listener_DrainType = 1
)
var Listener_DrainType_name = map[int32]string{
0: "DEFAULT",
1: "MODIFY_ONLY",
}
var Listener_DrainType_value = map[string]int32{
"DEFAULT": 0,
"MODIFY_ONLY": 1,
}
func (x Listener_DrainType) String() string {
return proto.EnumName(Listener_DrainType_name, int32(x))
}
func (Listener_DrainType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_0f8f4b6e66505502, []int{0, 0}
}
type Listener struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Address *core.Address `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
FilterChains []*listener.FilterChain `protobuf:"bytes,3,rep,name=filter_chains,json=filterChains,proto3" json:"filter_chains,omitempty"`
UseOriginalDst *wrappers.BoolValue `protobuf:"bytes,4,opt,name=use_original_dst,json=useOriginalDst,proto3" json:"use_original_dst,omitempty"` // Deprecated: Do not use.
PerConnectionBufferLimitBytes *wrappers.UInt32Value `protobuf:"bytes,5,opt,name=per_connection_buffer_limit_bytes,json=perConnectionBufferLimitBytes,proto3" json:"per_connection_buffer_limit_bytes,omitempty"`
Metadata *core.Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
DeprecatedV1 *Listener_DeprecatedV1 `protobuf:"bytes,7,opt,name=deprecated_v1,json=deprecatedV1,proto3" json:"deprecated_v1,omitempty"`
DrainType Listener_DrainType `protobuf:"varint,8,opt,name=drain_type,json=drainType,proto3,enum=envoy.api.v2.Listener_DrainType" json:"drain_type,omitempty"`
ListenerFilters []*listener.ListenerFilter `protobuf:"bytes,9,rep,name=listener_filters,json=listenerFilters,proto3" json:"listener_filters,omitempty"`
ListenerFiltersTimeout *duration.Duration `protobuf:"bytes,15,opt,name=listener_filters_timeout,json=listenerFiltersTimeout,proto3" json:"listener_filters_timeout,omitempty"`
ContinueOnListenerFiltersTimeout bool `protobuf:"varint,17,opt,name=continue_on_listener_filters_timeout,json=continueOnListenerFiltersTimeout,proto3" json:"continue_on_listener_filters_timeout,omitempty"`
Transparent *wrappers.BoolValue `protobuf:"bytes,10,opt,name=transparent,proto3" json:"transparent,omitempty"`
Freebind *wrappers.BoolValue `protobuf:"bytes,11,opt,name=freebind,proto3" json:"freebind,omitempty"`
SocketOptions []*core.SocketOption `protobuf:"bytes,13,rep,name=socket_options,json=socketOptions,proto3" json:"socket_options,omitempty"`
TcpFastOpenQueueLength *wrappers.UInt32Value `protobuf:"bytes,12,opt,name=tcp_fast_open_queue_length,json=tcpFastOpenQueueLength,proto3" json:"tcp_fast_open_queue_length,omitempty"`
TrafficDirection core.TrafficDirection `protobuf:"varint,16,opt,name=traffic_direction,json=trafficDirection,proto3,enum=envoy.api.v2.core.TrafficDirection" json:"traffic_direction,omitempty"`
UdpListenerConfig *listener.UdpListenerConfig `protobuf:"bytes,18,opt,name=udp_listener_config,json=udpListenerConfig,proto3" json:"udp_listener_config,omitempty"`
ApiListener *v2.ApiListener `protobuf:"bytes,19,opt,name=api_listener,json=apiListener,proto3" json:"api_listener,omitempty"`
ConnectionBalanceConfig *Listener_ConnectionBalanceConfig `protobuf:"bytes,20,opt,name=connection_balance_config,json=connectionBalanceConfig,proto3" json:"connection_balance_config,omitempty"`
ReusePort bool `protobuf:"varint,21,opt,name=reuse_port,json=reusePort,proto3" json:"reuse_port,omitempty"`
AccessLog []*v21.AccessLog `protobuf:"bytes,22,rep,name=access_log,json=accessLog,proto3" json:"access_log,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Listener) Reset() { *m = Listener{} }
func (m *Listener) String() string { return proto.CompactTextString(m) }
func (*Listener) ProtoMessage() {}
func (*Listener) Descriptor() ([]byte, []int) {
return fileDescriptor_0f8f4b6e66505502, []int{0}
}
func (m *Listener) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Listener.Unmarshal(m, b)
}
func (m *Listener) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Listener.Marshal(b, m, deterministic)
}
func (m *Listener) XXX_Merge(src proto.Message) {
xxx_messageInfo_Listener.Merge(m, src)
}
func (m *Listener) XXX_Size() int {
return xxx_messageInfo_Listener.Size(m)
}
func (m *Listener) XXX_DiscardUnknown() {
xxx_messageInfo_Listener.DiscardUnknown(m)
}
var xxx_messageInfo_Listener proto.InternalMessageInfo
func (m *Listener) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Listener) GetAddress() *core.Address {
if m != nil {
return m.Address
}
return nil
}
func (m *Listener) GetFilterChains() []*listener.FilterChain {
if m != nil {
return m.FilterChains
}
return nil
}
// Deprecated: Do not use.
func (m *Listener) GetUseOriginalDst() *wrappers.BoolValue {
if m != nil {
return m.UseOriginalDst
}
return nil
}
func (m *Listener) GetPerConnectionBufferLimitBytes() *wrappers.UInt32Value {
if m != nil {
return m.PerConnectionBufferLimitBytes
}
return nil
}
func (m *Listener) GetMetadata() *core.Metadata {
if m != nil {
return m.Metadata
}
return nil
}
func (m *Listener) GetDeprecatedV1() *Listener_DeprecatedV1 {
if m != nil {
return m.DeprecatedV1
}
return nil
}
func (m *Listener) GetDrainType() Listener_DrainType {
if m != nil {
return m.DrainType
}
return Listener_DEFAULT
}
func (m *Listener) GetListenerFilters() []*listener.ListenerFilter {
if m != nil {
return m.ListenerFilters
}
return nil
}
func (m *Listener) GetListenerFiltersTimeout() *duration.Duration {
if m != nil {
return m.ListenerFiltersTimeout
}
return nil
}
func (m *Listener) GetContinueOnListenerFiltersTimeout() bool {
if m != nil {
return m.ContinueOnListenerFiltersTimeout
}
return false
}
func (m *Listener) GetTransparent() *wrappers.BoolValue {
if m != nil {
return m.Transparent
}
return nil
}
func (m *Listener) GetFreebind() *wrappers.BoolValue {
if m != nil {
return m.Freebind
}
return nil
}
func (m *Listener) GetSocketOptions() []*core.SocketOption {
if m != nil {
return m.SocketOptions
}
return nil
}
func (m *Listener) GetTcpFastOpenQueueLength() *wrappers.UInt32Value {
if m != nil {
return m.TcpFastOpenQueueLength
}
return nil
}
func (m *Listener) GetTrafficDirection() core.TrafficDirection {
if m != nil {
return m.TrafficDirection
}
return core.TrafficDirection_UNSPECIFIED
}
func (m *Listener) GetUdpListenerConfig() *listener.UdpListenerConfig {
if m != nil {
return m.UdpListenerConfig
}
return nil
}
func (m *Listener) GetApiListener() *v2.ApiListener {
if m != nil {
return m.ApiListener
}
return nil
}
func (m *Listener) GetConnectionBalanceConfig() *Listener_ConnectionBalanceConfig {
if m != nil {
return m.ConnectionBalanceConfig
}
return nil
}
func (m *Listener) GetReusePort() bool {
if m != nil {
return m.ReusePort
}
return false
}
func (m *Listener) GetAccessLog() []*v21.AccessLog {
if m != nil {
return m.AccessLog
}
return nil
}
type Listener_DeprecatedV1 struct {
BindToPort *wrappers.BoolValue `protobuf:"bytes,1,opt,name=bind_to_port,json=bindToPort,proto3" json:"bind_to_port,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Listener_DeprecatedV1) Reset() { *m = Listener_DeprecatedV1{} }
func (m *Listener_DeprecatedV1) String() string { return proto.CompactTextString(m) }
func (*Listener_DeprecatedV1) ProtoMessage() {}
func (*Listener_DeprecatedV1) Descriptor() ([]byte, []int) {
return fileDescriptor_0f8f4b6e66505502, []int{0, 0}
}
func (m *Listener_DeprecatedV1) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Listener_DeprecatedV1.Unmarshal(m, b)
}
func (m *Listener_DeprecatedV1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Listener_DeprecatedV1.Marshal(b, m, deterministic)
}
func (m *Listener_DeprecatedV1) XXX_Merge(src proto.Message) {
xxx_messageInfo_Listener_DeprecatedV1.Merge(m, src)
}
func (m *Listener_DeprecatedV1) XXX_Size() int {
return xxx_messageInfo_Listener_DeprecatedV1.Size(m)
}
func (m *Listener_DeprecatedV1) XXX_DiscardUnknown() {
xxx_messageInfo_Listener_DeprecatedV1.DiscardUnknown(m)
}
var xxx_messageInfo_Listener_DeprecatedV1 proto.InternalMessageInfo
func (m *Listener_DeprecatedV1) GetBindToPort() *wrappers.BoolValue {
if m != nil {
return m.BindToPort
}
return nil
}
type Listener_ConnectionBalanceConfig struct {
// Types that are valid to be assigned to BalanceType:
// *Listener_ConnectionBalanceConfig_ExactBalance_
BalanceType isListener_ConnectionBalanceConfig_BalanceType `protobuf_oneof:"balance_type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Listener_ConnectionBalanceConfig) Reset() { *m = Listener_ConnectionBalanceConfig{} }
func (m *Listener_ConnectionBalanceConfig) String() string { return proto.CompactTextString(m) }
func (*Listener_ConnectionBalanceConfig) ProtoMessage() {}
func (*Listener_ConnectionBalanceConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_0f8f4b6e66505502, []int{0, 1}
}
func (m *Listener_ConnectionBalanceConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Listener_ConnectionBalanceConfig.Unmarshal(m, b)
}
func (m *Listener_ConnectionBalanceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Listener_ConnectionBalanceConfig.Marshal(b, m, deterministic)
}
func (m *Listener_ConnectionBalanceConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_Listener_ConnectionBalanceConfig.Merge(m, src)
}
func (m *Listener_ConnectionBalanceConfig) XXX_Size() int {
return xxx_messageInfo_Listener_ConnectionBalanceConfig.Size(m)
}
func (m *Listener_ConnectionBalanceConfig) XXX_DiscardUnknown() {
xxx_messageInfo_Listener_ConnectionBalanceConfig.DiscardUnknown(m)
}
var xxx_messageInfo_Listener_ConnectionBalanceConfig proto.InternalMessageInfo
type isListener_ConnectionBalanceConfig_BalanceType interface {
isListener_ConnectionBalanceConfig_BalanceType()
}
type Listener_ConnectionBalanceConfig_ExactBalance_ struct {
ExactBalance *Listener_ConnectionBalanceConfig_ExactBalance `protobuf:"bytes,1,opt,name=exact_balance,json=exactBalance,proto3,oneof"`
}
func (*Listener_ConnectionBalanceConfig_ExactBalance_) isListener_ConnectionBalanceConfig_BalanceType() {
}
func (m *Listener_ConnectionBalanceConfig) GetBalanceType() isListener_ConnectionBalanceConfig_BalanceType {
if m != nil {
return m.BalanceType
}
return nil
}
func (m *Listener_ConnectionBalanceConfig) GetExactBalance() *Listener_ConnectionBalanceConfig_ExactBalance {
if x, ok := m.GetBalanceType().(*Listener_ConnectionBalanceConfig_ExactBalance_); ok {
return x.ExactBalance
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*Listener_ConnectionBalanceConfig) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Listener_ConnectionBalanceConfig_ExactBalance_)(nil),
}
}
type Listener_ConnectionBalanceConfig_ExactBalance struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Listener_ConnectionBalanceConfig_ExactBalance) Reset() {
*m = Listener_ConnectionBalanceConfig_ExactBalance{}
}
func (m *Listener_ConnectionBalanceConfig_ExactBalance) String() string {
return proto.CompactTextString(m)
}
func (*Listener_ConnectionBalanceConfig_ExactBalance) ProtoMessage() {}
func (*Listener_ConnectionBalanceConfig_ExactBalance) Descriptor() ([]byte, []int) {
return fileDescriptor_0f8f4b6e66505502, []int{0, 1, 0}
}
func (m *Listener_ConnectionBalanceConfig_ExactBalance) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Listener_ConnectionBalanceConfig_ExactBalance.Unmarshal(m, b)
}
func (m *Listener_ConnectionBalanceConfig_ExactBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Listener_ConnectionBalanceConfig_ExactBalance.Marshal(b, m, deterministic)
}
func (m *Listener_ConnectionBalanceConfig_ExactBalance) XXX_Merge(src proto.Message) {
xxx_messageInfo_Listener_ConnectionBalanceConfig_ExactBalance.Merge(m, src)
}
func (m *Listener_ConnectionBalanceConfig_ExactBalance) XXX_Size() int {
return xxx_messageInfo_Listener_ConnectionBalanceConfig_ExactBalance.Size(m)
}
func (m *Listener_ConnectionBalanceConfig_ExactBalance) XXX_DiscardUnknown() {
xxx_messageInfo_Listener_ConnectionBalanceConfig_ExactBalance.DiscardUnknown(m)
}
var xxx_messageInfo_Listener_ConnectionBalanceConfig_ExactBalance proto.InternalMessageInfo
func init() {
proto.RegisterEnum("envoy.api.v2.Listener_DrainType", Listener_DrainType_name, Listener_DrainType_value)
proto.RegisterType((*Listener)(nil), "envoy.api.v2.Listener")
proto.RegisterType((*Listener_DeprecatedV1)(nil), "envoy.api.v2.Listener.DeprecatedV1")
proto.RegisterType((*Listener_ConnectionBalanceConfig)(nil), "envoy.api.v2.Listener.ConnectionBalanceConfig")
proto.RegisterType((*Listener_ConnectionBalanceConfig_ExactBalance)(nil), "envoy.api.v2.Listener.ConnectionBalanceConfig.ExactBalance")
}
func init() { proto.RegisterFile("envoy/api/v2/listener.proto", fileDescriptor_0f8f4b6e66505502) }
var fileDescriptor_0f8f4b6e66505502 = []byte{
// 1046 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x73, 0x1b, 0xb5,
0x1b, 0xef, 0xa6, 0x79, 0xb1, 0xe5, 0x97, 0x38, 0xca, 0xff, 0x9f, 0x6c, 0xdd, 0x84, 0x9a, 0x94,
0xce, 0x98, 0xe9, 0xcc, 0x9a, 0x3a, 0x33, 0x70, 0xa0, 0x03, 0x13, 0xc7, 0x0d, 0x69, 0xc7, 0xad,
0xc3, 0x36, 0xe9, 0xb4, 0x27, 0x8d, 0xbc, 0xab, 0x75, 0x05, 0x6b, 0x49, 0x48, 0x5a, 0xd3, 0xdc,
0x38, 0x73, 0xe1, 0xca, 0x85, 0x0b, 0x1f, 0x83, 0x4f, 0xc0, 0x95, 0xaf, 0xc2, 0x89, 0xe1, 0xc0,
0x30, 0xab, 0x7d, 0xc9, 0x3a, 0xb6, 0x09, 0xdc, 0xf4, 0xe8, 0xf9, 0xfd, 0x7e, 0xfb, 0xbc, 0xed,
0x23, 0x70, 0x97, 0xb0, 0x29, 0xbf, 0xec, 0x60, 0x41, 0x3b, 0xd3, 0x6e, 0x27, 0xa4, 0x4a, 0x13,
0x46, 0xa4, 0x23, 0x24, 0xd7, 0x1c, 0x56, 0x8d, 0xd3,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, 0x00,
}

View File

@ -0,0 +1,538 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/listener.proto
package envoy_api_v2
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
)
// 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)
_ = ptypes.DynamicAny{}
_ = core.TrafficDirection(0)
)
// define the regex for a UUID once up-front
var _listener_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// 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
if m.GetAddress() == nil {
return ListenerValidationError{
field: "Address",
reason: "value is required",
}
}
if v, ok := interface{}(m.GetAddress()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "Address",
reason: "embedded message failed validation",
cause: err,
}
}
}
for idx, item := range m.GetFilterChains() {
_, _ = idx, item
if v, ok := interface{}(item).(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,
}
}
}
}
if v, ok := interface{}(m.GetUseOriginalDst()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "UseOriginalDst",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetPerConnectionBufferLimitBytes()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "PerConnectionBufferLimitBytes",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetDeprecatedV1()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "DeprecatedV1",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for DrainType
for idx, item := range m.GetListenerFilters() {
_, _ = idx, item
if v, ok := interface{}(item).(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,
}
}
}
}
if v, ok := interface{}(m.GetListenerFiltersTimeout()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "ListenerFiltersTimeout",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for ContinueOnListenerFiltersTimeout
if v, ok := interface{}(m.GetTransparent()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "Transparent",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetFreebind()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "Freebind",
reason: "embedded message failed validation",
cause: err,
}
}
}
for idx, item := range m.GetSocketOptions() {
_, _ = idx, item
if v, ok := interface{}(item).(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,
}
}
}
}
if v, ok := interface{}(m.GetTcpFastOpenQueueLength()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "TcpFastOpenQueueLength",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for TrafficDirection
if v, ok := interface{}(m.GetUdpListenerConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "UdpListenerConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetApiListener()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "ApiListener",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetConnectionBalanceConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: "ConnectionBalanceConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for ReusePort
for idx, item := range m.GetAccessLog() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerValidationError{
field: fmt.Sprintf("AccessLog[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// ListenerValidationError is the validation error returned by
// Listener.Validate if the designated constraints aren't met.
type ListenerValidationError struct {
field string
reason string
cause error
key bool
}
// 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" }
// Error satisfies the builtin error interface
func (e ListenerValidationError) 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 %sListener.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListenerValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListenerValidationError{}
// 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
}
if v, ok := interface{}(m.GetBindToPort()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Listener_DeprecatedV1ValidationError{
field: "BindToPort",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// Listener_DeprecatedV1ValidationError is the validation error returned by
// Listener_DeprecatedV1.Validate if the designated constraints aren't met.
type Listener_DeprecatedV1ValidationError struct {
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"
}
// Error satisfies the builtin error interface
func (e Listener_DeprecatedV1ValidationError) 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 %sListener_DeprecatedV1.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Listener_DeprecatedV1ValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Listener_DeprecatedV1ValidationError{}
// Validate checks the field values on Listener_ConnectionBalanceConfig with
// the rules defined in the proto definition for this message. If any rules
// are violated, an error is returned.
func (m *Listener_ConnectionBalanceConfig) Validate() error {
if m == nil {
return nil
}
switch m.BalanceType.(type) {
case *Listener_ConnectionBalanceConfig_ExactBalance_:
if v, ok := interface{}(m.GetExactBalance()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return Listener_ConnectionBalanceConfigValidationError{
field: "ExactBalance",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
return Listener_ConnectionBalanceConfigValidationError{
field: "BalanceType",
reason: "value is required",
}
}
return nil
}
// Listener_ConnectionBalanceConfigValidationError is the validation error
// returned by Listener_ConnectionBalanceConfig.Validate if the designated
// constraints aren't met.
type Listener_ConnectionBalanceConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e Listener_ConnectionBalanceConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e Listener_ConnectionBalanceConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e Listener_ConnectionBalanceConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e Listener_ConnectionBalanceConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e Listener_ConnectionBalanceConfigValidationError) ErrorName() string {
return "Listener_ConnectionBalanceConfigValidationError"
}
// Error satisfies the builtin error interface
func (e Listener_ConnectionBalanceConfigValidationError) 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 %sListener_ConnectionBalanceConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Listener_ConnectionBalanceConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Listener_ConnectionBalanceConfigValidationError{}
// Validate checks the field values on
// Listener_ConnectionBalanceConfig_ExactBalance with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Listener_ConnectionBalanceConfig_ExactBalance) Validate() error {
if m == nil {
return nil
}
return nil
}
// Listener_ConnectionBalanceConfig_ExactBalanceValidationError is the
// validation error returned by
// Listener_ConnectionBalanceConfig_ExactBalance.Validate if the designated
// constraints aren't met.
type Listener_ConnectionBalanceConfig_ExactBalanceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e Listener_ConnectionBalanceConfig_ExactBalanceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e Listener_ConnectionBalanceConfig_ExactBalanceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e Listener_ConnectionBalanceConfig_ExactBalanceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e Listener_ConnectionBalanceConfig_ExactBalanceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e Listener_ConnectionBalanceConfig_ExactBalanceValidationError) ErrorName() string {
return "Listener_ConnectionBalanceConfig_ExactBalanceValidationError"
}
// Error satisfies the builtin error interface
func (e Listener_ConnectionBalanceConfig_ExactBalanceValidationError) 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 %sListener_ConnectionBalanceConfig_ExactBalance.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = Listener_ConnectionBalanceConfig_ExactBalanceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = Listener_ConnectionBalanceConfig_ExactBalanceValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/listener/listener.proto
package listener
package envoy_api_v2_listener
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,546 +30,8 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.DynamicAny{}
)
// Validate checks the field values on Filter with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Filter) Validate() error {
if m == nil {
return nil
}
if len(m.GetName()) < 1 {
return FilterValidationError{
field: "Name",
reason: "value length must be at least 1 bytes",
}
}
switch m.ConfigType.(type) {
case *Filter_Config:
{
tmp := m.GetConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
case *Filter_TypedConfig:
{
tmp := m.GetTypedConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
return nil
}
// FilterValidationError is the validation error returned by Filter.Validate if
// the designated constraints aren't met.
type FilterValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FilterValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FilterValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FilterValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FilterValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FilterValidationError) ErrorName() string { return "FilterValidationError" }
// Error satisfies the builtin error interface
func (e FilterValidationError) 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 %sFilter.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FilterValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FilterValidationError{}
// Validate checks the field values on FilterChainMatch with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *FilterChainMatch) Validate() error {
if m == nil {
return nil
}
if wrapper := m.GetDestinationPort(); wrapper != nil {
if val := wrapper.GetValue(); val < 1 || val > 65535 {
return FilterChainMatchValidationError{
field: "DestinationPort",
reason: "value must be inside range [1, 65535]",
}
}
}
for idx, item := range m.GetPrefixRanges() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainMatchValidationError{
field: fmt.Sprintf("PrefixRanges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
// no validation rules for AddressSuffix
{
tmp := m.GetSuffixLen()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainMatchValidationError{
field: "SuffixLen",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if _, ok := FilterChainMatch_ConnectionSourceType_name[int32(m.GetSourceType())]; !ok {
return FilterChainMatchValidationError{
field: "SourceType",
reason: "value must be one of the defined enum values",
}
}
for idx, item := range m.GetSourcePrefixRanges() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainMatchValidationError{
field: fmt.Sprintf("SourcePrefixRanges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
for idx, item := range m.GetSourcePorts() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainMatchValidationError{
field: fmt.Sprintf("SourcePorts[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
// no validation rules for TransportProtocol
return nil
}
// FilterChainMatchValidationError is the validation error returned by
// FilterChainMatch.Validate if the designated constraints aren't met.
type FilterChainMatchValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FilterChainMatchValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FilterChainMatchValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FilterChainMatchValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FilterChainMatchValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FilterChainMatchValidationError) ErrorName() string { return "FilterChainMatchValidationError" }
// Error satisfies the builtin error interface
func (e FilterChainMatchValidationError) 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 %sFilterChainMatch.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FilterChainMatchValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FilterChainMatchValidationError{}
// Validate checks the field values on FilterChain with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *FilterChain) Validate() error {
if m == nil {
return nil
}
{
tmp := m.GetFilterChainMatch()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "FilterChainMatch",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
{
tmp := m.GetTlsContext()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "TlsContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
for idx, item := range m.GetFilters() {
_, _ = idx, item
{
tmp := item
if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: fmt.Sprintf("Filters[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
{
tmp := m.GetUseProxyProto()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "UseProxyProto",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
{
tmp := m.GetMetadata()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
{
tmp := m.GetTransportSocket()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "TransportSocket",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// FilterChainValidationError is the validation error returned by
// FilterChain.Validate if the designated constraints aren't met.
type FilterChainValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FilterChainValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FilterChainValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FilterChainValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FilterChainValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FilterChainValidationError) ErrorName() string { return "FilterChainValidationError" }
// Error satisfies the builtin error interface
func (e FilterChainValidationError) 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 %sFilterChain.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FilterChainValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FilterChainValidationError{}
// Validate checks the field values on ListenerFilter with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *ListenerFilter) Validate() error {
if m == nil {
return nil
}
if len(m.GetName()) < 1 {
return ListenerFilterValidationError{
field: "Name",
reason: "value length must be at least 1 bytes",
}
}
switch m.ConfigType.(type) {
case *ListenerFilter_Config:
{
tmp := m.GetConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
case *ListenerFilter_TypedConfig:
{
tmp := m.GetTypedConfig()
if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
}
return nil
}
// ListenerFilterValidationError is the validation error returned by
// ListenerFilter.Validate if the designated constraints aren't met.
type ListenerFilterValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListenerFilterValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListenerFilterValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListenerFilterValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListenerFilterValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListenerFilterValidationError) ErrorName() string { return "ListenerFilterValidationError" }
// Error satisfies the builtin error interface
func (e ListenerFilterValidationError) 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 %sListenerFilter.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListenerFilterValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListenerFilterValidationError{}
// define the regex for a UUID once up-front
var _listener_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")

View File

@ -0,0 +1,702 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/listener/listener_components.proto
package envoy_api_v2_listener
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
auth "github.com/envoyproxy/go-control-plane/envoy/api/v2/auth"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
_type "github.com/envoyproxy/go-control-plane/envoy/type"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
any "github.com/golang/protobuf/ptypes/any"
_struct "github.com/golang/protobuf/ptypes/struct"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type FilterChainMatch_ConnectionSourceType int32
const (
FilterChainMatch_ANY FilterChainMatch_ConnectionSourceType = 0
FilterChainMatch_LOCAL FilterChainMatch_ConnectionSourceType = 1
FilterChainMatch_EXTERNAL FilterChainMatch_ConnectionSourceType = 2
)
var FilterChainMatch_ConnectionSourceType_name = map[int32]string{
0: "ANY",
1: "LOCAL",
2: "EXTERNAL",
}
var FilterChainMatch_ConnectionSourceType_value = map[string]int32{
"ANY": 0,
"LOCAL": 1,
"EXTERNAL": 2,
}
func (x FilterChainMatch_ConnectionSourceType) String() string {
return proto.EnumName(FilterChainMatch_ConnectionSourceType_name, int32(x))
}
func (FilterChainMatch_ConnectionSourceType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_30285372e511ffb4, []int{1, 0}
}
type Filter struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Types that are valid to be assigned to ConfigType:
// *Filter_Config
// *Filter_TypedConfig
ConfigType isFilter_ConfigType `protobuf_oneof:"config_type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Filter) Reset() { *m = Filter{} }
func (m *Filter) String() string { return proto.CompactTextString(m) }
func (*Filter) ProtoMessage() {}
func (*Filter) Descriptor() ([]byte, []int) {
return fileDescriptor_30285372e511ffb4, []int{0}
}
func (m *Filter) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Filter.Unmarshal(m, b)
}
func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Filter.Marshal(b, m, deterministic)
}
func (m *Filter) XXX_Merge(src proto.Message) {
xxx_messageInfo_Filter.Merge(m, src)
}
func (m *Filter) XXX_Size() int {
return xxx_messageInfo_Filter.Size(m)
}
func (m *Filter) XXX_DiscardUnknown() {
xxx_messageInfo_Filter.DiscardUnknown(m)
}
var xxx_messageInfo_Filter proto.InternalMessageInfo
func (m *Filter) GetName() string {
if m != nil {
return m.Name
}
return ""
}
type isFilter_ConfigType interface {
isFilter_ConfigType()
}
type Filter_Config struct {
Config *_struct.Struct `protobuf:"bytes,2,opt,name=config,proto3,oneof"`
}
type Filter_TypedConfig struct {
TypedConfig *any.Any `protobuf:"bytes,4,opt,name=typed_config,json=typedConfig,proto3,oneof"`
}
func (*Filter_Config) isFilter_ConfigType() {}
func (*Filter_TypedConfig) isFilter_ConfigType() {}
func (m *Filter) GetConfigType() isFilter_ConfigType {
if m != nil {
return m.ConfigType
}
return nil
}
// Deprecated: Do not use.
func (m *Filter) GetConfig() *_struct.Struct {
if x, ok := m.GetConfigType().(*Filter_Config); ok {
return x.Config
}
return nil
}
func (m *Filter) GetTypedConfig() *any.Any {
if x, ok := m.GetConfigType().(*Filter_TypedConfig); ok {
return x.TypedConfig
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*Filter) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Filter_Config)(nil),
(*Filter_TypedConfig)(nil),
}
}
type FilterChainMatch struct {
DestinationPort *wrappers.UInt32Value `protobuf:"bytes,8,opt,name=destination_port,json=destinationPort,proto3" json:"destination_port,omitempty"`
PrefixRanges []*core.CidrRange `protobuf:"bytes,3,rep,name=prefix_ranges,json=prefixRanges,proto3" json:"prefix_ranges,omitempty"`
AddressSuffix string `protobuf:"bytes,4,opt,name=address_suffix,json=addressSuffix,proto3" json:"address_suffix,omitempty"`
SuffixLen *wrappers.UInt32Value `protobuf:"bytes,5,opt,name=suffix_len,json=suffixLen,proto3" json:"suffix_len,omitempty"`
SourceType FilterChainMatch_ConnectionSourceType `protobuf:"varint,12,opt,name=source_type,json=sourceType,proto3,enum=envoy.api.v2.listener.FilterChainMatch_ConnectionSourceType" json:"source_type,omitempty"`
SourcePrefixRanges []*core.CidrRange `protobuf:"bytes,6,rep,name=source_prefix_ranges,json=sourcePrefixRanges,proto3" json:"source_prefix_ranges,omitempty"`
SourcePorts []uint32 `protobuf:"varint,7,rep,packed,name=source_ports,json=sourcePorts,proto3" json:"source_ports,omitempty"`
ServerNames []string `protobuf:"bytes,11,rep,name=server_names,json=serverNames,proto3" json:"server_names,omitempty"`
TransportProtocol string `protobuf:"bytes,9,opt,name=transport_protocol,json=transportProtocol,proto3" json:"transport_protocol,omitempty"`
ApplicationProtocols []string `protobuf:"bytes,10,rep,name=application_protocols,json=applicationProtocols,proto3" json:"application_protocols,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FilterChainMatch) Reset() { *m = FilterChainMatch{} }
func (m *FilterChainMatch) String() string { return proto.CompactTextString(m) }
func (*FilterChainMatch) ProtoMessage() {}
func (*FilterChainMatch) Descriptor() ([]byte, []int) {
return fileDescriptor_30285372e511ffb4, []int{1}
}
func (m *FilterChainMatch) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FilterChainMatch.Unmarshal(m, b)
}
func (m *FilterChainMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FilterChainMatch.Marshal(b, m, deterministic)
}
func (m *FilterChainMatch) XXX_Merge(src proto.Message) {
xxx_messageInfo_FilterChainMatch.Merge(m, src)
}
func (m *FilterChainMatch) XXX_Size() int {
return xxx_messageInfo_FilterChainMatch.Size(m)
}
func (m *FilterChainMatch) XXX_DiscardUnknown() {
xxx_messageInfo_FilterChainMatch.DiscardUnknown(m)
}
var xxx_messageInfo_FilterChainMatch proto.InternalMessageInfo
func (m *FilterChainMatch) GetDestinationPort() *wrappers.UInt32Value {
if m != nil {
return m.DestinationPort
}
return nil
}
func (m *FilterChainMatch) GetPrefixRanges() []*core.CidrRange {
if m != nil {
return m.PrefixRanges
}
return nil
}
func (m *FilterChainMatch) GetAddressSuffix() string {
if m != nil {
return m.AddressSuffix
}
return ""
}
func (m *FilterChainMatch) GetSuffixLen() *wrappers.UInt32Value {
if m != nil {
return m.SuffixLen
}
return nil
}
func (m *FilterChainMatch) GetSourceType() FilterChainMatch_ConnectionSourceType {
if m != nil {
return m.SourceType
}
return FilterChainMatch_ANY
}
func (m *FilterChainMatch) GetSourcePrefixRanges() []*core.CidrRange {
if m != nil {
return m.SourcePrefixRanges
}
return nil
}
func (m *FilterChainMatch) GetSourcePorts() []uint32 {
if m != nil {
return m.SourcePorts
}
return nil
}
func (m *FilterChainMatch) GetServerNames() []string {
if m != nil {
return m.ServerNames
}
return nil
}
func (m *FilterChainMatch) GetTransportProtocol() string {
if m != nil {
return m.TransportProtocol
}
return ""
}
func (m *FilterChainMatch) GetApplicationProtocols() []string {
if m != nil {
return m.ApplicationProtocols
}
return nil
}
type FilterChain struct {
FilterChainMatch *FilterChainMatch `protobuf:"bytes,1,opt,name=filter_chain_match,json=filterChainMatch,proto3" json:"filter_chain_match,omitempty"`
TlsContext *auth.DownstreamTlsContext `protobuf:"bytes,2,opt,name=tls_context,json=tlsContext,proto3" json:"tls_context,omitempty"` // Deprecated: Do not use.
Filters []*Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
UseProxyProto *wrappers.BoolValue `protobuf:"bytes,4,opt,name=use_proxy_proto,json=useProxyProto,proto3" json:"use_proxy_proto,omitempty"`
Metadata *core.Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
TransportSocket *core.TransportSocket `protobuf:"bytes,6,opt,name=transport_socket,json=transportSocket,proto3" json:"transport_socket,omitempty"`
Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FilterChain) Reset() { *m = FilterChain{} }
func (m *FilterChain) String() string { return proto.CompactTextString(m) }
func (*FilterChain) ProtoMessage() {}
func (*FilterChain) Descriptor() ([]byte, []int) {
return fileDescriptor_30285372e511ffb4, []int{2}
}
func (m *FilterChain) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FilterChain.Unmarshal(m, b)
}
func (m *FilterChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FilterChain.Marshal(b, m, deterministic)
}
func (m *FilterChain) XXX_Merge(src proto.Message) {
xxx_messageInfo_FilterChain.Merge(m, src)
}
func (m *FilterChain) XXX_Size() int {
return xxx_messageInfo_FilterChain.Size(m)
}
func (m *FilterChain) XXX_DiscardUnknown() {
xxx_messageInfo_FilterChain.DiscardUnknown(m)
}
var xxx_messageInfo_FilterChain proto.InternalMessageInfo
func (m *FilterChain) GetFilterChainMatch() *FilterChainMatch {
if m != nil {
return m.FilterChainMatch
}
return nil
}
// Deprecated: Do not use.
func (m *FilterChain) GetTlsContext() *auth.DownstreamTlsContext {
if m != nil {
return m.TlsContext
}
return nil
}
func (m *FilterChain) GetFilters() []*Filter {
if m != nil {
return m.Filters
}
return nil
}
func (m *FilterChain) GetUseProxyProto() *wrappers.BoolValue {
if m != nil {
return m.UseProxyProto
}
return nil
}
func (m *FilterChain) GetMetadata() *core.Metadata {
if m != nil {
return m.Metadata
}
return nil
}
func (m *FilterChain) GetTransportSocket() *core.TransportSocket {
if m != nil {
return m.TransportSocket
}
return nil
}
func (m *FilterChain) GetName() string {
if m != nil {
return m.Name
}
return ""
}
type ListenerFilterChainMatchPredicate struct {
// Types that are valid to be assigned to Rule:
// *ListenerFilterChainMatchPredicate_OrMatch
// *ListenerFilterChainMatchPredicate_AndMatch
// *ListenerFilterChainMatchPredicate_NotMatch
// *ListenerFilterChainMatchPredicate_AnyMatch
// *ListenerFilterChainMatchPredicate_DestinationPortRange
Rule isListenerFilterChainMatchPredicate_Rule `protobuf_oneof:"rule"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListenerFilterChainMatchPredicate) Reset() { *m = ListenerFilterChainMatchPredicate{} }
func (m *ListenerFilterChainMatchPredicate) String() string { return proto.CompactTextString(m) }
func (*ListenerFilterChainMatchPredicate) ProtoMessage() {}
func (*ListenerFilterChainMatchPredicate) Descriptor() ([]byte, []int) {
return fileDescriptor_30285372e511ffb4, []int{3}
}
func (m *ListenerFilterChainMatchPredicate) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListenerFilterChainMatchPredicate.Unmarshal(m, b)
}
func (m *ListenerFilterChainMatchPredicate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListenerFilterChainMatchPredicate.Marshal(b, m, deterministic)
}
func (m *ListenerFilterChainMatchPredicate) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListenerFilterChainMatchPredicate.Merge(m, src)
}
func (m *ListenerFilterChainMatchPredicate) XXX_Size() int {
return xxx_messageInfo_ListenerFilterChainMatchPredicate.Size(m)
}
func (m *ListenerFilterChainMatchPredicate) XXX_DiscardUnknown() {
xxx_messageInfo_ListenerFilterChainMatchPredicate.DiscardUnknown(m)
}
var xxx_messageInfo_ListenerFilterChainMatchPredicate proto.InternalMessageInfo
type isListenerFilterChainMatchPredicate_Rule interface {
isListenerFilterChainMatchPredicate_Rule()
}
type ListenerFilterChainMatchPredicate_OrMatch struct {
OrMatch *ListenerFilterChainMatchPredicate_MatchSet `protobuf:"bytes,1,opt,name=or_match,json=orMatch,proto3,oneof"`
}
type ListenerFilterChainMatchPredicate_AndMatch struct {
AndMatch *ListenerFilterChainMatchPredicate_MatchSet `protobuf:"bytes,2,opt,name=and_match,json=andMatch,proto3,oneof"`
}
type ListenerFilterChainMatchPredicate_NotMatch struct {
NotMatch *ListenerFilterChainMatchPredicate `protobuf:"bytes,3,opt,name=not_match,json=notMatch,proto3,oneof"`
}
type ListenerFilterChainMatchPredicate_AnyMatch struct {
AnyMatch bool `protobuf:"varint,4,opt,name=any_match,json=anyMatch,proto3,oneof"`
}
type ListenerFilterChainMatchPredicate_DestinationPortRange struct {
DestinationPortRange *_type.Int32Range `protobuf:"bytes,5,opt,name=destination_port_range,json=destinationPortRange,proto3,oneof"`
}
func (*ListenerFilterChainMatchPredicate_OrMatch) isListenerFilterChainMatchPredicate_Rule() {}
func (*ListenerFilterChainMatchPredicate_AndMatch) isListenerFilterChainMatchPredicate_Rule() {}
func (*ListenerFilterChainMatchPredicate_NotMatch) isListenerFilterChainMatchPredicate_Rule() {}
func (*ListenerFilterChainMatchPredicate_AnyMatch) isListenerFilterChainMatchPredicate_Rule() {}
func (*ListenerFilterChainMatchPredicate_DestinationPortRange) isListenerFilterChainMatchPredicate_Rule() {
}
func (m *ListenerFilterChainMatchPredicate) GetRule() isListenerFilterChainMatchPredicate_Rule {
if m != nil {
return m.Rule
}
return nil
}
func (m *ListenerFilterChainMatchPredicate) GetOrMatch() *ListenerFilterChainMatchPredicate_MatchSet {
if x, ok := m.GetRule().(*ListenerFilterChainMatchPredicate_OrMatch); ok {
return x.OrMatch
}
return nil
}
func (m *ListenerFilterChainMatchPredicate) GetAndMatch() *ListenerFilterChainMatchPredicate_MatchSet {
if x, ok := m.GetRule().(*ListenerFilterChainMatchPredicate_AndMatch); ok {
return x.AndMatch
}
return nil
}
func (m *ListenerFilterChainMatchPredicate) GetNotMatch() *ListenerFilterChainMatchPredicate {
if x, ok := m.GetRule().(*ListenerFilterChainMatchPredicate_NotMatch); ok {
return x.NotMatch
}
return nil
}
func (m *ListenerFilterChainMatchPredicate) GetAnyMatch() bool {
if x, ok := m.GetRule().(*ListenerFilterChainMatchPredicate_AnyMatch); ok {
return x.AnyMatch
}
return false
}
func (m *ListenerFilterChainMatchPredicate) GetDestinationPortRange() *_type.Int32Range {
if x, ok := m.GetRule().(*ListenerFilterChainMatchPredicate_DestinationPortRange); ok {
return x.DestinationPortRange
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*ListenerFilterChainMatchPredicate) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*ListenerFilterChainMatchPredicate_OrMatch)(nil),
(*ListenerFilterChainMatchPredicate_AndMatch)(nil),
(*ListenerFilterChainMatchPredicate_NotMatch)(nil),
(*ListenerFilterChainMatchPredicate_AnyMatch)(nil),
(*ListenerFilterChainMatchPredicate_DestinationPortRange)(nil),
}
}
type ListenerFilterChainMatchPredicate_MatchSet struct {
Rules []*ListenerFilterChainMatchPredicate `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListenerFilterChainMatchPredicate_MatchSet) Reset() {
*m = ListenerFilterChainMatchPredicate_MatchSet{}
}
func (m *ListenerFilterChainMatchPredicate_MatchSet) String() string {
return proto.CompactTextString(m)
}
func (*ListenerFilterChainMatchPredicate_MatchSet) ProtoMessage() {}
func (*ListenerFilterChainMatchPredicate_MatchSet) Descriptor() ([]byte, []int) {
return fileDescriptor_30285372e511ffb4, []int{3, 0}
}
func (m *ListenerFilterChainMatchPredicate_MatchSet) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListenerFilterChainMatchPredicate_MatchSet.Unmarshal(m, b)
}
func (m *ListenerFilterChainMatchPredicate_MatchSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListenerFilterChainMatchPredicate_MatchSet.Marshal(b, m, deterministic)
}
func (m *ListenerFilterChainMatchPredicate_MatchSet) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListenerFilterChainMatchPredicate_MatchSet.Merge(m, src)
}
func (m *ListenerFilterChainMatchPredicate_MatchSet) XXX_Size() int {
return xxx_messageInfo_ListenerFilterChainMatchPredicate_MatchSet.Size(m)
}
func (m *ListenerFilterChainMatchPredicate_MatchSet) XXX_DiscardUnknown() {
xxx_messageInfo_ListenerFilterChainMatchPredicate_MatchSet.DiscardUnknown(m)
}
var xxx_messageInfo_ListenerFilterChainMatchPredicate_MatchSet proto.InternalMessageInfo
func (m *ListenerFilterChainMatchPredicate_MatchSet) GetRules() []*ListenerFilterChainMatchPredicate {
if m != nil {
return m.Rules
}
return nil
}
type ListenerFilter struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Types that are valid to be assigned to ConfigType:
// *ListenerFilter_Config
// *ListenerFilter_TypedConfig
ConfigType isListenerFilter_ConfigType `protobuf_oneof:"config_type"`
FilterDisabled *ListenerFilterChainMatchPredicate `protobuf:"bytes,4,opt,name=filter_disabled,json=filterDisabled,proto3" json:"filter_disabled,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListenerFilter) Reset() { *m = ListenerFilter{} }
func (m *ListenerFilter) String() string { return proto.CompactTextString(m) }
func (*ListenerFilter) ProtoMessage() {}
func (*ListenerFilter) Descriptor() ([]byte, []int) {
return fileDescriptor_30285372e511ffb4, []int{4}
}
func (m *ListenerFilter) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListenerFilter.Unmarshal(m, b)
}
func (m *ListenerFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListenerFilter.Marshal(b, m, deterministic)
}
func (m *ListenerFilter) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListenerFilter.Merge(m, src)
}
func (m *ListenerFilter) XXX_Size() int {
return xxx_messageInfo_ListenerFilter.Size(m)
}
func (m *ListenerFilter) XXX_DiscardUnknown() {
xxx_messageInfo_ListenerFilter.DiscardUnknown(m)
}
var xxx_messageInfo_ListenerFilter proto.InternalMessageInfo
func (m *ListenerFilter) GetName() string {
if m != nil {
return m.Name
}
return ""
}
type isListenerFilter_ConfigType interface {
isListenerFilter_ConfigType()
}
type ListenerFilter_Config struct {
Config *_struct.Struct `protobuf:"bytes,2,opt,name=config,proto3,oneof"`
}
type ListenerFilter_TypedConfig struct {
TypedConfig *any.Any `protobuf:"bytes,3,opt,name=typed_config,json=typedConfig,proto3,oneof"`
}
func (*ListenerFilter_Config) isListenerFilter_ConfigType() {}
func (*ListenerFilter_TypedConfig) isListenerFilter_ConfigType() {}
func (m *ListenerFilter) GetConfigType() isListenerFilter_ConfigType {
if m != nil {
return m.ConfigType
}
return nil
}
// Deprecated: Do not use.
func (m *ListenerFilter) GetConfig() *_struct.Struct {
if x, ok := m.GetConfigType().(*ListenerFilter_Config); ok {
return x.Config
}
return nil
}
func (m *ListenerFilter) GetTypedConfig() *any.Any {
if x, ok := m.GetConfigType().(*ListenerFilter_TypedConfig); ok {
return x.TypedConfig
}
return nil
}
func (m *ListenerFilter) GetFilterDisabled() *ListenerFilterChainMatchPredicate {
if m != nil {
return m.FilterDisabled
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*ListenerFilter) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*ListenerFilter_Config)(nil),
(*ListenerFilter_TypedConfig)(nil),
}
}
func init() {
proto.RegisterEnum("envoy.api.v2.listener.FilterChainMatch_ConnectionSourceType", FilterChainMatch_ConnectionSourceType_name, FilterChainMatch_ConnectionSourceType_value)
proto.RegisterType((*Filter)(nil), "envoy.api.v2.listener.Filter")
proto.RegisterType((*FilterChainMatch)(nil), "envoy.api.v2.listener.FilterChainMatch")
proto.RegisterType((*FilterChain)(nil), "envoy.api.v2.listener.FilterChain")
proto.RegisterType((*ListenerFilterChainMatchPredicate)(nil), "envoy.api.v2.listener.ListenerFilterChainMatchPredicate")
proto.RegisterType((*ListenerFilterChainMatchPredicate_MatchSet)(nil), "envoy.api.v2.listener.ListenerFilterChainMatchPredicate.MatchSet")
proto.RegisterType((*ListenerFilter)(nil), "envoy.api.v2.listener.ListenerFilter")
}
func init() {
proto.RegisterFile("envoy/api/v2/listener/listener_components.proto", fileDescriptor_30285372e511ffb4)
}
var fileDescriptor_30285372e511ffb4 = []byte{
// 1154 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xcf, 0xae, 0x1d, 0x67, 0x3d, 0xce, 0x9f, 0x65, 0x48, 0x9b, 0x25, 0xfd, 0x83, 0x6b, 0x44,
0x89, 0x90, 0xd8, 0x95, 0x1c, 0xa1, 0x82, 0xe0, 0xe2, 0x75, 0x83, 0xd2, 0xe2, 0x38, 0xd6, 0x3a,
0x2d, 0xe5, 0xc2, 0x32, 0xd9, 0x1d, 0xbb, 0x0b, 0xeb, 0x99, 0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 0x97, 0xca, 0x45, 0xb4, 0xbf, 0x14,
0x6c, 0x2e, 0xac, 0x7e, 0x29, 0xdf, 0x8e, 0x81, 0x55, 0x5c, 0x14, 0x3e, 0x00, 0xcb, 0x6c, 0x9c,
0x62, 0xee, 0x18, 0x92, 0xdb, 0x2f, 0x7d, 0x31, 0xb9, 0x5a, 0x1f, 0x1b, 0xa6, 0x65, 0x06, 0x0a,
0xd0, 0xaf, 0x81, 0x72, 0xfe, 0x01, 0x4b, 0x7f, 0xf9, 0x46, 0xe3, 0x5b, 0x13, 0xac, 0xcf, 0x63,
0xfc, 0x2f, 0x8f, 0x72, 0xe9, 0x85, 0x1f, 0x65, 0x88, 0xc0, 0x86, 0xde, 0x45, 0x71, 0xc2, 0xd1,
0x71, 0x8a, 0x63, 0x3d, 0xad, 0x2f, 0x5d, 0x92, 0x60, 0x5d, 0x01, 0xde, 0xd6, 0x78, 0x0b, 0xef,
0xbe, 0xff, 0xbd, 0x21, 0xf7, 0xe7, 0x36, 0x74, 0x54, 0x00, 0xa5, 0x7b, 0x1a, 0x60, 0xb2, 0xfb,
0xf3, 0x57, 0xbf, 0xfc, 0x56, 0x31, 0x6d, 0x03, 0xbc, 0x91, 0x50, 0x95, 0x85, 0x5c, 0x26, 0x17,
0x27, 0xe4, 0x6f, 0x15, 0x19, 0xb5, 0x67, 0xff, 0x91, 0x72, 0x89, 0xf4, 0x8c, 0x1f, 0xcd, 0xad,
0x3d, 0xe9, 0xd2, 0xca, 0x12, 0xf7, 0x7e, 0x73, 0x96, 0x7a, 0xb7, 0xff, 0xc7, 0x33, 0x35, 0xc7,
0x15, 0x59, 0xad, 0xdd, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x9d, 0xc1, 0x3d, 0xb6, 0x0a,
0x00, 0x00,
}

View File

@ -0,0 +1,742 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/listener/listener_components.proto
package envoy_api_v2_listener
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _listener_components_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on Filter with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Filter) Validate() error {
if m == nil {
return nil
}
if len(m.GetName()) < 1 {
return FilterValidationError{
field: "Name",
reason: "value length must be at least 1 bytes",
}
}
switch m.ConfigType.(type) {
case *Filter_Config:
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *Filter_TypedConfig:
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// FilterValidationError is the validation error returned by Filter.Validate if
// the designated constraints aren't met.
type FilterValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FilterValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FilterValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FilterValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FilterValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FilterValidationError) ErrorName() string { return "FilterValidationError" }
// Error satisfies the builtin error interface
func (e FilterValidationError) 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 %sFilter.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FilterValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FilterValidationError{}
// Validate checks the field values on FilterChainMatch with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *FilterChainMatch) Validate() error {
if m == nil {
return nil
}
if wrapper := m.GetDestinationPort(); wrapper != nil {
if val := wrapper.GetValue(); val < 1 || val > 65535 {
return FilterChainMatchValidationError{
field: "DestinationPort",
reason: "value must be inside range [1, 65535]",
}
}
}
for idx, item := range m.GetPrefixRanges() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainMatchValidationError{
field: fmt.Sprintf("PrefixRanges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
// no validation rules for AddressSuffix
if v, ok := interface{}(m.GetSuffixLen()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainMatchValidationError{
field: "SuffixLen",
reason: "embedded message failed validation",
cause: err,
}
}
}
if _, ok := FilterChainMatch_ConnectionSourceType_name[int32(m.GetSourceType())]; !ok {
return FilterChainMatchValidationError{
field: "SourceType",
reason: "value must be one of the defined enum values",
}
}
for idx, item := range m.GetSourcePrefixRanges() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainMatchValidationError{
field: fmt.Sprintf("SourcePrefixRanges[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
for idx, item := range m.GetSourcePorts() {
_, _ = idx, item
if val := item; val < 1 || val > 65535 {
return FilterChainMatchValidationError{
field: fmt.Sprintf("SourcePorts[%v]", idx),
reason: "value must be inside range [1, 65535]",
}
}
}
// no validation rules for TransportProtocol
return nil
}
// FilterChainMatchValidationError is the validation error returned by
// FilterChainMatch.Validate if the designated constraints aren't met.
type FilterChainMatchValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FilterChainMatchValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FilterChainMatchValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FilterChainMatchValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FilterChainMatchValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FilterChainMatchValidationError) ErrorName() string { return "FilterChainMatchValidationError" }
// Error satisfies the builtin error interface
func (e FilterChainMatchValidationError) 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 %sFilterChainMatch.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FilterChainMatchValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FilterChainMatchValidationError{}
// Validate checks the field values on FilterChain with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *FilterChain) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetFilterChainMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "FilterChainMatch",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetTlsContext()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "TlsContext",
reason: "embedded message failed validation",
cause: err,
}
}
}
for idx, item := range m.GetFilters() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: fmt.Sprintf("Filters[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if v, ok := interface{}(m.GetUseProxyProto()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "UseProxyProto",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "Metadata",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return FilterChainValidationError{
field: "TransportSocket",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for Name
return nil
}
// FilterChainValidationError is the validation error returned by
// FilterChain.Validate if the designated constraints aren't met.
type FilterChainValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e FilterChainValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e FilterChainValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e FilterChainValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e FilterChainValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e FilterChainValidationError) ErrorName() string { return "FilterChainValidationError" }
// Error satisfies the builtin error interface
func (e FilterChainValidationError) 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 %sFilterChain.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = FilterChainValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = FilterChainValidationError{}
// Validate checks the field values on ListenerFilterChainMatchPredicate with
// the rules defined in the proto definition for this message. If any rules
// are violated, an error is returned.
func (m *ListenerFilterChainMatchPredicate) Validate() error {
if m == nil {
return nil
}
switch m.Rule.(type) {
case *ListenerFilterChainMatchPredicate_OrMatch:
if v, ok := interface{}(m.GetOrMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterChainMatchPredicateValidationError{
field: "OrMatch",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *ListenerFilterChainMatchPredicate_AndMatch:
if v, ok := interface{}(m.GetAndMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterChainMatchPredicateValidationError{
field: "AndMatch",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *ListenerFilterChainMatchPredicate_NotMatch:
if v, ok := interface{}(m.GetNotMatch()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterChainMatchPredicateValidationError{
field: "NotMatch",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *ListenerFilterChainMatchPredicate_AnyMatch:
if m.GetAnyMatch() != true {
return ListenerFilterChainMatchPredicateValidationError{
field: "AnyMatch",
reason: "value must equal true",
}
}
case *ListenerFilterChainMatchPredicate_DestinationPortRange:
if v, ok := interface{}(m.GetDestinationPortRange()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterChainMatchPredicateValidationError{
field: "DestinationPortRange",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
return ListenerFilterChainMatchPredicateValidationError{
field: "Rule",
reason: "value is required",
}
}
return nil
}
// ListenerFilterChainMatchPredicateValidationError is the validation error
// returned by ListenerFilterChainMatchPredicate.Validate if the designated
// constraints aren't met.
type ListenerFilterChainMatchPredicateValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListenerFilterChainMatchPredicateValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListenerFilterChainMatchPredicateValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListenerFilterChainMatchPredicateValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListenerFilterChainMatchPredicateValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListenerFilterChainMatchPredicateValidationError) ErrorName() string {
return "ListenerFilterChainMatchPredicateValidationError"
}
// Error satisfies the builtin error interface
func (e ListenerFilterChainMatchPredicateValidationError) 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 %sListenerFilterChainMatchPredicate.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListenerFilterChainMatchPredicateValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListenerFilterChainMatchPredicateValidationError{}
// Validate checks the field values on ListenerFilter with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *ListenerFilter) Validate() error {
if m == nil {
return nil
}
if len(m.GetName()) < 1 {
return ListenerFilterValidationError{
field: "Name",
reason: "value length must be at least 1 bytes",
}
}
if v, ok := interface{}(m.GetFilterDisabled()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterValidationError{
field: "FilterDisabled",
reason: "embedded message failed validation",
cause: err,
}
}
}
switch m.ConfigType.(type) {
case *ListenerFilter_Config:
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *ListenerFilter_TypedConfig:
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// ListenerFilterValidationError is the validation error returned by
// ListenerFilter.Validate if the designated constraints aren't met.
type ListenerFilterValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListenerFilterValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListenerFilterValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListenerFilterValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListenerFilterValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListenerFilterValidationError) ErrorName() string { return "ListenerFilterValidationError" }
// Error satisfies the builtin error interface
func (e ListenerFilterValidationError) 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 %sListenerFilter.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListenerFilterValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListenerFilterValidationError{}
// Validate checks the field values on
// ListenerFilterChainMatchPredicate_MatchSet with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *ListenerFilterChainMatchPredicate_MatchSet) Validate() error {
if m == nil {
return nil
}
if len(m.GetRules()) < 2 {
return ListenerFilterChainMatchPredicate_MatchSetValidationError{
field: "Rules",
reason: "value must contain at least 2 item(s)",
}
}
for idx, item := range m.GetRules() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListenerFilterChainMatchPredicate_MatchSetValidationError{
field: fmt.Sprintf("Rules[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// ListenerFilterChainMatchPredicate_MatchSetValidationError is the validation
// error returned by ListenerFilterChainMatchPredicate_MatchSet.Validate if
// the designated constraints aren't met.
type ListenerFilterChainMatchPredicate_MatchSetValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListenerFilterChainMatchPredicate_MatchSetValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListenerFilterChainMatchPredicate_MatchSetValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListenerFilterChainMatchPredicate_MatchSetValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListenerFilterChainMatchPredicate_MatchSetValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListenerFilterChainMatchPredicate_MatchSetValidationError) ErrorName() string {
return "ListenerFilterChainMatchPredicate_MatchSetValidationError"
}
// Error satisfies the builtin error interface
func (e ListenerFilterChainMatchPredicate_MatchSetValidationError) 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 %sListenerFilterChainMatchPredicate_MatchSet.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListenerFilterChainMatchPredicate_MatchSetValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListenerFilterChainMatchPredicate_MatchSetValidationError{}

View File

@ -0,0 +1,115 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/listener/quic_config.proto
package envoy_api_v2_listener
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
proto "github.com/golang/protobuf/proto"
duration "github.com/golang/protobuf/ptypes/duration"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type QuicProtocolOptions struct {
MaxConcurrentStreams *wrappers.UInt32Value `protobuf:"bytes,1,opt,name=max_concurrent_streams,json=maxConcurrentStreams,proto3" json:"max_concurrent_streams,omitempty"`
IdleTimeout *duration.Duration `protobuf:"bytes,2,opt,name=idle_timeout,json=idleTimeout,proto3" json:"idle_timeout,omitempty"`
CryptoHandshakeTimeout *duration.Duration `protobuf:"bytes,3,opt,name=crypto_handshake_timeout,json=cryptoHandshakeTimeout,proto3" json:"crypto_handshake_timeout,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *QuicProtocolOptions) Reset() { *m = QuicProtocolOptions{} }
func (m *QuicProtocolOptions) String() string { return proto.CompactTextString(m) }
func (*QuicProtocolOptions) ProtoMessage() {}
func (*QuicProtocolOptions) Descriptor() ([]byte, []int) {
return fileDescriptor_1f6a4a402e708e40, []int{0}
}
func (m *QuicProtocolOptions) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QuicProtocolOptions.Unmarshal(m, b)
}
func (m *QuicProtocolOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QuicProtocolOptions.Marshal(b, m, deterministic)
}
func (m *QuicProtocolOptions) XXX_Merge(src proto.Message) {
xxx_messageInfo_QuicProtocolOptions.Merge(m, src)
}
func (m *QuicProtocolOptions) XXX_Size() int {
return xxx_messageInfo_QuicProtocolOptions.Size(m)
}
func (m *QuicProtocolOptions) XXX_DiscardUnknown() {
xxx_messageInfo_QuicProtocolOptions.DiscardUnknown(m)
}
var xxx_messageInfo_QuicProtocolOptions proto.InternalMessageInfo
func (m *QuicProtocolOptions) GetMaxConcurrentStreams() *wrappers.UInt32Value {
if m != nil {
return m.MaxConcurrentStreams
}
return nil
}
func (m *QuicProtocolOptions) GetIdleTimeout() *duration.Duration {
if m != nil {
return m.IdleTimeout
}
return nil
}
func (m *QuicProtocolOptions) GetCryptoHandshakeTimeout() *duration.Duration {
if m != nil {
return m.CryptoHandshakeTimeout
}
return nil
}
func init() {
proto.RegisterType((*QuicProtocolOptions)(nil), "envoy.api.v2.listener.QuicProtocolOptions")
}
func init() {
proto.RegisterFile("envoy/api/v2/listener/quic_config.proto", fileDescriptor_1f6a4a402e708e40)
}
var fileDescriptor_1f6a4a402e708e40 = []byte{
// 369 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xb1, 0x4e, 0xeb, 0x30,
0x14, 0x86, 0x95, 0x5e, 0xdd, 0x0e, 0xe9, 0x95, 0xee, 0x55, 0x2e, 0x94, 0x50, 0x01, 0x42, 0x30,
0xc0, 0x64, 0x4b, 0xe9, 0xca, 0x42, 0x0b, 0x12, 0x48, 0x08, 0x4a, 0x0b, 0x5d, 0xa3, 0xd3, 0xc4,
0x4d, 0x2d, 0x12, 0xdb, 0x38, 0x76, 0x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, 0xae, 0x95, 0x5b, 0x33, 0x4d, 0xcb, 0x73, 0x4d, 0x7b, 0xe5, 0x06, 0xfa, 0x8d, 0x1c,
0x3f, 0x2b, 0x68, 0x67, 0x60, 0xbb, 0x81, 0x9c, 0x09, 0xc5, 0xfd, 0x09, 0xb0, 0x30, 0x9d, 0xc0,
0xc5, 0x67, 0xd3, 0xaf, 0x9f, 0x9a, 0x9a, 0x85, 0x7a, 0x50, 0x99, 0x65, 0x69, 0xe7, 0xd6, 0x7a,
0xb9, 0x7b, 0xbb, 0xf9, 0xdd, 0x72, 0xdc, 0xe2, 0x3a, 0xe5, 0xc5, 0xaa, 0xeb, 0xa0, 0xac, 0xfd,
0x70, 0xfd, 0xf8, 0x54, 0xaf, 0xfd, 0xb3, 0xec, 0x4d, 0xca, 0x91, 0x81, 0x84, 0xe4, 0xd3, 0x19,
0xfa, 0xf2, 0x9a, 0x9d, 0xbf, 0xf9, 0x2e, 0xbb, 0xa6, 0xc4, 0x6c, 0xb4, 0x67, 0xdd, 0xd7, 0x96,
0xf6, 0x0d, 0xba, 0x2b, 0x28, 0x1a, 0x7a, 0xe8, 0xa8, 0x44, 0x8f, 0x07, 0xcf, 0xdf, 0x26, 0xa3,
0xba, 0x99, 0xa0, 0xfd, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x12, 0xf9, 0x6d, 0x9e, 0x5d, 0x02, 0x00,
0x00,
}

View File

@ -0,0 +1,134 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/listener/quic_config.proto
package envoy_api_v2_listener
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _quic_config_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on QuicProtocolOptions with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *QuicProtocolOptions) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetMaxConcurrentStreams()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return QuicProtocolOptionsValidationError{
field: "MaxConcurrentStreams",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetIdleTimeout()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return QuicProtocolOptionsValidationError{
field: "IdleTimeout",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetCryptoHandshakeTimeout()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return QuicProtocolOptionsValidationError{
field: "CryptoHandshakeTimeout",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// QuicProtocolOptionsValidationError is the validation error returned by
// QuicProtocolOptions.Validate if the designated constraints aren't met.
type QuicProtocolOptionsValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e QuicProtocolOptionsValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e QuicProtocolOptionsValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e QuicProtocolOptionsValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e QuicProtocolOptionsValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e QuicProtocolOptionsValidationError) ErrorName() string {
return "QuicProtocolOptionsValidationError"
}
// Error satisfies the builtin error interface
func (e QuicProtocolOptionsValidationError) 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 %sQuicProtocolOptions.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = QuicProtocolOptionsValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = QuicProtocolOptionsValidationError{}

View File

@ -0,0 +1,180 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/listener/udp_listener_config.proto
package envoy_api_v2_listener
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
proto "github.com/golang/protobuf/proto"
any "github.com/golang/protobuf/ptypes/any"
_struct "github.com/golang/protobuf/ptypes/struct"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type UdpListenerConfig struct {
UdpListenerName string `protobuf:"bytes,1,opt,name=udp_listener_name,json=udpListenerName,proto3" json:"udp_listener_name,omitempty"`
// Types that are valid to be assigned to ConfigType:
// *UdpListenerConfig_Config
// *UdpListenerConfig_TypedConfig
ConfigType isUdpListenerConfig_ConfigType `protobuf_oneof:"config_type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UdpListenerConfig) Reset() { *m = UdpListenerConfig{} }
func (m *UdpListenerConfig) String() string { return proto.CompactTextString(m) }
func (*UdpListenerConfig) ProtoMessage() {}
func (*UdpListenerConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_04a0b1c45e39fc83, []int{0}
}
func (m *UdpListenerConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UdpListenerConfig.Unmarshal(m, b)
}
func (m *UdpListenerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UdpListenerConfig.Marshal(b, m, deterministic)
}
func (m *UdpListenerConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_UdpListenerConfig.Merge(m, src)
}
func (m *UdpListenerConfig) XXX_Size() int {
return xxx_messageInfo_UdpListenerConfig.Size(m)
}
func (m *UdpListenerConfig) XXX_DiscardUnknown() {
xxx_messageInfo_UdpListenerConfig.DiscardUnknown(m)
}
var xxx_messageInfo_UdpListenerConfig proto.InternalMessageInfo
func (m *UdpListenerConfig) GetUdpListenerName() string {
if m != nil {
return m.UdpListenerName
}
return ""
}
type isUdpListenerConfig_ConfigType interface {
isUdpListenerConfig_ConfigType()
}
type UdpListenerConfig_Config struct {
Config *_struct.Struct `protobuf:"bytes,2,opt,name=config,proto3,oneof"`
}
type UdpListenerConfig_TypedConfig struct {
TypedConfig *any.Any `protobuf:"bytes,3,opt,name=typed_config,json=typedConfig,proto3,oneof"`
}
func (*UdpListenerConfig_Config) isUdpListenerConfig_ConfigType() {}
func (*UdpListenerConfig_TypedConfig) isUdpListenerConfig_ConfigType() {}
func (m *UdpListenerConfig) GetConfigType() isUdpListenerConfig_ConfigType {
if m != nil {
return m.ConfigType
}
return nil
}
// Deprecated: Do not use.
func (m *UdpListenerConfig) GetConfig() *_struct.Struct {
if x, ok := m.GetConfigType().(*UdpListenerConfig_Config); ok {
return x.Config
}
return nil
}
func (m *UdpListenerConfig) GetTypedConfig() *any.Any {
if x, ok := m.GetConfigType().(*UdpListenerConfig_TypedConfig); ok {
return x.TypedConfig
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*UdpListenerConfig) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*UdpListenerConfig_Config)(nil),
(*UdpListenerConfig_TypedConfig)(nil),
}
}
type ActiveRawUdpListenerConfig struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ActiveRawUdpListenerConfig) Reset() { *m = ActiveRawUdpListenerConfig{} }
func (m *ActiveRawUdpListenerConfig) String() string { return proto.CompactTextString(m) }
func (*ActiveRawUdpListenerConfig) ProtoMessage() {}
func (*ActiveRawUdpListenerConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_04a0b1c45e39fc83, []int{1}
}
func (m *ActiveRawUdpListenerConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ActiveRawUdpListenerConfig.Unmarshal(m, b)
}
func (m *ActiveRawUdpListenerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ActiveRawUdpListenerConfig.Marshal(b, m, deterministic)
}
func (m *ActiveRawUdpListenerConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_ActiveRawUdpListenerConfig.Merge(m, src)
}
func (m *ActiveRawUdpListenerConfig) XXX_Size() int {
return xxx_messageInfo_ActiveRawUdpListenerConfig.Size(m)
}
func (m *ActiveRawUdpListenerConfig) XXX_DiscardUnknown() {
xxx_messageInfo_ActiveRawUdpListenerConfig.DiscardUnknown(m)
}
var xxx_messageInfo_ActiveRawUdpListenerConfig proto.InternalMessageInfo
func init() {
proto.RegisterType((*UdpListenerConfig)(nil), "envoy.api.v2.listener.UdpListenerConfig")
proto.RegisterType((*ActiveRawUdpListenerConfig)(nil), "envoy.api.v2.listener.ActiveRawUdpListenerConfig")
}
func init() {
proto.RegisterFile("envoy/api/v2/listener/udp_listener_config.proto", fileDescriptor_04a0b1c45e39fc83)
}
var fileDescriptor_04a0b1c45e39fc83 = []byte{
// 356 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4a, 0xeb, 0x40,
0x18, 0x85, 0x3b, 0xb9, 0xdc, 0xc2, 0x9d, 0x5e, 0xd1, 0x06, 0xb5, 0x31, 0x54, 0x29, 0x75, 0x53,
0x5c, 0xcc, 0x40, 0x8a, 0x0b, 0x97, 0x8d, 0x08, 0x5d, 0x88, 0x94, 0x14, 0xd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, 0x0b, 0x0a, 0xb3, 0x7d, 0x04, 0xff, 0xab, 0x5c, 0xd2, 0xb0,
0x58, 0xc7, 0xf9, 0xa3, 0xc3, 0x9b, 0x95, 0xf0, 0x80, 0xe7, 0xc3, 0x5a, 0xd0, 0xd0, 0x5e, 0x43,
0xe7, 0xaf, 0xc1, 0x86, 0x09, 0x4d, 0x56, 0x7f, 0xbb, 0x6d, 0xe8, 0x0e, 0x66, 0x8a, 0x65, 0x34,
0x20, 0x97, 0x95, 0x2a, 0xfe, 0x1d, 0x78, 0xbd, 0x7d, 0xbb, 0xf9, 0xeb, 0xda, 0x8e, 0x19, 0xbe,
0x38, 0x46, 0x59, 0x0d, 0x65, 0xfd, 0x87, 0xeb, 0xa7, 0xe7, 0xba, 0xb5, 0x01, 0xe0, 0x3e, 0x13,
0x48, 0x9b, 0x64, 0x2c, 0xae, 0x72, 0xf4, 0xe3, 0xa1, 0xfc, 0xed, 0xca, 0x13, 0xa3, 0x15, 0xea,
0x08, 0xdc, 0x5b, 0xad, 0x13, 0x9d, 0x18, 0x48, 0x86, 0x2e, 0x3c, 0xf4, 0x31, 0xd2, 0xf8, 0xe5,
0x57, 0x65, 0x5a, 0xd7, 0x3d, 0xfb, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x44, 0x9f, 0x13,
0x47, 0x02, 0x00, 0x00,
}

View File

@ -0,0 +1,201 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/listener/udp_listener_config.proto
package envoy_api_v2_listener
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _udp_listener_config_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on UdpListenerConfig with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *UdpListenerConfig) Validate() error {
if m == nil {
return nil
}
// no validation rules for UdpListenerName
switch m.ConfigType.(type) {
case *UdpListenerConfig_Config:
if v, ok := interface{}(m.GetConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UdpListenerConfigValidationError{
field: "Config",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *UdpListenerConfig_TypedConfig:
if v, ok := interface{}(m.GetTypedConfig()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return UdpListenerConfigValidationError{
field: "TypedConfig",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// UdpListenerConfigValidationError is the validation error returned by
// UdpListenerConfig.Validate if the designated constraints aren't met.
type UdpListenerConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e UdpListenerConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e UdpListenerConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e UdpListenerConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e UdpListenerConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e UdpListenerConfigValidationError) ErrorName() string {
return "UdpListenerConfigValidationError"
}
// Error satisfies the builtin error interface
func (e UdpListenerConfigValidationError) 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 %sUdpListenerConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = UdpListenerConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = UdpListenerConfigValidationError{}
// Validate checks the field values on ActiveRawUdpListenerConfig with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ActiveRawUdpListenerConfig) Validate() error {
if m == nil {
return nil
}
return nil
}
// ActiveRawUdpListenerConfigValidationError is the validation error returned
// by ActiveRawUdpListenerConfig.Validate if the designated constraints aren't met.
type ActiveRawUdpListenerConfigValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ActiveRawUdpListenerConfigValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ActiveRawUdpListenerConfigValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ActiveRawUdpListenerConfigValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ActiveRawUdpListenerConfigValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ActiveRawUdpListenerConfigValidationError) ErrorName() string {
return "ActiveRawUdpListenerConfigValidationError"
}
// Error satisfies the builtin error interface
func (e ActiveRawUdpListenerConfigValidationError) 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 %sActiveRawUdpListenerConfig.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ActiveRawUdpListenerConfigValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ActiveRawUdpListenerConfigValidationError{}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/rds.proto
package v2
package envoy_api_v2
import (
"bytes"
@ -15,7 +15,7 @@ import (
"time"
"unicode/utf8"
"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes"
)
// ensure the imports are used
@ -30,129 +30,25 @@ var (
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = types.DynamicAny{}
_ = ptypes.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 {
// define the regex for a UUID once up-front
var _rds_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on RdsDummy with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *RdsDummy) Validate() error {
if m == nil {
return nil
}
// no validation rules for Name
for idx, item := range m.GetVirtualHosts() {
_, _ = idx, item
{
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 {
if err := v.Validate(); err != nil {
return RouteConfigurationValidationError{
field: "Vhds",
reason: "embedded message failed validation",
cause: err,
}
}
}
}
if len(m.GetResponseHeadersToAdd()) > 1000 {
return RouteConfigurationValidationError{
field: "ResponseHeadersToAdd",
reason: "value must contain no more than 1000 item(s)",
}
}
for idx, item := range m.GetResponseHeadersToAdd() {
_, _ = idx, item
{
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,
}
}
}
}
}
if len(m.GetRequestHeadersToAdd()) > 1000 {
return RouteConfigurationValidationError{
field: "RequestHeadersToAdd",
reason: "value must contain no more than 1000 item(s)",
}
}
for idx, item := range m.GetRequestHeadersToAdd() {
_, _ = idx, item
{
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,
}
}
}
}
}
{
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,
}
}
}
}
return nil
}
// RouteConfigurationValidationError is the validation error returned by
// RouteConfiguration.Validate if the designated constraints aren't met.
type RouteConfigurationValidationError struct {
// RdsDummyValidationError is the validation error returned by
// RdsDummy.Validate if the designated constraints aren't met.
type RdsDummyValidationError struct {
field string
reason string
cause error
@ -160,24 +56,22 @@ type RouteConfigurationValidationError struct {
}
// Field function returns field value.
func (e RouteConfigurationValidationError) Field() string { return e.field }
func (e RdsDummyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RouteConfigurationValidationError) Reason() string { return e.reason }
func (e RdsDummyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RouteConfigurationValidationError) Cause() error { return e.cause }
func (e RdsDummyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RouteConfigurationValidationError) Key() bool { return e.key }
func (e RdsDummyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RouteConfigurationValidationError) ErrorName() string {
return "RouteConfigurationValidationError"
}
func (e RdsDummyValidationError) ErrorName() string { return "RdsDummyValidationError" }
// Error satisfies the builtin error interface
func (e RouteConfigurationValidationError) Error() string {
func (e RdsDummyValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
@ -189,14 +83,14 @@ func (e RouteConfigurationValidationError) Error() string {
}
return fmt.Sprintf(
"invalid %sRouteConfiguration.%s: %s%s",
"invalid %sRdsDummy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RouteConfigurationValidationError{}
var _ error = RdsDummyValidationError{}
var _ interface {
Field() string
@ -204,83 +98,4 @@ var _ interface {
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{}
} = RdsDummyValidationError{}

View File

@ -0,0 +1,226 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/route.proto
package envoy_api_v2
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
route "github.com/envoyproxy/go-control-plane/envoy/api/v2/route"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type RouteConfiguration struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
VirtualHosts []*route.VirtualHost `protobuf:"bytes,2,rep,name=virtual_hosts,json=virtualHosts,proto3" json:"virtual_hosts,omitempty"`
Vhds *Vhds `protobuf:"bytes,9,opt,name=vhds,proto3" json:"vhds,omitempty"`
InternalOnlyHeaders []string `protobuf:"bytes,3,rep,name=internal_only_headers,json=internalOnlyHeaders,proto3" json:"internal_only_headers,omitempty"`
ResponseHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,4,rep,name=response_headers_to_add,json=responseHeadersToAdd,proto3" json:"response_headers_to_add,omitempty"`
ResponseHeadersToRemove []string `protobuf:"bytes,5,rep,name=response_headers_to_remove,json=responseHeadersToRemove,proto3" json:"response_headers_to_remove,omitempty"`
RequestHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,6,rep,name=request_headers_to_add,json=requestHeadersToAdd,proto3" json:"request_headers_to_add,omitempty"`
RequestHeadersToRemove []string `protobuf:"bytes,8,rep,name=request_headers_to_remove,json=requestHeadersToRemove,proto3" json:"request_headers_to_remove,omitempty"`
MostSpecificHeaderMutationsWins bool `protobuf:"varint,10,opt,name=most_specific_header_mutations_wins,json=mostSpecificHeaderMutationsWins,proto3" json:"most_specific_header_mutations_wins,omitempty"`
ValidateClusters *wrappers.BoolValue `protobuf:"bytes,7,opt,name=validate_clusters,json=validateClusters,proto3" json:"validate_clusters,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RouteConfiguration) Reset() { *m = RouteConfiguration{} }
func (m *RouteConfiguration) String() string { return proto.CompactTextString(m) }
func (*RouteConfiguration) ProtoMessage() {}
func (*RouteConfiguration) Descriptor() ([]byte, []int) {
return fileDescriptor_1f33b4742f398551, []int{0}
}
func (m *RouteConfiguration) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RouteConfiguration.Unmarshal(m, b)
}
func (m *RouteConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RouteConfiguration.Marshal(b, m, deterministic)
}
func (m *RouteConfiguration) XXX_Merge(src proto.Message) {
xxx_messageInfo_RouteConfiguration.Merge(m, src)
}
func (m *RouteConfiguration) XXX_Size() int {
return xxx_messageInfo_RouteConfiguration.Size(m)
}
func (m *RouteConfiguration) XXX_DiscardUnknown() {
xxx_messageInfo_RouteConfiguration.DiscardUnknown(m)
}
var xxx_messageInfo_RouteConfiguration proto.InternalMessageInfo
func (m *RouteConfiguration) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *RouteConfiguration) GetVirtualHosts() []*route.VirtualHost {
if m != nil {
return m.VirtualHosts
}
return nil
}
func (m *RouteConfiguration) GetVhds() *Vhds {
if m != nil {
return m.Vhds
}
return nil
}
func (m *RouteConfiguration) GetInternalOnlyHeaders() []string {
if m != nil {
return m.InternalOnlyHeaders
}
return nil
}
func (m *RouteConfiguration) GetResponseHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.ResponseHeadersToAdd
}
return nil
}
func (m *RouteConfiguration) GetResponseHeadersToRemove() []string {
if m != nil {
return m.ResponseHeadersToRemove
}
return nil
}
func (m *RouteConfiguration) GetRequestHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.RequestHeadersToAdd
}
return nil
}
func (m *RouteConfiguration) GetRequestHeadersToRemove() []string {
if m != nil {
return m.RequestHeadersToRemove
}
return nil
}
func (m *RouteConfiguration) GetMostSpecificHeaderMutationsWins() bool {
if m != nil {
return m.MostSpecificHeaderMutationsWins
}
return false
}
func (m *RouteConfiguration) GetValidateClusters() *wrappers.BoolValue {
if m != nil {
return m.ValidateClusters
}
return nil
}
type Vhds struct {
ConfigSource *core.ConfigSource `protobuf:"bytes,1,opt,name=config_source,json=configSource,proto3" json:"config_source,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Vhds) Reset() { *m = Vhds{} }
func (m *Vhds) String() string { return proto.CompactTextString(m) }
func (*Vhds) ProtoMessage() {}
func (*Vhds) Descriptor() ([]byte, []int) {
return fileDescriptor_1f33b4742f398551, []int{1}
}
func (m *Vhds) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Vhds.Unmarshal(m, b)
}
func (m *Vhds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Vhds.Marshal(b, m, deterministic)
}
func (m *Vhds) XXX_Merge(src proto.Message) {
xxx_messageInfo_Vhds.Merge(m, src)
}
func (m *Vhds) XXX_Size() int {
return xxx_messageInfo_Vhds.Size(m)
}
func (m *Vhds) XXX_DiscardUnknown() {
xxx_messageInfo_Vhds.DiscardUnknown(m)
}
var xxx_messageInfo_Vhds proto.InternalMessageInfo
func (m *Vhds) GetConfigSource() *core.ConfigSource {
if m != nil {
return m.ConfigSource
}
return nil
}
func init() {
proto.RegisterType((*RouteConfiguration)(nil), "envoy.api.v2.RouteConfiguration")
proto.RegisterType((*Vhds)(nil), "envoy.api.v2.Vhds")
}
func init() { proto.RegisterFile("envoy/api/v2/route.proto", fileDescriptor_1f33b4742f398551) }
var fileDescriptor_1f33b4742f398551 = []byte{
// 610 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xbf, 0x6f, 0xd3, 0x40,
0x14, 0xe6, 0x9a, 0x1f, 0x4d, 0xae, 0xad, 0x14, 0xae, 0xb4, 0x31, 0x11, 0xd0, 0xa8, 0xfc, 0x50,
0x58, 0x6c, 0x29, 0xfd, 0x0b, 0x70, 0x2b, 0x51, 0x09, 0x4a, 0x2b, 0x17, 0x85, 0xd1, 0xba, 0xda,
0x97, 0xe4, 0x24, 0xe7, 0x9e, 0x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, 0x00,
}

View File

@ -0,0 +1,310 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/route.proto
package envoy_api_v2
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _route_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// 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
if v, ok := interface{}(item).(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,
}
}
}
}
if v, ok := interface{}(m.GetVhds()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RouteConfigurationValidationError{
field: "Vhds",
reason: "embedded message failed validation",
cause: err,
}
}
}
for idx, item := range m.GetInternalOnlyHeaders() {
_, _ = idx, item
if !_RouteConfiguration_InternalOnlyHeaders_Pattern.MatchString(item) {
return RouteConfigurationValidationError{
field: fmt.Sprintf("InternalOnlyHeaders[%v]", idx),
reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
}
}
}
if len(m.GetResponseHeadersToAdd()) > 1000 {
return RouteConfigurationValidationError{
field: "ResponseHeadersToAdd",
reason: "value must contain no more than 1000 item(s)",
}
}
for idx, item := range m.GetResponseHeadersToAdd() {
_, _ = idx, item
if v, ok := interface{}(item).(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,
}
}
}
}
for idx, item := range m.GetResponseHeadersToRemove() {
_, _ = idx, item
if !_RouteConfiguration_ResponseHeadersToRemove_Pattern.MatchString(item) {
return RouteConfigurationValidationError{
field: fmt.Sprintf("ResponseHeadersToRemove[%v]", idx),
reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
}
}
}
if len(m.GetRequestHeadersToAdd()) > 1000 {
return RouteConfigurationValidationError{
field: "RequestHeadersToAdd",
reason: "value must contain no more than 1000 item(s)",
}
}
for idx, item := range m.GetRequestHeadersToAdd() {
_, _ = idx, item
if v, ok := interface{}(item).(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,
}
}
}
}
for idx, item := range m.GetRequestHeadersToRemove() {
_, _ = idx, item
if !_RouteConfiguration_RequestHeadersToRemove_Pattern.MatchString(item) {
return RouteConfigurationValidationError{
field: fmt.Sprintf("RequestHeadersToRemove[%v]", idx),
reason: "value does not match regex pattern \"^[^\\x00\\n\\r]*$\"",
}
}
}
// no validation rules for MostSpecificHeaderMutationsWins
if v, ok := interface{}(m.GetValidateClusters()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RouteConfigurationValidationError{
field: "ValidateClusters",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// RouteConfigurationValidationError is the validation error returned by
// RouteConfiguration.Validate if the designated constraints aren't met.
type RouteConfigurationValidationError struct {
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"
}
// Error satisfies the builtin error interface
func (e RouteConfigurationValidationError) 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 %sRouteConfiguration.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RouteConfigurationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RouteConfigurationValidationError{}
var _RouteConfiguration_InternalOnlyHeaders_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
var _RouteConfiguration_ResponseHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
var _RouteConfiguration_RequestHeadersToRemove_Pattern = regexp.MustCompile("^[^\x00\n\r]*$")
// 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
}
if m.GetConfigSource() == nil {
return VhdsValidationError{
field: "ConfigSource",
reason: "value is required",
}
}
if v, ok := interface{}(m.GetConfigSource()).(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{}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,219 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/scoped_route.proto
package envoy_api_v2
import (
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type ScopedRouteConfiguration struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
RouteConfigurationName string `protobuf:"bytes,2,opt,name=route_configuration_name,json=routeConfigurationName,proto3" json:"route_configuration_name,omitempty"`
Key *ScopedRouteConfiguration_Key `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ScopedRouteConfiguration) Reset() { *m = ScopedRouteConfiguration{} }
func (m *ScopedRouteConfiguration) String() string { return proto.CompactTextString(m) }
func (*ScopedRouteConfiguration) ProtoMessage() {}
func (*ScopedRouteConfiguration) Descriptor() ([]byte, []int) {
return fileDescriptor_e1eeeae73441b687, []int{0}
}
func (m *ScopedRouteConfiguration) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ScopedRouteConfiguration.Unmarshal(m, b)
}
func (m *ScopedRouteConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ScopedRouteConfiguration.Marshal(b, m, deterministic)
}
func (m *ScopedRouteConfiguration) XXX_Merge(src proto.Message) {
xxx_messageInfo_ScopedRouteConfiguration.Merge(m, src)
}
func (m *ScopedRouteConfiguration) XXX_Size() int {
return xxx_messageInfo_ScopedRouteConfiguration.Size(m)
}
func (m *ScopedRouteConfiguration) XXX_DiscardUnknown() {
xxx_messageInfo_ScopedRouteConfiguration.DiscardUnknown(m)
}
var xxx_messageInfo_ScopedRouteConfiguration proto.InternalMessageInfo
func (m *ScopedRouteConfiguration) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ScopedRouteConfiguration) GetRouteConfigurationName() string {
if m != nil {
return m.RouteConfigurationName
}
return ""
}
func (m *ScopedRouteConfiguration) GetKey() *ScopedRouteConfiguration_Key {
if m != nil {
return m.Key
}
return nil
}
type ScopedRouteConfiguration_Key struct {
Fragments []*ScopedRouteConfiguration_Key_Fragment `protobuf:"bytes,1,rep,name=fragments,proto3" json:"fragments,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ScopedRouteConfiguration_Key) Reset() { *m = ScopedRouteConfiguration_Key{} }
func (m *ScopedRouteConfiguration_Key) String() string { return proto.CompactTextString(m) }
func (*ScopedRouteConfiguration_Key) ProtoMessage() {}
func (*ScopedRouteConfiguration_Key) Descriptor() ([]byte, []int) {
return fileDescriptor_e1eeeae73441b687, []int{0, 0}
}
func (m *ScopedRouteConfiguration_Key) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ScopedRouteConfiguration_Key.Unmarshal(m, b)
}
func (m *ScopedRouteConfiguration_Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ScopedRouteConfiguration_Key.Marshal(b, m, deterministic)
}
func (m *ScopedRouteConfiguration_Key) XXX_Merge(src proto.Message) {
xxx_messageInfo_ScopedRouteConfiguration_Key.Merge(m, src)
}
func (m *ScopedRouteConfiguration_Key) XXX_Size() int {
return xxx_messageInfo_ScopedRouteConfiguration_Key.Size(m)
}
func (m *ScopedRouteConfiguration_Key) XXX_DiscardUnknown() {
xxx_messageInfo_ScopedRouteConfiguration_Key.DiscardUnknown(m)
}
var xxx_messageInfo_ScopedRouteConfiguration_Key proto.InternalMessageInfo
func (m *ScopedRouteConfiguration_Key) GetFragments() []*ScopedRouteConfiguration_Key_Fragment {
if m != nil {
return m.Fragments
}
return nil
}
type ScopedRouteConfiguration_Key_Fragment struct {
// Types that are valid to be assigned to Type:
// *ScopedRouteConfiguration_Key_Fragment_StringKey
Type isScopedRouteConfiguration_Key_Fragment_Type `protobuf_oneof:"type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ScopedRouteConfiguration_Key_Fragment) Reset() { *m = ScopedRouteConfiguration_Key_Fragment{} }
func (m *ScopedRouteConfiguration_Key_Fragment) String() string { return proto.CompactTextString(m) }
func (*ScopedRouteConfiguration_Key_Fragment) ProtoMessage() {}
func (*ScopedRouteConfiguration_Key_Fragment) Descriptor() ([]byte, []int) {
return fileDescriptor_e1eeeae73441b687, []int{0, 0, 0}
}
func (m *ScopedRouteConfiguration_Key_Fragment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ScopedRouteConfiguration_Key_Fragment.Unmarshal(m, b)
}
func (m *ScopedRouteConfiguration_Key_Fragment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ScopedRouteConfiguration_Key_Fragment.Marshal(b, m, deterministic)
}
func (m *ScopedRouteConfiguration_Key_Fragment) XXX_Merge(src proto.Message) {
xxx_messageInfo_ScopedRouteConfiguration_Key_Fragment.Merge(m, src)
}
func (m *ScopedRouteConfiguration_Key_Fragment) XXX_Size() int {
return xxx_messageInfo_ScopedRouteConfiguration_Key_Fragment.Size(m)
}
func (m *ScopedRouteConfiguration_Key_Fragment) XXX_DiscardUnknown() {
xxx_messageInfo_ScopedRouteConfiguration_Key_Fragment.DiscardUnknown(m)
}
var xxx_messageInfo_ScopedRouteConfiguration_Key_Fragment proto.InternalMessageInfo
type isScopedRouteConfiguration_Key_Fragment_Type interface {
isScopedRouteConfiguration_Key_Fragment_Type()
}
type ScopedRouteConfiguration_Key_Fragment_StringKey struct {
StringKey string `protobuf:"bytes,1,opt,name=string_key,json=stringKey,proto3,oneof"`
}
func (*ScopedRouteConfiguration_Key_Fragment_StringKey) isScopedRouteConfiguration_Key_Fragment_Type() {
}
func (m *ScopedRouteConfiguration_Key_Fragment) GetType() isScopedRouteConfiguration_Key_Fragment_Type {
if m != nil {
return m.Type
}
return nil
}
func (m *ScopedRouteConfiguration_Key_Fragment) GetStringKey() string {
if x, ok := m.GetType().(*ScopedRouteConfiguration_Key_Fragment_StringKey); ok {
return x.StringKey
}
return ""
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*ScopedRouteConfiguration_Key_Fragment) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*ScopedRouteConfiguration_Key_Fragment_StringKey)(nil),
}
}
func init() {
proto.RegisterType((*ScopedRouteConfiguration)(nil), "envoy.api.v2.ScopedRouteConfiguration")
proto.RegisterType((*ScopedRouteConfiguration_Key)(nil), "envoy.api.v2.ScopedRouteConfiguration.Key")
proto.RegisterType((*ScopedRouteConfiguration_Key_Fragment)(nil), "envoy.api.v2.ScopedRouteConfiguration.Key.Fragment")
}
func init() { proto.RegisterFile("envoy/api/v2/scoped_route.proto", fileDescriptor_e1eeeae73441b687) }
var fileDescriptor_e1eeeae73441b687 = []byte{
// 372 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,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@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/scoped_route.proto
package envoy_api_v2
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _scoped_route_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on ScopedRouteConfiguration with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ScopedRouteConfiguration) Validate() error {
if m == nil {
return nil
}
if len(m.GetName()) < 1 {
return ScopedRouteConfigurationValidationError{
field: "Name",
reason: "value length must be at least 1 bytes",
}
}
if len(m.GetRouteConfigurationName()) < 1 {
return ScopedRouteConfigurationValidationError{
field: "RouteConfigurationName",
reason: "value length must be at least 1 bytes",
}
}
if m.GetKey() == nil {
return ScopedRouteConfigurationValidationError{
field: "Key",
reason: "value is required",
}
}
if v, ok := interface{}(m.GetKey()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ScopedRouteConfigurationValidationError{
field: "Key",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// ScopedRouteConfigurationValidationError is the validation error returned by
// ScopedRouteConfiguration.Validate if the designated constraints aren't met.
type ScopedRouteConfigurationValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ScopedRouteConfigurationValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ScopedRouteConfigurationValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ScopedRouteConfigurationValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ScopedRouteConfigurationValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ScopedRouteConfigurationValidationError) ErrorName() string {
return "ScopedRouteConfigurationValidationError"
}
// Error satisfies the builtin error interface
func (e ScopedRouteConfigurationValidationError) 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 %sScopedRouteConfiguration.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ScopedRouteConfigurationValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ScopedRouteConfigurationValidationError{}
// Validate checks the field values on ScopedRouteConfiguration_Key with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ScopedRouteConfiguration_Key) Validate() error {
if m == nil {
return nil
}
if len(m.GetFragments()) < 1 {
return ScopedRouteConfiguration_KeyValidationError{
field: "Fragments",
reason: "value must contain at least 1 item(s)",
}
}
for idx, item := range m.GetFragments() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ScopedRouteConfiguration_KeyValidationError{
field: fmt.Sprintf("Fragments[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// ScopedRouteConfiguration_KeyValidationError is the validation error returned
// by ScopedRouteConfiguration_Key.Validate if the designated constraints
// aren't met.
type ScopedRouteConfiguration_KeyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ScopedRouteConfiguration_KeyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ScopedRouteConfiguration_KeyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ScopedRouteConfiguration_KeyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ScopedRouteConfiguration_KeyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ScopedRouteConfiguration_KeyValidationError) ErrorName() string {
return "ScopedRouteConfiguration_KeyValidationError"
}
// Error satisfies the builtin error interface
func (e ScopedRouteConfiguration_KeyValidationError) 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 %sScopedRouteConfiguration_Key.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ScopedRouteConfiguration_KeyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ScopedRouteConfiguration_KeyValidationError{}
// Validate checks the field values on ScopedRouteConfiguration_Key_Fragment
// with the rules defined in the proto definition for this message. If any
// rules are violated, an error is returned.
func (m *ScopedRouteConfiguration_Key_Fragment) Validate() error {
if m == nil {
return nil
}
switch m.Type.(type) {
case *ScopedRouteConfiguration_Key_Fragment_StringKey:
// no validation rules for StringKey
default:
return ScopedRouteConfiguration_Key_FragmentValidationError{
field: "Type",
reason: "value is required",
}
}
return nil
}
// ScopedRouteConfiguration_Key_FragmentValidationError is the validation error
// returned by ScopedRouteConfiguration_Key_Fragment.Validate if the
// designated constraints aren't met.
type ScopedRouteConfiguration_Key_FragmentValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ScopedRouteConfiguration_Key_FragmentValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ScopedRouteConfiguration_Key_FragmentValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ScopedRouteConfiguration_Key_FragmentValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ScopedRouteConfiguration_Key_FragmentValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ScopedRouteConfiguration_Key_FragmentValidationError) ErrorName() string {
return "ScopedRouteConfiguration_Key_FragmentValidationError"
}
// Error satisfies the builtin error interface
func (e ScopedRouteConfiguration_Key_FragmentValidationError) 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 %sScopedRouteConfiguration_Key_Fragment.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ScopedRouteConfiguration_Key_FragmentValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ScopedRouteConfiguration_Key_FragmentValidationError{}

View File

@ -0,0 +1,310 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/api/v2/srds.proto
package envoy_api_v2
import (
context "context"
fmt "fmt"
_ "github.com/cncf/udpa/go/udpa/annotations"
_ "github.com/envoyproxy/go-control-plane/envoy/annotations"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type SrdsDummy struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SrdsDummy) Reset() { *m = SrdsDummy{} }
func (m *SrdsDummy) String() string { return proto.CompactTextString(m) }
func (*SrdsDummy) ProtoMessage() {}
func (*SrdsDummy) Descriptor() ([]byte, []int) {
return fileDescriptor_92f394721ede65e9, []int{0}
}
func (m *SrdsDummy) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SrdsDummy.Unmarshal(m, b)
}
func (m *SrdsDummy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SrdsDummy.Marshal(b, m, deterministic)
}
func (m *SrdsDummy) XXX_Merge(src proto.Message) {
xxx_messageInfo_SrdsDummy.Merge(m, src)
}
func (m *SrdsDummy) XXX_Size() int {
return xxx_messageInfo_SrdsDummy.Size(m)
}
func (m *SrdsDummy) XXX_DiscardUnknown() {
xxx_messageInfo_SrdsDummy.DiscardUnknown(m)
}
var xxx_messageInfo_SrdsDummy proto.InternalMessageInfo
func init() {
proto.RegisterType((*SrdsDummy)(nil), "envoy.api.v2.SrdsDummy")
}
func init() { proto.RegisterFile("envoy/api/v2/srds.proto", fileDescriptor_92f394721ede65e9) }
var fileDescriptor_92f394721ede65e9 = []byte{
// 380 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xbd, 0x4e, 0xe3, 0x40,
0x14, 0x85, 0x77, 0x12, 0x25, 0xab, 0x9d, 0xdd, 0x62, 0xe3, 0x62, 0x17, 0x99, 0xfc, 0xa0, 0x00,
0x02, 0x21, 0x62, 0xa3, 0xa4, 0x4b, 0x19, 0x22, 0xea, 0x28, 0x2e, 0x29, 0xd0, 0x60, 0x0f, 0x66,
0xa4, 0xd8, 0xd7, 0xcc, 0x8c, 0x2d, 0xdc, 0xa1, 0x54, 0x88, 0x86, 0x02, 0x81, 0x78, 0x00, 0x9e,
0x82, 0x27, 0xa0, 0x45, 0xbc, 0x02, 0x4f, 0x00, 0x3d, 0x42, 0x19, 0xc7, 0x90, 0x21, 0x82, 0x8a,
0xfa, 0x7c, 0xe7, 0xfe, 0x9d, 0x8b, 0xff, 0xd3, 0x30, 0x81, 0xd4, 0x26, 0x11, 0xb3, 0x93, 0xb6,
0x2d, 0xb8, 0x27, 0xac, 0x88, 0x83, 0x04, 0xe3, 0x8f, 0x12, 0x2c, 0x12, 0x31, 0x2b, 0x69, 0x9b,
0x55, 0x0d, 0xf3, 0x98, 0x70, 0x21, 0xa1, 0x3c, 0xcd, 0x58, 0xb3, 0xea, 0x03, 0xf8, 0x23, 0xaa,
0x64, 0x12, 0x86, 0x20, 0x89, 0x64, 0x10, 0x4e, 0x2b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xd2, 0x82, 0xf1, 0x2f, 0xc3, 0x45, 0x96, 0x86, 0x95, 0xe5, 0x98, 0x74, 0x6e, 0x4f, 0xee, 0xee,
0xcb, 0x85, 0xbf, 0x08, 0x9b, 0x0c, 0xb2, 0x39, 0x23, 0x0e, 0xc7, 0xa9, 0x36, 0x72, 0x4f, 0xc5,
0x3c, 0x98, 0x64, 0x3e, 0x40, 0xa7, 0x08, 0x0d, 0x4a, 0xfb, 0x65, 0xf5, 0x01, 0x9d, 0xd7, 0x00,
0x00, 0x00, 0xff, 0xff, 0xad, 0x06, 0xf9, 0x5a, 0xe8, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// ScopedRoutesDiscoveryServiceClient is the client API for ScopedRoutesDiscoveryService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ScopedRoutesDiscoveryServiceClient interface {
StreamScopedRoutes(ctx context.Context, opts ...grpc.CallOption) (ScopedRoutesDiscoveryService_StreamScopedRoutesClient, error)
DeltaScopedRoutes(ctx context.Context, opts ...grpc.CallOption) (ScopedRoutesDiscoveryService_DeltaScopedRoutesClient, error)
FetchScopedRoutes(ctx context.Context, in *DiscoveryRequest, opts ...grpc.CallOption) (*DiscoveryResponse, error)
}
type scopedRoutesDiscoveryServiceClient struct {
cc *grpc.ClientConn
}
func NewScopedRoutesDiscoveryServiceClient(cc *grpc.ClientConn) ScopedRoutesDiscoveryServiceClient {
return &scopedRoutesDiscoveryServiceClient{cc}
}
func (c *scopedRoutesDiscoveryServiceClient) StreamScopedRoutes(ctx context.Context, opts ...grpc.CallOption) (ScopedRoutesDiscoveryService_StreamScopedRoutesClient, error) {
stream, err := c.cc.NewStream(ctx, &_ScopedRoutesDiscoveryService_serviceDesc.Streams[0], "/envoy.api.v2.ScopedRoutesDiscoveryService/StreamScopedRoutes", opts...)
if err != nil {
return nil, err
}
x := &scopedRoutesDiscoveryServiceStreamScopedRoutesClient{stream}
return x, nil
}
type ScopedRoutesDiscoveryService_StreamScopedRoutesClient interface {
Send(*DiscoveryRequest) error
Recv() (*DiscoveryResponse, error)
grpc.ClientStream
}
type scopedRoutesDiscoveryServiceStreamScopedRoutesClient struct {
grpc.ClientStream
}
func (x *scopedRoutesDiscoveryServiceStreamScopedRoutesClient) Send(m *DiscoveryRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *scopedRoutesDiscoveryServiceStreamScopedRoutesClient) Recv() (*DiscoveryResponse, error) {
m := new(DiscoveryResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *scopedRoutesDiscoveryServiceClient) DeltaScopedRoutes(ctx context.Context, opts ...grpc.CallOption) (ScopedRoutesDiscoveryService_DeltaScopedRoutesClient, error) {
stream, err := c.cc.NewStream(ctx, &_ScopedRoutesDiscoveryService_serviceDesc.Streams[1], "/envoy.api.v2.ScopedRoutesDiscoveryService/DeltaScopedRoutes", opts...)
if err != nil {
return nil, err
}
x := &scopedRoutesDiscoveryServiceDeltaScopedRoutesClient{stream}
return x, nil
}
type ScopedRoutesDiscoveryService_DeltaScopedRoutesClient interface {
Send(*DeltaDiscoveryRequest) error
Recv() (*DeltaDiscoveryResponse, error)
grpc.ClientStream
}
type scopedRoutesDiscoveryServiceDeltaScopedRoutesClient struct {
grpc.ClientStream
}
func (x *scopedRoutesDiscoveryServiceDeltaScopedRoutesClient) Send(m *DeltaDiscoveryRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *scopedRoutesDiscoveryServiceDeltaScopedRoutesClient) Recv() (*DeltaDiscoveryResponse, error) {
m := new(DeltaDiscoveryResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *scopedRoutesDiscoveryServiceClient) FetchScopedRoutes(ctx context.Context, in *DiscoveryRequest, opts ...grpc.CallOption) (*DiscoveryResponse, error) {
out := new(DiscoveryResponse)
err := c.cc.Invoke(ctx, "/envoy.api.v2.ScopedRoutesDiscoveryService/FetchScopedRoutes", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ScopedRoutesDiscoveryServiceServer is the server API for ScopedRoutesDiscoveryService service.
type ScopedRoutesDiscoveryServiceServer interface {
StreamScopedRoutes(ScopedRoutesDiscoveryService_StreamScopedRoutesServer) error
DeltaScopedRoutes(ScopedRoutesDiscoveryService_DeltaScopedRoutesServer) error
FetchScopedRoutes(context.Context, *DiscoveryRequest) (*DiscoveryResponse, error)
}
// UnimplementedScopedRoutesDiscoveryServiceServer can be embedded to have forward compatible implementations.
type UnimplementedScopedRoutesDiscoveryServiceServer struct {
}
func (*UnimplementedScopedRoutesDiscoveryServiceServer) StreamScopedRoutes(srv ScopedRoutesDiscoveryService_StreamScopedRoutesServer) error {
return status.Errorf(codes.Unimplemented, "method StreamScopedRoutes not implemented")
}
func (*UnimplementedScopedRoutesDiscoveryServiceServer) DeltaScopedRoutes(srv ScopedRoutesDiscoveryService_DeltaScopedRoutesServer) error {
return status.Errorf(codes.Unimplemented, "method DeltaScopedRoutes not implemented")
}
func (*UnimplementedScopedRoutesDiscoveryServiceServer) FetchScopedRoutes(ctx context.Context, req *DiscoveryRequest) (*DiscoveryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FetchScopedRoutes not implemented")
}
func RegisterScopedRoutesDiscoveryServiceServer(s *grpc.Server, srv ScopedRoutesDiscoveryServiceServer) {
s.RegisterService(&_ScopedRoutesDiscoveryService_serviceDesc, srv)
}
func _ScopedRoutesDiscoveryService_StreamScopedRoutes_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ScopedRoutesDiscoveryServiceServer).StreamScopedRoutes(&scopedRoutesDiscoveryServiceStreamScopedRoutesServer{stream})
}
type ScopedRoutesDiscoveryService_StreamScopedRoutesServer interface {
Send(*DiscoveryResponse) error
Recv() (*DiscoveryRequest, error)
grpc.ServerStream
}
type scopedRoutesDiscoveryServiceStreamScopedRoutesServer struct {
grpc.ServerStream
}
func (x *scopedRoutesDiscoveryServiceStreamScopedRoutesServer) Send(m *DiscoveryResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *scopedRoutesDiscoveryServiceStreamScopedRoutesServer) Recv() (*DiscoveryRequest, error) {
m := new(DiscoveryRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _ScopedRoutesDiscoveryService_DeltaScopedRoutes_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ScopedRoutesDiscoveryServiceServer).DeltaScopedRoutes(&scopedRoutesDiscoveryServiceDeltaScopedRoutesServer{stream})
}
type ScopedRoutesDiscoveryService_DeltaScopedRoutesServer interface {
Send(*DeltaDiscoveryResponse) error
Recv() (*DeltaDiscoveryRequest, error)
grpc.ServerStream
}
type scopedRoutesDiscoveryServiceDeltaScopedRoutesServer struct {
grpc.ServerStream
}
func (x *scopedRoutesDiscoveryServiceDeltaScopedRoutesServer) Send(m *DeltaDiscoveryResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *scopedRoutesDiscoveryServiceDeltaScopedRoutesServer) Recv() (*DeltaDiscoveryRequest, error) {
m := new(DeltaDiscoveryRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _ScopedRoutesDiscoveryService_FetchScopedRoutes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DiscoveryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ScopedRoutesDiscoveryServiceServer).FetchScopedRoutes(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/envoy.api.v2.ScopedRoutesDiscoveryService/FetchScopedRoutes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ScopedRoutesDiscoveryServiceServer).FetchScopedRoutes(ctx, req.(*DiscoveryRequest))
}
return interceptor(ctx, in, info, handler)
}
var _ScopedRoutesDiscoveryService_serviceDesc = grpc.ServiceDesc{
ServiceName: "envoy.api.v2.ScopedRoutesDiscoveryService",
HandlerType: (*ScopedRoutesDiscoveryServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "FetchScopedRoutes",
Handler: _ScopedRoutesDiscoveryService_FetchScopedRoutes_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "StreamScopedRoutes",
Handler: _ScopedRoutesDiscoveryService_StreamScopedRoutes_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "DeltaScopedRoutes",
Handler: _ScopedRoutesDiscoveryService_DeltaScopedRoutes_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "envoy/api/v2/srds.proto",
}

View File

@ -0,0 +1,101 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: envoy/api/v2/srds.proto
package envoy_api_v2
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/golang/protobuf/ptypes"
)
// 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)
_ = ptypes.DynamicAny{}
)
// define the regex for a UUID once up-front
var _srds_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
// Validate checks the field values on SrdsDummy with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *SrdsDummy) Validate() error {
if m == nil {
return nil
}
return nil
}
// SrdsDummyValidationError is the validation error returned by
// SrdsDummy.Validate if the designated constraints aren't met.
type SrdsDummyValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SrdsDummyValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SrdsDummyValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SrdsDummyValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SrdsDummyValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SrdsDummyValidationError) ErrorName() string { return "SrdsDummyValidationError" }
// Error satisfies the builtin error interface
func (e SrdsDummyValidationError) 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 %sSrdsDummy.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SrdsDummyValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SrdsDummyValidationError{}

Some files were not shown because too many files have changed in this diff Show More