package xds

import "google.golang.org/grpc/internal/xds"

Package xds contains functions, structs, and utilities for working with handshake cluster names, as well as shared components used by xds balancers and resolvers. It is separated from the top-level /internal package to avoid circular dependencies.

Index

Variables

var ResourceTypeMapForTesting map[string]any

ResourceTypeMapForTesting maps TypeUrl to corresponding ResourceType.

var UnknownCSMLabels = map[string]string{
	"csm.service_name":           "unknown",
	"csm.service_namespace_name": "unknown",
}

UnknownCSMLabels are TelemetryLabels emitted from CDS if CSM Telemetry Label data is not present in the CDS Resource.

Functions

func GetLocalityID

func GetLocalityID(addr resolver.Address) clients.Locality

GetLocalityID returns the locality ID of addr.

func GetXDSHandshakeClusterName

func GetXDSHandshakeClusterName(attr *attributes.Attributes) (string, bool)

GetXDSHandshakeClusterName returns cluster name stored in attr.

func IsLocalityEqual

func IsLocalityEqual(l clients.Locality, o any) bool

IsLocalityEqual allows the values to be compared by Attributes.Equal.

func LocalityFromString

func LocalityFromString(s string) (ret clients.Locality, _ error)

LocalityFromString converts a string representation of clients.locality as specified in gRFC A76, into a LocalityID struct.

func LocalityString

func LocalityString(l clients.Locality) string

LocalityString generates a string representation of clients.Locality in the format specified in gRFC A76.

func SetLocalityID

func SetLocalityID(addr resolver.Address, l clients.Locality) resolver.Address

SetLocalityID sets locality ID in addr to l.

func SetLocalityIDInEndpoint

func SetLocalityIDInEndpoint(endpoint resolver.Endpoint, l clients.Locality) resolver.Endpoint

SetLocalityIDInEndpoint sets locality ID in endpoint to l.

func SetXDSHandshakeClusterName

func SetXDSHandshakeClusterName(addr resolver.Address, clusterName string) resolver.Address

SetXDSHandshakeClusterName returns a copy of addr in which the Attributes field is updated with the cluster name.

Source Files

xds.go

Directories

