cds

package
v0.0.0-...-8571017 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package cds implements a CDS/EDS server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// We do not implement the GRPC_DELTA or REST protocols.  We include this to pick up stubs
	// for those methods, and any future protocols that are added.
	clusterservice.UnimplementedClusterDiscoveryServiceServer
	endpointservice.UnimplementedEndpointDiscoveryServiceServer

	Clusters, Endpoints *xds.Manager
}

Server is a CDS and EDS server.

func NewServer

func NewServer(versionPrefix string, drainCh chan struct{}) *Server

NewServer returns a new server that is ready to serve.

func (*Server) AddClusters

func (s *Server) AddClusters(ctx context.Context, cs []*envoy_config_cluster_v3.Cluster) error

AddClusters adds or updates clusters, and notifies all connected clients of the change.

func (*Server) AddEndpoints

AddEndpoints adds or updates endpoints, and notifies all connected clients of the change.

func (*Server) DeleteCluster

func (s *Server) DeleteCluster(ctx context.Context, name string)

DeleteCluster deletes a cluster by name, and notifies all connected clients of the change.

func (*Server) DeleteEndpoints

func (s *Server) DeleteEndpoints(ctx context.Context, name string)

DeleteEndpoints deletes a load assignment by name, and notifies all connected clients of the change. A load assignment may contain many endpoints, this deletes them all.

func (*Server) ListClusters

func (s *Server) ListClusters() []*envoy_config_cluster_v3.Cluster

ListClusters returns the clusters that we are managing. Meant to mirror kubernetes's cache.Store API.

func (*Server) ListEndpoints

ListEndpoints returns the load assignments / endpoints that we are managing.

func (*Server) ReplaceClusters

func (s *Server) ReplaceClusters(ctx context.Context, cs []*envoy_config_cluster_v3.Cluster) error

ReplaceClusters replaces all tracked clusters with a new list of clusters.

func (*Server) ReplaceEndpoints

ReplaceEndpoints replaces all load assignments with a new set of load assignments.

func (*Server) StreamClusters

StreamClusters implements CDS.

func (*Server) StreamEndpoints

StreamEndpoints implements EDS.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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