package transport

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

Package transport defines the interface that describe the functionality required to communicate with an xDS server using streaming calls.

Index

Types

type BuildOptions

type BuildOptions struct {
	// ServerConfig contains the configuration that controls how the transport
	// interacts with the xDS server. This includes the server URI and the
	// credentials to use to connect to the server, among other things.
	ServerConfig *bootstrap.ServerConfig
}

BuildOptions contains the options for building a new xDS transport.

type Builder

type Builder interface {
	// Build creates a new xDS transport with the provided options.
	Build(opts BuildOptions) (Transport, error)
}

Builder is an interface for building a new xDS transport.

type StreamingCall

type StreamingCall interface {
	// Send sends the provided message on the stream.
	Send(any) error

	// Recv block until the next message is received on the stream.
	Recv() (any, error)
}

StreamingCall is an interface that provides a way to send and receive messages on a stream. The methods accept or return any.Any messages instead of concrete types to allow this interface to be used for both ADS and LRS.

type Transport

type Transport interface {
	// CreateStreamingCall creates a new streaming call to the xDS server for the
	// specified method name. The returned StreamingCall interface can be used to
	// send and receive messages on the stream.
	CreateStreamingCall(context.Context, string) (StreamingCall, error)

	// Close closes the underlying connection and cleans up any resources used by the
	// Transport.
	Close() error
}

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

Source Files

transport_interface.go

Directories

PathSynopsis
xds/internal/xdsclient/transport/adsPackage ads provides the implementation of an ADS (Aggregated Discovery Service) stream for the xDS client.
xds/internal/xdsclient/transport/grpctransportPackage grpctransport provides an implementation of the transport interface using gRPC.
xds/internal/xdsclient/transport/lrsPackage lrs provides the implementation of an LRS (Load Reporting Service) stream for the xDS client.
Version
v1.70.0 (latest)
Published
Jan 23, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
1 minute ago

Tools for package owners.