Movatterモバイル変換


[0]ホーム

URL:


clients

package
v1.77.0Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License:Apache-2.0Imports:1Imported by:0

Details

Repository

github.com/grpc/grpc-go

Links

Documentation

Overview

Package clients provides implementations of the clients to interact withxDS 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 resourcessuch as listeners, routes, clusters, and endpoints from an xDS managementserver.

LRS Client

The LRS (Load Reporting Service) client allows applications to report loaddata to an LRS server via the LRS stream. This data can be used formonitoring, traffic management, and other purposes.

Experimental

NOTICE: This package is EXPERIMENTAL and may be changed or removedin a later release.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeLocality

type Locality struct {// Region is the region of the xDS client application.Regionstring// Zone is the area within a region.Zonestring// SubZone is the further subdivision within a zone.SubZonestring}

Locality represents the location of the xDS client application.

typeMetricsReporter

type MetricsReporter interface {// ReportMetric reports a metric. The metric will be one of the predefined// set of types depending on the client (XDSClient or LRSClient).//// Each client will produce different metrics. Please see the client's// documentation for a list of possible metrics events.ReportMetric(metricany)}

MetricsReporter is used by the XDSClient to report metrics.

typeNode

type Node struct {// ID is a string identifier of the application.IDstring// Cluster is the name of the cluster the application belongs to.Clusterstring// Locality is the location of the application including region, zone,// sub-zone.LocalityLocality// Metadata provides additional context about the application by associating// arbitrary key-value pairs with it.Metadataany// UserAgentName is the user agent name of application.UserAgentNamestring// UserAgentVersion is the user agent version of application.UserAgentVersionstring}

Node represents the identity of the xDS client, allowing xDS and LRS serversto identify the source of xDS requests.

typeServerIdentifier

type ServerIdentifier struct {// ServerURI is the target URI of the server.ServerURIstring// 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 may be any type that is comparable, as they are used as map// keys internally. If Extensions are not able to be used as a map key,// the client may panic.//// See:https://go.dev/ref/spec#Comparison_operators//// Any equivalent extensions in all ServerIdentifiers present in a single// client's configuration should have the same value. Not following this// restriction may result in excess resource usage.Extensionsany}

ServerIdentifier holds identifying information for connecting to an xDSmanagement or LRS server.

typeStream

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. Messagesare represented as a byte slice.

typeTransport

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()}

Transport provides the functionality to communicate with an xDS or LRSserver using streaming calls.

typeTransportBuilder

type TransportBuilder interface {// Build creates a new Transport instance to the server based on the// provided ServerIdentifier.Build(serverIdentifierServerIdentifier) (Transport,error)}

TransportBuilder provides the functionality to create a communicationchannel to an xDS or LRS server.

Source Files

View all Source files

Directories

PathSynopsis
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.
internal
Package internal contains functionality internal to the lrsclient package.
Package internal contains functionality internal to the lrsclient package.
Package xdsclient provides an xDS (* Discovery Service) client.
Package xdsclient provides an xDS (* Discovery Service) client.
internal
Package internal contains functionality internal to the xdsclient package.
Package internal contains functionality internal to the xdsclient package.
internal/xdsresource
Package xdsresource defines constants to distinguish between supported xDS API versions.
Package xdsresource defines constants to distinguish between supported xDS API versions.
metrics
Package metrics defines all metrics that can be produced by an xDS client.
Package metrics defines all metrics that can be produced by an xDS client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp