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 (*InProcessRouter) Uplink ¶
func (r *InProcessRouter) Uplink() chan<- Change
Uplink returns a channel of uplink changes.
type NewStream ¶
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 ¶
func (s *Server) Register(ctx context.Context, req *uplinkpb.RegisterTrigger) (*uplinkpb.RegisterRequest, error)
Register implements the uplink gRPC service.
func (*Server) Setup ¶
func (s *Server) Setup(cxt context.Context, req *uplinkpb.SetupRequest) (*uplinkpb.SetupResponse, error)
Setup implements the uplink gRPC service.