PathSynopsis
internal/xds/balancerPackage balancer installs all the xds balancers.
internal/xds/balancer/cdsbalancerPackage cdsbalancer implements a balancer to handle CDS responses.
internal/xds/balancer/clusterimplPackage clusterimpl implements the xds_cluster_impl balancing policy.
internal/xds/balancer/clusterimpl/tests
internal/xds/balancer/clustermanagerPackage clustermanager implements the cluster manager LB policy for xds.
internal/xds/balancer/clustermanager/e2e_test
internal/xds/balancer/clusterresolverPackage clusterresolver contains the implementation of the cluster_resolver_experimental LB policy which resolves endpoint addresses using a list of one or more discovery mechanisms.
internal/xds/balancer/clusterresolver/e2e_test
internal/xds/balancer/loadstorePackage loadstore contains the loadStoreWrapper shared by the balancers.
internal/xds/balancer/outlierdetectionPackage outlierdetection provides an implementation of the outlier detection LB policy, as defined in https://github.com/grpc/proposal/blob/master/A50-xds-outlier-detection.md.
internal/xds/balancer/outlierdetection/e2e_test
internal/xds/balancer/priorityPackage priority implements the priority balancer.
internal/xds/balancer/wrrlocalityPackage wrrlocality provides an implementation of the wrr locality LB policy, as defined in [A52 - xDS Custom LB Policies].
internal/xds/bootstrapPackage bootstrap provides the functionality to initialize certain aspects of an xDS client by reading a bootstrap file.
internal/xds/bootstrap/tlscredsPackage tlscreds implements mTLS Credentials in xDS Bootstrap File.
internal/xds/clientsPackage clients provides implementations of the clients to interact with xDS and LRS servers.
internal/xds/clients/grpctransportPackage grpctransport provides an implementation of the clients.TransportBuilder interface using gRPC.
internal/xds/clients/internalPackage internal contains helpers for xDS and LRS clients.
internal/xds/clients/internal/backoffPackage backoff implements the backoff strategy for clients.
internal/xds/clients/internal/bufferPackage buffer provides an implementation of an unbounded buffer.
internal/xds/clients/internal/prettyPackage pretty defines helper functions to pretty-print structs for logging.
internal/xds/clients/internal/syncutilPackage syncutil implements additional synchronization primitives built upon the sync package.
internal/xds/clients/internal/testutilsPackage testutils contains testing helpers for xDS and LRS clients.
internal/xds/clients/internal/testutils/e2ePackage e2e provides utilities for end2end testing of xDS and LRS clients functionalities.
internal/xds/clients/internal/testutils/fakeserverPackage fakeserver provides a fake implementation of the management server.
internal/xds/clients/lrsclientPackage lrsclient provides an LRS (Load Reporting Service) client.
internal/xds/clients/lrsclient/internalPackage internal contains functionality internal to the lrsclient package.
internal/xds/clients/xdsclientPackage xdsclient provides an xDS (* Discovery Service) client.
internal/xds/clients/xdsclient/internalPackage internal contains functionality internal to the xdsclient package.
internal/xds/clients/xdsclient/internal/xdsresourcePackage xdsresource defines constants to distinguish between supported xDS API versions.
internal/xds/clients/xdsclient/metricsPackage metrics defines all metrics that can be produced by an xDS client.
internal/xds/clients/xdsclient/test
internal/xds/clusterspecifierPackage clusterspecifier contains the ClusterSpecifier interface and a registry for storing and retrieving their implementations.
internal/xds/clusterspecifier/rlsPackage rls implements the RLS cluster specifier plugin.
internal/xds/httpfilterPackage httpfilter contains the HTTPFilter interface and a registry for storing and retrieving their implementations.
internal/xds/httpfilter/faultPackage fault implements the Envoy Fault Injection HTTP filter.
internal/xds/httpfilter/rbacPackage rbac implements the Envoy RBAC HTTP filter.
internal/xds/httpfilter/routerPackage router implements the Envoy Router HTTP filter.
internal/xds/matcherPackage matcher contains types that need to be shared between code under google.golang.org/grpc/xds/...
internal/xds/rbacPackage rbac provides service-level and method-level access control for a service.
internal/xds/resolverPackage resolver implements the xds resolver, that does LDS and RDS to find the cluster to use.
internal/xds/resolver/internalPackage internal contains functionality internal to the xDS resolver.
internal/xds/serverPackage server contains internal server-side functionality used by the public facing xds package.
internal/xds/test
internal/xds/test/e2ePackage e2e implements xds e2e tests using go-control-plane.
internal/xds/testutilsPackage testutils provides utility types, for use in xds tests.
internal/xds/testutils/fakeclientPackage fakeclient provides a fake implementation of an xDS client.
internal/xds/xdsclientPackage xdsclient implements a full fledged gRPC client for the xDS API used by the xds resolver and balancer implementations.
internal/xds/xdsclient/internalPackage internal contains functionality internal to the xdsclient package.
internal/xds/xdsclient/pool
internal/xds/xdsclient/tests
internal/xds/xdsclient/xdslbregistryPackage xdslbregistry provides a registry of converters that convert proto from load balancing configuration, defined by the xDS API spec, to JSON load balancing configuration.
internal/xds/xdsclient/xdslbregistry/converterPackage converter provides converters to convert proto load balancing configuration, defined by the xDS API spec, to JSON load balancing configuration.
internal/xds/xdsclient/xdsresourcePackage xdsresource implements the xDS data model layer.
internal/xds/xdsclient/xdsresource/tests
internal/xds/xdsclient/xdsresource/versionPackage version defines constants to distinguish between supported xDS API versions.
Version
v1.76.0
Published
Oct 6, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
28 minutes ago

Tools for package owners.