grpc

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconHandler

type BeaconHandler interface {
	HandleBeacon(ctx context.Context, b beacon.Beacon, peer *snet.UDPAddr) error
}

BeaconHandler handles the received beacons.

type BeaconSender

type BeaconSender struct {
	Conn *grpc.ClientConn
}

BeaconSender propagates beacons.

func (BeaconSender) Close

func (s BeaconSender) Close() error

Close closes the BeaconSender and releases all underlying resources.

func (BeaconSender) Send

func (s BeaconSender) Send(ctx context.Context, b *seg.PathSegment) error

Send sends a beacon to the remote.

type BeaconSenderFactory

type BeaconSenderFactory struct {
	// Dialer is used to dial the gRPC connection to the remote.
	Dialer libgrpc.Dialer
}

BeaconSenderFactory can be used to create beacon senders.

func (*BeaconSenderFactory) NewSender

func (f *BeaconSenderFactory) NewSender(
	ctx context.Context,
	dstIA addr.IA,
	egIfId uint16,
	nextHop *net.UDPAddr,
) (beaconing.Sender, error)

NewSender returns a beacon sender that can be used to send beacons to a remote CS.

type Registrar

type Registrar struct {
	// Dialer dials a new gRPC connection.
	Dialer grpc.Dialer
}

Registrar registers segments.

func (Registrar) RegisterSegment

func (r Registrar) RegisterSegment(ctx context.Context, meta seg.Meta, remote net.Addr) error

RegisterSegment registers a segment with the remote.

type SegmentCreationServer

type SegmentCreationServer struct {
	Handler BeaconHandler
}

SegmentCreationServer handles beaconing requests.

func (SegmentCreationServer) Beacon

Jump to

Keyboard shortcuts

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