v2

package
v1.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendHeader

func AppendHeader(key, value string) *envoy_api_v2_core.HeaderValueOption

func CORSPolicy

CORSPolicy returns a *v2.CORSPolicy

func CORSVirtualHost

func CORSVirtualHost(hostname string, corspolicy *envoy_api_v2_route.CorsPolicy, routes ...*envoy_api_v2_route.Route) *envoy_api_v2_route.VirtualHost

CORSVirtualHost creates a new route.VirtualHost with a CORS policy.

func Cluster

func Cluster(c *dag.Cluster) *v2.Cluster

Cluster creates new v2.Cluster from dag.Cluster.

func ClusterCommonLBConfig

func ClusterCommonLBConfig() *v2.Cluster_CommonLbConfig

ClusterCommonLBConfig creates a *v2.Cluster_CommonLbConfig with HealthyPanicThreshold disabled.

func ClusterDiscoveryType

func ClusterDiscoveryType(t v2.Cluster_DiscoveryType) *v2.Cluster_Type

ClusterDiscoveryType returns the type of a ClusterDiscovery as a Cluster_type.

func ClusterLoadAssignment

func ClusterLoadAssignment(name string, addrs ...*envoy_api_v2_core.Address) *v2.ClusterLoadAssignment

ClusterLoadAssignment returns a *v2.ClusterLoadAssignment with a single LocalityLbEndpoints of the supplied addresses.

func ConfigSource

func ConfigSource(cluster string) *envoy_api_v2_core.ConfigSource

ConfigSource returns a *envoy_api_v2_core.ConfigSource for cluster.

func ContainsFallbackFilterChain

func ContainsFallbackFilterChain(filterchains []*envoy_api_v2_listener.FilterChain) bool

func DownstreamTLSContext

func DownstreamTLSContext(serverSecret *dag.Secret, tlsMinProtoVersion envoy_api_v2_auth.TlsParameters_TlsProtocol, peerValidationContext *dag.PeerValidationContext, alpnProtos ...string) *envoy_api_v2_auth.DownstreamTlsContext

DownstreamTLSContext creates a new DownstreamTlsContext.

func DownstreamTLSTransportSocket

func DownstreamTLSTransportSocket(tls *envoy_api_v2_auth.DownstreamTlsContext) *envoy_api_v2_core.TransportSocket

DownstreamTLSTransportSocket returns a custom transport socket using the DownstreamTlsContext provided.

func Endpoints

Endpoints returns a slice of LocalityLbEndpoints. The slice contains one entry, with one LbEndpoint per *envoy_api_v2_core.Address supplied.

func ExtensionCluster

func ExtensionCluster(ext *dag.ExtensionCluster) *v2.Cluster

ExtensionCluster builds a v2.Cluster struct for the given extension service.

func FileAccessLogEnvoy

func FileAccessLogEnvoy(path string) []*accesslog.AccessLog

FileAccessLogEnvoy returns a new file based access log filter that will output Envoy's default access logs.

func FileAccessLogJSON

func FileAccessLogJSON(path string, fields config.AccessLogFields) []*accesslog.AccessLog

FileAccessLogJSON returns a new file based access log filter that will log in JSON format

func FilterChain

FilterChain retruns a *envoy_api_v2_listener.FilterChain for the supplied filters.

func FilterChainTLS

FilterChainTLS returns a TLS enabled envoy_api_v2_listener.FilterChain.

func FilterChainTLSFallback

FilterChainTLSFallback returns a TLS enabled envoy_api_v2_listener.FilterChain conifgured for FallbackCertificate.

func FilterChains

FilterChains returns a []*envoy_api_v2_listener.FilterChain for the supplied filters.

func FilterExternalAuthz

func FilterExternalAuthz(authzClusterName string, failOpen bool, timeout timeout.Setting) *http.HttpFilter

FilterExternalAuthz returns an `ext_authz` filter configured with the requested parameters.

func FilterMisdirectedRequests

func FilterMisdirectedRequests(fqdn string) *http.HttpFilter

func Filters

Filters returns a []*envoy_api_v2_listener.Filter for the supplied filters.

func HTTPConnectionManager

func HTTPConnectionManager(routename string, accesslogger []*accesslog.AccessLog, requestTimeout time.Duration) *envoy_api_v2_listener.Filter

HTTPConnectionManager creates a new HTTP Connection Manager filter for the supplied route, access log, and client request timeout.

func HTTPConnectionManagerBuilder

func HTTPConnectionManagerBuilder() *httpConnectionManagerBuilder

func HeaderValueList

func HeaderValueList(hvm map[string]string, app bool) []*envoy_api_v2_core.HeaderValueOption

HeaderValueList creates a list of Envoy HeaderValueOptions from the provided map.

