EmptyNodeProtoV2 is a v2 Node proto with no fields set.
var EmptyNodeProtoV2 = &v2corepb.Node{}
EmptyNodeProtoV3 is a v3 Node proto with no fields set.
var EmptyNodeProtoV3 = &v3corepb.Node{}
func BuildResourceName(typeName, auth, id string, ctxParams map[string]string) string
BuildResourceName returns the resource name in the format of an xdstp:// resource.
func LocalityIDToProto(l internal.LocalityID) *v2corepb.Locality
LocalityIDToProto converts a LocalityID to its proto representation.
func ServerConfigForAddress(t *testing.T, addr string) *bootstrap.ServerConfig
ServerConfigForAddress returns a bootstrap.ServerConfig for the given address with default values of insecure channel_creds and v3 server_features.
AddLocalityOptions contains options when adding locality to the builder.
type AddLocalityOptions struct { Health []v2corepb.HealthStatus Weight []uint32 }
ClusterLoadAssignmentBuilder builds a ClusterLoadAssignment, aka EDS response.
type ClusterLoadAssignmentBuilder struct {
// contains filtered or unexported fields
}
func NewClusterLoadAssignmentBuilder(clusterName string, dropPercents map[string]uint32) *ClusterLoadAssignmentBuilder
NewClusterLoadAssignmentBuilder creates a ClusterLoadAssignmentBuilder.
func (clab *ClusterLoadAssignmentBuilder) AddLocality(subzone string, weight uint32, priority uint32, addrsWithPort []string, opts *AddLocalityOptions)
AddLocality adds a locality to the builder.
func (clab *ClusterLoadAssignmentBuilder) Build() *v2xdspb.ClusterLoadAssignment
Build builds ClusterLoadAssignment.
TestResourceWatcher implements the xdsresource.ResourceWatcher interface, used to receive updates on watches registered with the xDS client, when using the resource-type agnostic WatchResource API.
Tests can use the channels provided by this type to get access to updates and errors sent by the xDS client.
type TestResourceWatcher struct { // UpdateCh is the channel on which xDS client updates are delivered. UpdateCh chan *xdsresource.ResourceData // ErrorCh is the channel on which errors from the xDS client are delivered. ErrorCh chan error // ResourceDoesNotExistCh is the channel used to indicate calls to OnResourceDoesNotExist ResourceDoesNotExistCh chan struct{} }
func NewTestResourceWatcher() *TestResourceWatcher
NewTestResourceWatcher returns a TestResourceWatcher to watch for resources via the xDS client.
func (w *TestResourceWatcher) OnError(err error)
OnError is invoked by the xDS client to report the latest error.
func (w *TestResourceWatcher) OnResourceDoesNotExist()
OnResourceDoesNotExist is used by the xDS client to report that the resource being watched no longer exists.
func (w *TestResourceWatcher) OnUpdate(data xdsresource.ResourceData)
OnUpdate is invoked by the xDS client to report the latest update on the resource being watched.
Name | Synopsis |
---|---|
.. |