Documentation ¶
Index ¶
- func Dump(t test.Failer, p proto.Message) string
- func DumpList(t test.Failer, protoList []interface{}) []string
- func EvaluateListenerFilterPredicates(predicate *listener.ListenerFilterChainMatchPredicate, port int) bool
- func ExtractCluster(name string, cc []*cluster.Cluster) *cluster.Cluster
- func ExtractClusterEndpoints(clusters []*cluster.Cluster) map[string][]string
- func ExtractClusters(cc []*cluster.Cluster) map[string]*cluster.Cluster
- func ExtractEdsClusterNames(cl []*cluster.Cluster) []string
- func ExtractEndpoints(cla *endpoint.ClusterLoadAssignment) []string
- func ExtractFilterChain(name string, l *listener.Listener) *listener.FilterChain
- func ExtractFilterChainNames(l *listener.Listener) []string
- func ExtractFilterNames(t test.Failer, fcs *listener.FilterChain) ([]string, []string)
- func ExtractHTTPConnectionManager(t test.Failer, fcs *listener.FilterChain) *hcm.HttpConnectionManager
- func ExtractHealthEndpoints(cla *endpoint.ClusterLoadAssignment) ([]string, []string)
- func ExtractListener(name string, ll []*listener.Listener) *listener.Listener
- func ExtractListenerFilters(l *listener.Listener) map[string]*listener.ListenerFilter
- func ExtractListenerNames(ll []*listener.Listener) []string
- func ExtractLoadAssignments(cla []*endpoint.ClusterLoadAssignment) map[string][]string
- func ExtractRouteConfigurations(rc []*route.RouteConfiguration) map[string]*route.RouteConfiguration
- func ExtractRoutesFromListeners(ll []*listener.Listener) []string
- func ExtractSecretResources(t test.Failer, rs []*any.Any) []string
- func ExtractTCPProxy(t test.Failer, fcs *listener.FilterChain) *tcpproxy.TcpProxy
- func ExtractTLSSecrets(t test.Failer, secrets []*any.Any) map[string]*tls.Secret
- func ExtractVirtualHosts(rc *route.RouteConfiguration) map[string][]string
- func FilterClusters(cl []*cluster.Cluster, f func(c *cluster.Cluster) bool) []*cluster.Cluster
- func InterfaceSlice(slice interface{}) []interface{}
- func MapKeys(mp interface{}) []string
- func SlowClientInterceptor(recv, send time.Duration) grpc.StreamClientInterceptor
- func SlowServerInterceptor(recv, send time.Duration) grpc.StreamServerInterceptor
- func ToDiscoveryResponse(p interface{}) *discovery.DiscoveryResponse
- func UnmarshalClusterLoadAssignment(t test.Failer, resp []*any.Any) []*endpoint.ClusterLoadAssignment
- func UnmarshalRouteConfiguration(t test.Failer, resp []*any.Any) []*route.RouteConfiguration
- func ValidateCluster(t testing.TB, c *cluster.Cluster)
- func ValidateClusterLoadAssignment(t testing.TB, l *endpoint.ClusterLoadAssignment)
- func ValidateClusterLoadAssignments(t testing.TB, ls []*endpoint.ClusterLoadAssignment)
- func ValidateClusters(t testing.TB, ls []*cluster.Cluster)
- func ValidateListener(t testing.TB, l *listener.Listener)
- func ValidateListeners(t testing.TB, ls []*listener.Listener)
- func ValidateRoute(t testing.TB, r *route.Route)
- func ValidateRouteConfiguration(t testing.TB, l *route.RouteConfiguration)
- func ValidateRouteConfigurations(t testing.TB, ls []*route.RouteConfiguration)
- func ValidateRoutes(t testing.TB, ls []*route.Route)
- type MockDiscovery
- func (f *MockDiscovery) DeltaAggregatedResources(server discovery.AggregatedDiscoveryService_DeltaAggregatedResourcesServer) error
- func (f *MockDiscovery) SendDeltaResponse(dr *discovery.DeltaDiscoveryResponse)
- func (f *MockDiscovery) SendResponse(dr *discovery.DiscoveryResponse)
- func (f *MockDiscovery) StreamAggregatedResources(server discovery.AggregatedDiscoveryService_StreamAggregatedResourcesServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpList ¶
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 ExtractClusterEndpoints ¶
func ExtractEdsClusterNames ¶
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 ExtractFilterNames ¶
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 ExtractListenerFilters ¶
func ExtractListenerFilters(l *listener.Listener) map[string]*listener.ListenerFilter
func ExtractListenerNames ¶
func ExtractLoadAssignments ¶
func ExtractLoadAssignments(cla []*endpoint.ClusterLoadAssignment) map[string][]string
func ExtractRouteConfigurations ¶
func ExtractRouteConfigurations(rc []*route.RouteConfiguration) map[string]*route.RouteConfiguration
func ExtractSecretResources ¶
ExtractSecretResources fetches all referenced SDS resource names from a list of clusters and listeners
func ExtractTCPProxy ¶
func ExtractTLSSecrets ¶
func ExtractVirtualHosts ¶
func ExtractVirtualHosts(rc *route.RouteConfiguration) map[string][]string
func FilterClusters ¶
func InterfaceSlice ¶
func InterfaceSlice(slice interface{}) []interface{}
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 ValidateClusterLoadAssignment ¶
func ValidateClusterLoadAssignment(t testing.TB, l *endpoint.ClusterLoadAssignment)
func ValidateClusterLoadAssignments ¶
func ValidateClusterLoadAssignments(t testing.TB, ls []*endpoint.ClusterLoadAssignment)
func ValidateRouteConfiguration ¶
func ValidateRouteConfiguration(t testing.TB, l *route.RouteConfiguration)
func ValidateRouteConfigurations ¶
func ValidateRouteConfigurations(t testing.TB, ls []*route.RouteConfiguration)
Types ¶
type MockDiscovery ¶
MockDiscovery is a DiscoveryServer that allows users full control over responses.
func NewMockServer ¶
func NewMockServer(t test.Failer) *MockDiscovery
func (*MockDiscovery) DeltaAggregatedResources ¶
func (f *MockDiscovery) DeltaAggregatedResources(server discovery.AggregatedDiscoveryService_DeltaAggregatedResourcesServer) error
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.
func (*MockDiscovery) StreamAggregatedResources ¶
func (f *MockDiscovery) StreamAggregatedResources(server discovery.AggregatedDiscoveryService_StreamAggregatedResourcesServer) error