MCPcopy
hub / github.com/grpc/grpc-go / DefaultEndpoint

Function DefaultEndpoint

internal/testutils/xds/e2e/clientresources.go:677–692  ·  view source on GitHub ↗

DefaultEndpoint returns a basic xds Endpoint resource.

(clusterName string, host string, ports []uint32)

Source from the content-addressed store, hash-verified

675
676// DefaultEndpoint returns a basic xds Endpoint resource.
677func DefaultEndpoint(clusterName string, host string, ports []uint32) *v3endpointpb.ClusterLoadAssignment {
678 var bOpts []BackendOptions
679 for _, p := range ports {
680 bOpts = append(bOpts, BackendOptions{Ports: []uint32{p}, Weight: 1})
681 }
682 return EndpointResourceWithOptions(EndpointOptions{
683 ClusterName: clusterName,
684 Host: host,
685 Localities: []LocalityOptions{
686 {
687 Backends: bOpts,
688 Weight: 1,
689 },
690 },
691 })
692}
693
694// EndpointResourceWithOptions returns an xds Endpoint resource configured with
695// the provided options.

Calls 1