relay

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// The service name
	Name string `yaml:"name"`

	// ServiceOptions defines the options for the service
	Options ServiceOptions `yaml:"options"`
}

Service is a service that is exposed by the portier server as a TCP or UDP service. Each Service has an internal queue that is used to queue messages that are sent to the service. The queue has a max size, in case the queue is full, messages are not received from the underlying connection anymore (backpressure).

A service decides itself when to ack messages, i.e. when to send an ack message to the portier server, and it implements rate-limiting, i.e. it limits the number of bytes that are sent per second to the portier server. A service also implements encryption, i.e. it encrypts the data that is sent to the portier server after exchanging the public keys.

type ServiceOptions

type ServiceOptions struct {
	// The local URL
	URLLocal utils.YAMLURL `yaml:"urlLocal" validate:"required"`

	// The remote URL the bridge has to connect to
	URLRemote utils.YAMLURL `yaml:"urlRemote" validate:"required"`

	// The remote device id
	PeerDeviceID uuid.UUID `yaml:"peerDeviceID" validate:"required,uuid"`

	// The remote device public key
	PeerDevicePublicKey string

	// The Cipher that is used to encrypt the data
	Cipher string

	// The Curve that is used to generate the keys
	Curve string

	// The local public key
	LocalPublicKey string

	// The local private key
	LocalPrivateKey string

	// The connection adapter's response interval for re-transmitting control messages
	ResponseInterval time.Duration

	// The connection adapter's read timeout
	ConnectionReadTimeout time.Duration

	// The rate limit in bytes per second that is applied to the connection
	ThroughputLimit int

	// The TCP read buffer size
	ReadBufferSize int
}

ServiceOptions are options for the service that need to be known beforehand.

Directories

Path Synopsis
rtt

Jump to

Keyboard shortcuts

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