func LBEndpoint

LBEndpoint creates a new LbEndpoint.

func Listener

func Listener(name, address string, port int, lf []*envoy_api_v2_listener.ListenerFilter, filters ...*envoy_api_v2_listener.Filter) *v2.Listener

Listener returns a new v2.Listener for the supplied address, port, and filters.

func ListenerFilters

ListenerFilters returns a []*envoy_api_v2_listener.ListenerFilter for the supplied listener filters.

func ProtoNamesForVersions

func ProtoNamesForVersions(versions ...HTTPVersionType) []string

ProtoNamesForVersions returns the slice of ALPN protocol names for the give HTTP versions.

func ProxyProtocol

func ProxyProtocol() *envoy_api_v2_listener.ListenerFilter

ProxyProtocol returns a new Proxy Protocol listener filter.

func RouteAuthzContext

func RouteAuthzContext(settings map[string]string) *any.Any

RouteAuthzContext returns a per-route config to pass the given context entries in the check request.

func RouteAuthzDisabled

func RouteAuthzDisabled() *any.Any

RouteAuthzDisabled returns a per-route config to disable authorization.

func RouteConfiguration

func RouteConfiguration(name string, virtualhosts ...*envoy_api_v2_route.VirtualHost) *v2.RouteConfiguration

RouteConfiguration returns a *v2.RouteConfiguration.

func RouteMatch

func RouteMatch(route *dag.Route) *envoy_api_v2_route.RouteMatch

RouteMatch creates a *envoy_api_v2_route.RouteMatch for the supplied *dag.Route.

func RouteRoute

func RouteRoute(r *dag.Route) *envoy_api_v2_route.Route_Route

RouteRoute creates a *envoy_api_v2_route.Route_Route for the services supplied. If len(services) is greater than one, the route's action will be a weighted cluster.

func SafeRegexMatch added in v1.10.0

func SafeRegexMatch(regex string) *matcher.RegexMatcher

SafeRegexMatch returns a matcher.RegexMatcher for the supplied regex. SafeRegexMatch does not escape regex meta characters.

func Secret

func Secret(s *dag.Secret) *envoy_api_v2_auth.Secret

Secret creates new envoy_api_v2_auth.Secret from secret.

func SocketAddress

func SocketAddress(address string, port int) *envoy_api_v2_core.Address

SocketAddress creates a new TCP envoy_api_v2_core.Address.

func StaticClusterLoadAssignment

func StaticClusterLoadAssignment(service *dag.Service) *v2.ClusterLoadAssignment

StaticClusterLoadAssignment creates a *v2.ClusterLoadAssignment pointing to the external DNS address of the service

func StatsListener

func StatsListener(address string, port int) *v2.Listener

StatsListener returns a *v2.Listener configured to serve prometheus metrics on /stats.

func TCPKeepaliveSocketOptions

func TCPKeepaliveSocketOptions() []*envoy_api_v2_core.SocketOption

func TCPProxy

func TCPProxy(statPrefix string, proxy *dag.TCPProxy, accesslogger []*accesslog.AccessLog) *envoy_api_v2_listener.Filter

TCPProxy creates a new TCPProxy filter.

func TLSInspector

func TLSInspector() *envoy_api_v2_listener.ListenerFilter

TLSInspector returns a new TLS inspector listener filter.

func UpgradeHTTPS

func UpgradeHTTPS() *envoy_api_v2_route.Route_Redirect

UpgradeHTTPS returns a route Action that redirects the request to HTTPS.

func UpstreamTLSContext

func UpstreamTLSContext(peerValidationContext *dag.PeerValidationContext, sni string, clientSecret *dag.Secret, alpnProtocols ...string) *envoy_api_v2_auth.UpstreamTlsContext

UpstreamTLSContext creates an envoy_api_v2_auth.UpstreamTlsContext. By default UpstreamTLSContext returns a HTTP/1.1 TLS enabled context. A list of additional ALPN protocols can be provided.

func UpstreamTLSTransportSocket

UpstreamTLSTransportSocket returns a custom transport socket using the UpstreamTlsContext provided.

func VirtualHost

func VirtualHost(hostname string, routes ...*envoy_api_v2_route.Route) *envoy_api_v2_route.VirtualHost

VirtualHost creates a new route.VirtualHost.

func WriteBootstrap

func WriteBootstrap(c *envoy.BootstrapConfig) error

WriteBootstrap writes bootstrap configuration to files.

Types

type HTTPVersionType

type HTTPVersionType = http.HttpConnectionManager_CodecType

func CodecForVersions

func CodecForVersions(versions ...HTTPVersionType) HTTPVersionType

CodecForVersions determines a single Envoy HTTP codec constant that support all the given HTTP protocol versions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL