package sotw

import "github.com/envoyproxy/go-control-plane/pkg/client/sotw/v3"

Package sotw provides an implementation of GRPC SoTW (State of The World) part of XDS client

Index

Variables

var (
	ErrInit    = errors.New("ads client: grpc connection is not initialized (use InitConnect() method to initialize connection)")
	ErrNilResp = errors.New("ads client: nil response from xds management server")
)

Functions

func IsConnError

func IsConnError(err error) bool

IsConnError checks the provided error is due to the gRPC connection and returns true if it is due to the gRPC connection.

In this case the gRPC connection with the server should be re initialized with the ADSClient.InitConnect method.

Types

type ADSClient

type ADSClient interface {
	// Initialize the gRPC connection with management server and send the initial Discovery Request.
	InitConnect(clientConn grpc.ClientConnInterface, opts ...grpc.CallOption) error
	// Fetch waits for a response from management server and returns response or error.
	Fetch() (*Response, error)
	// Ack acknowledge the validity of the last received response to management server.
	Ack() error
	// Nack acknowledge the invalidity of the last received response to management server.
	Nack(message string) error
}

ADSClient is a SoTW and ADS based generic gRPC xDS client which can be used to implement an xDS client which fetches resources from an xDS server and responds the server back with ack or nack the resources.

func NewADSClient

func NewADSClient(ctx context.Context, node *core.Node, typeURL string) ADSClient

NewADSClient returns a new ADSClient

type Response

type Response struct {
	Resources []*anypb.Any
}

Response wraps the latest Resources from the xDS server. For the time being it only contains the Resources from server. This can be extended with other response details. For example some metadata from DiscoveryResponse.

Source Files

client.go

Version
v0.13.0
Published
Aug 9, 2024
Platform
linux/amd64
Imports
11 packages
Last checked
27 minutes ago

Tools for package owners.