signallingserver

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedByUser = errors.New("closed by user")
View Source
var ErrHandshakeTimeout = errors.New("handshake timed out")

Functions

func CloseDiscoveryServer

func CloseDiscoveryServer(ctx context.Context) error

func ConnectToDiscoveryServer

func ConnectToDiscoveryServer(ctx context.Context, c DiscoveryServerConfig) error

ConnectToDiscoveryServer connects to the discovery server and sends a handshake. The connnection is kept open and stuffed into the context.

func Receive

func Receive[M messages.Message](d *DiscoveryServer) (M, error)

func ReconnectDiscoveryServer

func ReconnectDiscoveryServer(ctx context.Context) error

func Send

func Send[M messages.Message](d *DiscoveryServer, m M) error

func SendArrivalToDiscoveryServer

func SendArrivalToDiscoveryServer(ctx context.Context, arrival *messages.ServerArrivalRequest) error

func SendReportToDiscoveryServer

func SendReportToDiscoveryServer(ctx context.Context, report *messages.Report)

func WithDiscoveryServer

func WithDiscoveryServer(ctx context.Context) (context.Context, <-chan struct{})

Types

type DiscoveryServer

type DiscoveryServer struct {
	AssignedURL string

	AcceptsReport bool
	// contains filtered or unexported fields
}

func GetDiscoveryServer

func GetDiscoveryServer(ctx context.Context) *DiscoveryServer

func (*DiscoveryServer) Close

func (d *DiscoveryServer) Close() error

func (*DiscoveryServer) Stream

type DiscoveryServerConfig

type DiscoveryServerConfig struct {
	Enabled                   bool
	URL                       string
	Key                       string
	Insecure                  bool
	TLSCert                   string
	TLSKey                    string
	SendReports               bool
	HeaderBlockList           []string
	HeaderAllowList           []string
	UseDefaultHeaderBlockList bool

	VersionInfo messages.VersionInfo
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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