route

package
v0.0.0-...-35e2b90 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderMethod    = ":method"
	HeaderAuthority = ":authority"
	HeaderScheme    = ":scheme"
)

Headers with special meaning in Envoy

View Source
const (
	// DefaultRoute is the default decorator
	DefaultRoute = "default-route"
)

Variables

This section is empty.

Functions

func BuildDefaultHTTPRoute

func BuildDefaultHTTPRoute(clusterName string) *route.Route

BuildDefaultHTTPRoute builds a default route.

func TranslateRoutes

func TranslateRoutes(
	in model.Config, nameF ClusterNameGenerator, port int, proxyLabels model.LabelsCollection, gatewayNames map[string]bool) ([]route.Route, error)

TranslateRoutes creates virtual host routes from the v1alpha3 config. The rule should be adapted to destination names (outbound clusters). Each rule is guarded by source labels.

Types

type ClusterNameGenerator

type ClusterNameGenerator func(*networking.Destination) string

ClusterNameGenerator specifies cluster name for a destination

func ConvertDestinationToCluster

func ConvertDestinationToCluster(serviceIndex map[string]*model.Service, defaultPort int) ClusterNameGenerator

ConvertDestinationToCluster produces a cluster naming function using the config context. defaultPort is the service port. This function returns an error if the service cannot be resolved by defaultPort

type GuardedHost

type GuardedHost struct {
	// Port is the capture port (e.g. service port)
	Port int

	// Services are the services matching the virtual host.
	// The service host names need to be contextualized by the source.
	Services []*model.Service

	// Hosts is a list of alternative literal host names for the host.
	Hosts []string

	// Routes in the virtual host
	Routes []route.Route
}

GuardedHost is a context-dependent virtual host entry with guarded routes.

func TranslateVirtualHosts

func TranslateVirtualHosts(
	serviceConfigs []model.Config, services map[string]*model.Service, proxyLabels model.LabelsCollection, gatewayNames map[string]bool) []GuardedHost

TranslateVirtualHosts creates the entire routing table for Istio v1alpha3 configs. Services are indexed by FQDN hostnames. Cluster domain is used to resolve short service names (e.g. "svc.cluster.local").

Jump to

Keyboard shortcuts

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