resource

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package resource creates test xDS resources

Index

Constants

View Source
const (

	// XdsCluster is the cluster name for the control server (used by non-ADS set-up).
	XdsCluster = "xds_cluster"

	// AlsCluster is the clustername for gRPC access log service (ALS)
	AlsCluster = "als_cluster"

	// Ads mode for resources: one aggregated xDS service
	Ads = "ads"

	// Xds mode for resources: individual xDS services.
	Xds = "xds"

	// Rest mode for resources: polling using Fetch.
	Rest = "rest"

	// Delta mode for resources: individual delta xDS services.
	Delta = "delta"

	// Delta Ads mode for resource: one aggregated delta xDS service.
	DeltaAds = "delta-ads"
)

Variables

View Source
var (
	// RefreshDelay for the polling config source.
	RefreshDelay = 500 * time.Millisecond
)

Functions

func MakeCluster

func MakeCluster(mode string, clusterName string) *cluster.Cluster

MakeCluster creates a cluster using either ADS or EDS.

func MakeEndpoint

func MakeEndpoint(clusterName string, port uint32) *endpoint.ClusterLoadAssignment

MakeEndpoint creates a localhost endpoint on a given port.

func MakeExtensionConfig

func MakeExtensionConfig(mode string, extensionConfigName string, route string) *core.TypedExtensionConfig

MakeExtensionConfig creates a extension config for a cluster.

func MakeRoute

func MakeRoute(routeName, clusterName string) *route.RouteConfiguration

MakeRoute creates an HTTP route that routes to a given cluster.

func MakeRouteHTTPListener

func MakeRouteHTTPListener(mode string, listenerName string, port uint32, route string) *listener.Listener

func MakeRuntime

func MakeRuntime(runtimeName string) *runtime.Runtime

MakeRuntime creates an RTDS layer with some fields.

func MakeScopedRoute

func MakeScopedRoute(scopedRouteName string, routeConfigurationName string, keyFragments []string) *route.ScopedRouteConfiguration

MakeScopedRoute creates an HTTP scoped route that routes to a given cluster.

func MakeScopedRouteHTTPListener

func MakeScopedRouteHTTPListener(mode string, listenerName string, port uint32, scopedRouteConfigName string) *listener.Listener

Creates a HTTP listener using Scoped Routes, which extracts the "Host" header field as the key.

func MakeSecrets

func MakeSecrets(tlsName, rootName string) []*auth.Secret

MakeSecrets generates an SDS secret

func MakeTCPListener

func MakeTCPListener(listenerName string, port uint32, clusterName string) *listener.Listener

Creates a TCP listener HTTP manager.

Types

type TestSnapshot

type TestSnapshot struct {
	// Xds indicates snapshot mode: ads, xds, rest, or delta
	Xds string
	// Version for the snapshot.
	Version string
	// UpstreamPort for the single endpoint on the localhost.
	UpstreamPort uint32
	// BasePort is the initial port for the listeners.
	BasePort uint32
	// NumClusters is the total number of clusters to generate.
	NumClusters int
	// NumHTTPListeners is the total number of HTTP listeners to generate.
	NumHTTPListeners int
	// NumScopedHTTPListeners is the total number of scoped route HTTP listeners to generate.
	NumScopedHTTPListeners int
	// NumTCPListeners is the total number of TCP listeners to generate.
	// Listeners are assigned clusters in a round-robin fashion.
	NumTCPListeners int
	// NumRuntimes is the total number of RTDS layers to generate.
	NumRuntimes int
	// TLS enables SDS-enabled TLS mode on all listeners
	TLS bool
	// NumExtension is the total number of Extension Config
	NumExtension int
}

TestSnapshot holds parameters for a synthetic snapshot.

func (TestSnapshot) Generate

func (ts TestSnapshot) Generate() cache.Snapshot

Generate produces a snapshot from the parameters.

Jump to

Keyboard shortcuts

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