testutils

package
v1.48.0-dev Latest Latest
Warning

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

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

Documentation

Overview

Package testutils provides utility types, for use in xds tests.

Index

Constants

This section is empty.

Variables

View Source
var EmptyNodeProtoV2 = &v2corepb.Node{}

EmptyNodeProtoV2 is a v2 Node proto with no fields set.

View Source
var EmptyNodeProtoV3 = &v3corepb.Node{}

EmptyNodeProtoV3 is a v3 Node proto with no fields set.

Functions

func BuildResourceName added in v1.44.0

func BuildResourceName(typ xdsresource.ResourceType, auth, id string, ctxParams map[string]string) string

BuildResourceName returns the resource name in the format of an xdstp:// resource.

func LocalityIDToProto added in v1.31.0

func LocalityIDToProto(l internal.LocalityID) *v2corepb.Locality

LocalityIDToProto converts a LocalityID to its proto representation.

Types

type AddLocalityOptions added in v1.32.0

type AddLocalityOptions struct {
	Health []v2corepb.HealthStatus
	Weight []uint32
}

AddLocalityOptions contains options when adding locality to the builder.

type ClusterLoadAssignmentBuilder added in v1.32.0

type ClusterLoadAssignmentBuilder struct {
	// contains filtered or unexported fields
}

ClusterLoadAssignmentBuilder builds a ClusterLoadAssignment, aka EDS response.

func NewClusterLoadAssignmentBuilder added in v1.32.0

func NewClusterLoadAssignmentBuilder(clusterName string, dropPercents map[string]uint32) *ClusterLoadAssignmentBuilder

NewClusterLoadAssignmentBuilder creates a ClusterLoadAssignmentBuilder.

func (*ClusterLoadAssignmentBuilder) AddLocality added in v1.32.0

func (clab *ClusterLoadAssignmentBuilder) AddLocality(subzone string, weight uint32, priority uint32, addrsWithPort []string, opts *AddLocalityOptions)

AddLocality adds a locality to the builder.

func (*ClusterLoadAssignmentBuilder) Build added in v1.32.0

Build builds ClusterLoadAssignment.

Directories

Path Synopsis
Package e2e provides utilities for end2end testing of xDS functionality.
Package e2e provides utilities for end2end testing of xDS functionality.
Package fakeclient provides a fake implementation of an xDS client.
Package fakeclient provides a fake implementation of an xDS client.
Package fakeserver provides a fake implementation of the management server.
Package fakeserver provides a fake implementation of the management server.

Jump to

Keyboard shortcuts

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