Documentation ¶
Overview ¶
Package resource creates test xDS resources
Index ¶
- Constants
- Variables
- func MakeCluster(mode, clusterName string) *cluster.Cluster
- func MakeEndpoint(clusterName string, port uint32) *endpoint.ClusterLoadAssignment
- func MakeExtensionConfig(mode, extensionConfigName, route string) *core.TypedExtensionConfig
- func MakeRouteConfig(routeName, clusterName string) *route.RouteConfiguration
- func MakeRouteHTTPListener(mode, listenerName string, port uint32, route string) *listener.Listener
- func MakeRouteHTTPListenerDefaultFilterChain(mode, listenerName string, port uint32, route string) *listener.Listener
- func MakeRuntime(runtimeName string) *runtime.Runtime
- func MakeScopedRouteConfig(scopedRouteName, routeConfigurationName string, keyFragments []string) *route.ScopedRouteConfiguration
- func MakeScopedRouteHTTPListener(mode, listenerName string, port uint32) *listener.Listener
- func MakeScopedRouteHTTPListenerForRoute(mode, listenerName string, port uint32, routeConfigName string) *listener.Listener
- func MakeSecrets(tlsName, rootName string) []*auth.Secret
- func MakeTCPListener(listenerName string, port uint32, clusterName string) *listener.Listener
- func MakeVHDSRouteConfig(mode, routeName string) *route.RouteConfiguration
- func MakeVirtualHost(virtualHostName, clusterName string) *route.VirtualHost
- type TestSnapshot
Constants ¶
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 ¶
var RefreshDelay = 500 * time.Millisecond
RefreshDelay for the polling config source.
Functions ¶
func MakeCluster ¶
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 ¶ added in v0.10.0
func MakeExtensionConfig(mode, extensionConfigName, route string) *core.TypedExtensionConfig
MakeExtensionConfig creates a extension config for a cluster.
func MakeRouteConfig ¶ added in v0.10.2
func MakeRouteConfig(routeName, clusterName string) *route.RouteConfiguration
MakeRouteConfig creates an HTTP route config that routes to a given cluster.
func MakeRouteHTTPListener ¶ added in v0.10.0
func MakeRouteHTTPListenerDefaultFilterChain ¶ added in v0.13.0
func MakeRuntime ¶
MakeRuntime creates an RTDS layer with some fields.
func MakeScopedRouteConfig ¶ added in v0.10.2
func MakeScopedRouteConfig(scopedRouteName, routeConfigurationName string, keyFragments []string) *route.ScopedRouteConfiguration
MakeScopedRouteConfig creates an HTTP scoped route that routes to a given cluster.
func MakeScopedRouteHTTPListener ¶ added in v0.10.0
Creates a HTTP listener using Scoped Routes, which extracts the "Host" header field as the key.
func MakeScopedRouteHTTPListenerForRoute ¶ added in v0.10.2
func MakeScopedRouteHTTPListenerForRoute(mode, listenerName string, port uint32, routeConfigName string) *listener.Listener
MakeScopedRouteHTTPListenerForRoute is the same as MakeScopedRouteHTTPListener, except it inlines a reference to the routeConfigName, and so doesn't require a ScopedRouteConfiguration resource.
func MakeSecrets ¶
MakeSecrets generates an SDS secret
func MakeTCPListener ¶
Creates a TCP listener HTTP manager.
func MakeVHDSRouteConfig ¶ added in v0.10.2
func MakeVHDSRouteConfig(mode, routeName string) *route.RouteConfiguration
func MakeVirtualHost ¶ added in v0.10.2
func MakeVirtualHost(virtualHostName, clusterName string) *route.VirtualHost
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 // NumScopedHTTPListeners is the total number of HTTP listeners to generate where the routes are resolved via VHDS. NumVHDSHTTPListeners 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 // contains filtered or unexported fields }
TestSnapshot holds parameters for a synthetic snapshot.
func (*TestSnapshot) Generate ¶
func (ts *TestSnapshot) Generate() *cache.Snapshot
Generate produces a snapshot from the parameters.