uplink

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	TunnelID string
	UplinkID string                // something unique about the uplink connection
	Client   tunnelpb.TunnelClient // if nil, uplink instance removed
}

Change is a command that changes the tunnel configuratino (new endpoint, or remove endpoint).

type InProcessRouter

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

InProcessRouter connects uplinks and ingresses in the same process.

func NewInProcessRouter

func NewInProcessRouter() *InProcessRouter

NewInProcessRouter creates an InProcessRouter.

func (*InProcessRouter) Ingress

func (r *InProcessRouter) Ingress() chan<- NewStream

Ingress returns a channel with ingress requests.

func (r *InProcessRouter) Uplink() chan<- Change

Uplink returns a channel of uplink changes.

type NewStream

type NewStream struct {
	TunnelID string
	Conn     net.Conn
}

A NewStream struct encapsulates an intent to tunnel a new connection for a given tunnel ID on any uplink that can fullfull that request.

type Router

type Router interface {
	Ingress() chan<- NewStream
}

A Router receives NewStream requests and forwards them to the appropriate uplink. If no uplink is found the connection contianed in the NewStream request will be terminated.

type Server

type Server struct {
	uplinkpb.UnimplementedUplinkServer

	PublicKey ed25519.PublicKey
	Ports     []int32
	// contains filtered or unexported fields
}

Server is an uplink server.

func NewServer

func NewServer(ingressPorts []int32, pub ed25519.PublicKey, priv ed25519.PrivateKey, sup chan<- StatusUpdate) (*Server, error)

NewServer creates a new uplink mapped on a list of ingress ports.

The tunnel server can asynchronously advertise ingress addresses, which will be sent as StatusUpdate structures in the sup channel (possibly multiple times).

func (*Server) Register

Register implements the uplink gRPC service.

func (*Server) Setup

Setup implements the uplink gRPC service.

type StatusUpdate

type StatusUpdate struct {
	Ingress []string
}

StatusUpdate is used to report

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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