Documentation
¶
Overview ¶
Package clients provides implementations of the clients to interact with xDS and LRS servers.
xDS Client ¶
The xDS client allows applications to:
- Create client instances with in-memory configurations.
- Register watches for named resources.
- Receive resources via the ADS (Aggregated Discovery Service) stream.
This enables applications to dynamically discover and configure resources such as listeners, routes, clusters, and endpoints from an xDS management server.
LRS Client ¶
The LRS (Load Reporting Service) client allows applications to report load data to an LRS server via the LRS stream. This data can be used for monitoring, traffic management, and other purposes.
Experimental ¶
NOTICE: This package is EXPERIMENTAL and may be changed or removed in a later release.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locality ¶
type Locality struct { // Region is the region of the xDS client application. Region string // Zone is the area within a region. Zone string // SubZone is the further subdivision within a zone. SubZone string }
Locality represents the location of the xDS client application.
type Node ¶
type Node struct { // ID is a string identifier of the application. ID string // Cluster is the name of the cluster the application belongs to. Cluster string // Locality is the location of the application including region, zone, // sub-zone. Locality Locality // Metadata provides additional context about the application by associating // arbitrary key-value pairs with it. Metadata any // UserAgentName is the user agent name of application. UserAgentName string // UserAgentVersion is the user agent version of application. UserAgentVersion string }
Node represents the identity of the xDS client, allowing xDS and LRS servers to identify the source of xDS requests.
type ServerIdentifier ¶ added in v1.72.0
type ServerIdentifier struct { // ServerURI is the target URI of the server. ServerURI string // Extensions can be populated with arbitrary data to be passed to the // TransportBuilder and/or xDS Client's ResourceType implementations. // This field can be used to provide additional configuration or context // specific to the user's needs. // // The xDS and LRS clients do not interpret the contents of this field. // It is the responsibility of the user's custom TransportBuilder and/or // ResourceType implementations to handle and interpret these extensions. // // For example, a custom TransportBuilder might use this field to // configure a specific security credentials. Extensions any }
ServerIdentifier holds identifying information for connecting to an xDS management or LRS server.
type Stream ¶
type Stream interface { // Send sends the provided message on the stream. Send([]byte) error // Recv blocks until the next message is received on the stream. Recv() ([]byte, error) }
Stream provides methods to send and receive messages on a stream. Messages are represented as a byte slice.
type Transport ¶
type Transport interface { // NewStream creates a new streaming call to the server for the specific // RPC method name. The returned Stream interface can be used to send and // receive messages on the stream. NewStream(context.Context, string) (Stream, error) // Close closes the Transport. Close() error }
Transport provides the functionality to communicate with an xDS or LRS server using streaming calls.
type TransportBuilder ¶
type TransportBuilder interface { // Build creates a new Transport instance to the server based on the // provided ServerIdentifier. Build(serverIdentifier ServerIdentifier) (Transport, error) }
TransportBuilder provides the functionality to create a communication channel to an xDS or LRS server.
Directories
¶
Path | Synopsis |
---|---|
Package grpctransport provides an implementation of the clients.TransportBuilder interface using gRPC.
|
Package grpctransport provides an implementation of the clients.TransportBuilder interface using gRPC. |
Package internal contains helpers for xDS and LRS clients.
|
Package internal contains helpers for xDS and LRS clients. |
backoff
Package backoff implements the backoff strategy for clients.
|
Package backoff implements the backoff strategy for clients. |
buffer
Package buffer provides an implementation of an unbounded buffer.
|
Package buffer provides an implementation of an unbounded buffer. |
pretty
Package pretty defines helper functions to pretty-print structs for logging.
|
Package pretty defines helper functions to pretty-print structs for logging. |
syncutil
Package syncutil implements additional synchronization primitives built upon the sync package.
|
Package syncutil implements additional synchronization primitives built upon the sync package. |
testutils
Package testutils contains testing helpers for xDS and LRS clients.
|
Package testutils contains testing helpers for xDS and LRS clients. |
testutils/e2e
Package e2e provides utilities for end2end testing of xDS and LRS clients functionalities.
|
Package e2e provides utilities for end2end testing of xDS and LRS clients functionalities. |
testutils/fakeserver
Package fakeserver provides a fake implementation of the management server.
|
Package fakeserver provides a fake implementation of the management server. |
Package lrsclient provides an LRS (Load Reporting Service) client.
|
Package lrsclient provides an LRS (Load Reporting Service) client. |
Package xdsclient provides an xDS (* Discovery Service) client.
|
Package xdsclient provides an xDS (* Discovery Service) client. |
internal/xdsresource
Package xdsresource defines constants to distinguish between supported xDS API versions.
|
Package xdsresource defines constants to distinguish between supported xDS API versions. |