sotw

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL