transport

package
v1.5.33 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoPeer is returned when no peer was found in the gRPC context.
	ErrNoPeer = errors.New("no peer found in gRPC context")
	// ErrTLSCerts is returned for any TLS certificate related issue
	ErrTLSCerts = errors.New("tls certificate error")
)
View Source
var (
	ErrPodNodeNameNil = fmt.Errorf("pod and node name must be set")
	ErrAddressNil     = fmt.Errorf("address must be set")
)

Functions

func NewWatchdog

func NewWatchdog(deregCh chan<- deregistrationEvent) stats.Handler

NewWatchdog creates a new Watchdog instance

Types

type DataplaneEventsServer

type DataplaneEventsServer struct {
	protos.UnimplementedDataplaneEventsServer
	// contains filtered or unexported fields
}

DataplaneEventsServer is the gRPC server for the DataplaneEvents service

func NewServer

func NewServer(ctx context.Context, ch chan clientStreamConnection) *DataplaneEventsServer

NewServer creates a new DataplaneEventsServer instance

func (*DataplaneEventsServer) Connect

Connect is called when a client connects to the server

type EventsClient

type EventsClient struct {
	protos.DataplaneEventsClient
	// contains filtered or unexported fields
}

EventsClient is a client for the DataplaneEvents service

func NewEventsClient

func NewEventsClient(ctx context.Context, pod, node, addr string) (*EventsClient, error)

func (*EventsClient) EventsChannel

func (c *EventsClient) EventsChannel() chan *protos.Events

func (*EventsClient) Start

func (c *EventsClient) Start(stopCh <-chan struct{}) error

type EventsServer

type EventsServer struct {

	// Server is the gRPC server
	Server protos.DataplaneEventsServer

	// Watchdog is the watchdog for the gRPC server that implements the
	// gRPC stats handler interface
	Watchdog stats.Handler

	// Registrations is a map of dataplane pod address to their associate connection stream
	Registrations map[string]clientStreamConnection
	// contains filtered or unexported fields
}

EventsServer contains of the grpc server and the watchdog server

func NewEventsServer

func NewEventsServer(ctx context.Context, port int, dp *dpshim.DPShim) *EventsServer

NewEventsServer creates an instance of the EventsServer

func (*EventsServer) InputChannel

func (m *EventsServer) InputChannel() chan *protos.Events

InputChannel returns the input channel for the manager

func (*EventsServer) Start

func (m *EventsServer) Start(stopCh <-chan struct{}) error

Start starts the events manager (grpc server and watchdog)

type Watchdog

type Watchdog struct {
	// contains filtered or unexported fields
}

Watchdog is a stats handler that watches for connection and RPC events. It implements the gRPC stats.Handler interface.

func (*Watchdog) HandleConn

func (h *Watchdog) HandleConn(c context.Context, s stats.ConnStats)

HandleConn processes the Conn stats.

func (*Watchdog) HandleRPC

func (h *Watchdog) HandleRPC(ctx context.Context, _ stats.RPCStats)

func (*Watchdog) TagConn

func (h *Watchdog) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context

func (*Watchdog) TagRPC

func (h *Watchdog) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.Context

Jump to

Keyboard shortcuts

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