xdstest

package
Version: v0.0.0-...-b0509f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(t test.Failer, p proto.Message) string

func DumpList

func DumpList(t test.Failer, protoList []interface{}) []string

DumpList will dump a list of protos. To workaround go type issues, call DumpList(t, InterfaceSlice([]proto.Message))

func EvaluateListenerFilterPredicates

func EvaluateListenerFilterPredicates(predicate *listener.ListenerFilterChainMatchPredicate, port int) bool

EvaluateListenerFilterPredicates runs through the ListenerFilterChainMatchPredicate logic This is exposed for testing only, and should not be used in XDS generation code

func ExtractCluster

func ExtractCluster(name string, cc []*cluster.Cluster) *cluster.Cluster

func ExtractClusterEndpoints

func ExtractClusterEndpoints(clusters []*cluster.Cluster) map[string][]string

func ExtractClusters

func ExtractClusters(cc []*cluster.Cluster) map[string]*cluster.Cluster

func ExtractEdsClusterNames

func ExtractEdsClusterNames(cl []*cluster.Cluster) []string

func ExtractEndpoints

func ExtractEndpoints(cla *endpoint.ClusterLoadAssignment) []string

ExtractEndpoints returns all endpoints in the load assignment (including unhealthy endpoints)

func ExtractFilterChain

func ExtractFilterChain(name string, l *listener.Listener) *listener.FilterChain

func ExtractFilterChainNames

func ExtractFilterChainNames(l *listener.Listener) []string

func ExtractFilterNames

func ExtractFilterNames(t test.Failer, fcs *listener.FilterChain) ([]string, []string)

func ExtractHTTPConnectionManager

func ExtractHTTPConnectionManager(t test.Failer, fcs *listener.FilterChain) *hcm.HttpConnectionManager

func ExtractHealthEndpoints

func ExtractHealthEndpoints(cla *endpoint.ClusterLoadAssignment) ([]string, []string)

ExtractHealthEndpoints returns all health and unhealth endpoints

func ExtractListener

func ExtractListener(name string, ll []*listener.Listener) *listener.Listener

func ExtractListenerFilters

func ExtractListenerFilters(l *listener.Listener) map[string]*listener.ListenerFilter

func ExtractListenerNames

func ExtractListenerNames(ll []*listener.Listener) []string

func ExtractLoadAssignments

func ExtractLoadAssignments(cla []*endpoint.ClusterLoadAssignment) map[string][]string

func ExtractRouteConfigurations

func ExtractRouteConfigurations(rc []*route.RouteConfiguration) map[string]*route.RouteConfiguration

func ExtractRoutesFromListeners

func ExtractRoutesFromListeners(ll []*listener.Listener) []string

func ExtractSecretResources

func ExtractSecretResources(t test.Failer, rs []*any.Any) []string

ExtractSecretResources fetches all referenced SDS resource names from a list of clusters and listeners

func ExtractTCPProxy

func ExtractTCPProxy(t test.Failer, fcs *listener.FilterChain) *tcpproxy.TcpProxy

func ExtractTLSSecrets

func ExtractTLSSecrets(t test.Failer, secrets []*any.Any) map[string]*tls.Secret

func ExtractVirtualHosts

func ExtractVirtualHosts(rc *route.RouteConfiguration) map[string][]string

func FilterClusters

func FilterClusters(cl []*cluster.Cluster, f func(c *cluster.Cluster) bool) []*cluster.Cluster

func InterfaceSlice

func InterfaceSlice(slice interface{}) []interface{}

func MapKeys

func MapKeys(mp interface{}) []string

func SlowClientInterceptor

func SlowClientInterceptor(recv, send time.Duration) grpc.StreamClientInterceptor

SlowClientInterceptor is an interceptor that allows injecting delays on Send and Recv

func SlowServerInterceptor

func SlowServerInterceptor(recv, send time.Duration) grpc.StreamServerInterceptor

SlowServerInterceptor is an interceptor that allows injecting delays on Send and Recv

func ToDiscoveryResponse

func ToDiscoveryResponse(p interface{}) *discovery.DiscoveryResponse

func UnmarshalClusterLoadAssignment

func UnmarshalClusterLoadAssignment(t test.Failer, resp []*any.Any) []*endpoint.ClusterLoadAssignment

func UnmarshalRouteConfiguration

func UnmarshalRouteConfiguration(t test.Failer, resp []*any.Any) []*route.RouteConfiguration

func ValidateCluster

func ValidateCluster(t testing.TB, c *cluster.Cluster)

func ValidateClusterLoadAssignment

func ValidateClusterLoadAssignment(t testing.TB, l *endpoint.ClusterLoadAssignment)

func ValidateClusterLoadAssignments

func ValidateClusterLoadAssignments(t testing.TB, ls []*endpoint.ClusterLoadAssignment)

func ValidateClusters

func ValidateClusters(t testing.TB, ls []*cluster.Cluster)

func ValidateListener

func ValidateListener(t testing.TB, l *listener.Listener)

func ValidateListeners

func ValidateListeners(t testing.TB, ls []*listener.Listener)

func ValidateRoute

func ValidateRoute(t testing.TB, r *route.Route)

func ValidateRouteConfiguration

func ValidateRouteConfiguration(t testing.TB, l *route.RouteConfiguration)

func ValidateRouteConfigurations

func ValidateRouteConfigurations(t testing.TB, ls []*route.RouteConfiguration)

func ValidateRoutes

func ValidateRoutes(t testing.TB, ls []*route.Route)

Types

type MockDiscovery

type MockDiscovery struct {
	Listener *bufconn.Listener
	// contains filtered or unexported fields
}

MockDiscovery is a DiscoveryServer that allows users full control over responses.

func NewMockServer

func NewMockServer(t test.Failer) *MockDiscovery

func (*MockDiscovery) SendDeltaResponse

func (f *MockDiscovery) SendDeltaResponse(dr *discovery.DeltaDiscoveryResponse)

SendDeltaResponse sends a response to a (random) client. This can block if sends are blocked.

func (*MockDiscovery) SendResponse

func (f *MockDiscovery) SendResponse(dr *discovery.DiscoveryResponse)

SendResponse sends a response to a (random) client. This can block if sends are blocked.

Jump to

Keyboard shortcuts

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