Documentation ¶
Overview ¶
Package envoy contains a configuration writer for v2 YAML config. To avoid a dependncy on a YAML library, we generate the YAML using the text/template package.
Index ¶
- func Cluster(s dag.Service) *v2.Cluster
- func ClusterCommonLBConfig() *v2.Cluster_CommonLbConfig
- func Clustername(service *dag.TCPService) string
- func ConfigSource(cluster string) *core.ConfigSource
- func DownstreamTLSContext(cert, key []byte, tlsMinProtoVersion auth.TlsParameters_TlsProtocol, ...) *auth.DownstreamTlsContext
- func HTTPConnectionManager(routename, accessLogPath string) listener.Filter
- func LBEndpoint(addr string, port int) endpoint.LbEndpoint
- func PrefixMatch(prefix string) route.RouteMatch
- func RouteRoute(r *dag.Route, services []*dag.HTTPService) *route.Route_Route
- func SocketAddress(address string, port int) core.Address
- func TCPProxy(statPrefix string, proxy *dag.TCPProxy, accessLogPath string) listener.Filter
- func TLSInspector() listener.ListenerFilter
- func UpgradeHTTPS() *route.Route_Redirect
- func UpstreamTLSContext() *auth.UpstreamTlsContext
- func VirtualHost(hostname string, port int) route.VirtualHost
- type ConfigWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterCommonLBConfig ¶ added in v0.8.0
func ClusterCommonLBConfig() *v2.Cluster_CommonLbConfig
func Clustername ¶ added in v0.7.0
func Clustername(service *dag.TCPService) string
Clustername returns the name of the CDS cluster for this service.
func ConfigSource ¶ added in v0.7.0
func ConfigSource(cluster string) *core.ConfigSource
ConfigSource returns a *core.ConfigSource for cluster.
func DownstreamTLSContext ¶ added in v0.7.0
func DownstreamTLSContext(cert, key []byte, tlsMinProtoVersion auth.TlsParameters_TlsProtocol, alpnProtos ...string) *auth.DownstreamTlsContext
DownstreamTLSContext creates a new DownstreamTlsContext.
func HTTPConnectionManager ¶ added in v0.7.0
HTTPConnectionManager creates a new HTTP Connection Manager filter for the supplied route and access log.
func LBEndpoint ¶ added in v0.7.0
func LBEndpoint(addr string, port int) endpoint.LbEndpoint
LBEndpoint creates a new SocketAddress LbEndpoint..
func PrefixMatch ¶ added in v0.7.0
func PrefixMatch(prefix string) route.RouteMatch
PrefixMatch creates a RouteMatch for the supplied prefix.
func RouteRoute ¶ added in v0.7.0
func RouteRoute(r *dag.Route, services []*dag.HTTPService) *route.Route_Route
RouteRoute creates a route.Route_Route for the services supplied. If len(services) is greater than one, the route's action will be a weighted cluster.
func SocketAddress ¶ added in v0.7.0
SocketAddress creates a new TCP core.Address.
func TLSInspector ¶ added in v0.7.0
func TLSInspector() listener.ListenerFilter
TLSInspector returns a new TLS inspector listener filter.
func UpgradeHTTPS ¶ added in v0.7.0
func UpgradeHTTPS() *route.Route_Redirect
UpgradeHTTPS returns a route Action that redirects the request to HTTPS.
func UpstreamTLSContext ¶ added in v0.7.0
func UpstreamTLSContext() *auth.UpstreamTlsContext
UpstreamTLSContext creates an ALPN h2 enabled TLS Context.
func VirtualHost ¶
func VirtualHost(hostname string, port int) route.VirtualHost
VirtualHost creates a new route.VirtualHost.
Types ¶
type ConfigWriter ¶
type ConfigWriter struct { // AdminAccessLogPath is the path to write the access log for the administration server. // Defaults to /dev/null. AdminAccessLogPath string // AdminAddress is the TCP address that the administration server will listen on. // Defaults to 127.0.0.1. AdminAddress string // AdminPort is the port that the administration server will listen on. // Defaults to 9001. AdminPort int // StatsAddress is the address that the /stats path will listen on. // Defaults to 0.0.0.0 and is only enabled if StatsdEnabled is true. StatsAddress string // StatsPort is the port that the /stats path will listen on. // Defaults to 8002 and is only enabled if StatsdEnabled is true. StatsPort int // XDSAddress is the TCP address of the XDS management server. For JSON configurations // this is the address of the v1 REST API server. For YAML configurations this is the // address of the v2 gRPC management server. // Defaults to 127.0.0.1. XDSAddress string // XDSRESTPort is the management server port that provides the v1 REST API. // Defaults to 8000. XDSRESTPort int // XDSGRPCPort is the management server port that provides the v2 gRPC API. // Defaults to 8001. XDSGRPCPort int // StatsdEnabled enables metrics output via statsd // Defaults to false. StatsdEnabled bool // StatsdAddress is the UDP address of the statsd endpoint // Defaults to 127.0.0.1. StatsdAddress string // StatsdPort is port of the statsd endpoint // Defaults to 9125. StatsdPort int }
A ConfigWriter knows how to write a bootstap Envoy configuration in YAML format.