hub

package
v0.0.0-...-26a90b4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

handling the server and all connections to remote services

func NewHub

func NewHub(hubReader api.HubReaderInterface,
	mdns api.MdnsInterface,
	port int,
	certificate tls.Certificate,
	localService *api.ServiceDetails) *Hub

func (*Hub) AllowWaitingForTrust

func (h *Hub) AllowWaitingForTrust(ski string) bool

check if the user is still able to trust the connection

func (*Hub) CancelPairingWithSKI

func (h *Hub) CancelPairingWithSKI(ski string)

Cancels the pairing process for a SKI

func (*Hub) DisconnectSKI

func (h *Hub) DisconnectSKI(ski string, reason string)

Disconnect a connection to an SKI, used by a service implementation e.g. if heartbeats go wrong

func (*Hub) HandleConnectionClosed

func (h *Hub) HandleConnectionClosed(connection api.ShipConnectionInterface, handshakeCompleted bool)

report closing of a connection and if handshake did complete

func (*Hub) HandleShipHandshakeStateUpdate

func (h *Hub) HandleShipHandshakeStateUpdate(ski string, state model.ShipState)

report the updated SHIP handshake state and optional error message for a SKI

func (*Hub) IsAutoAcceptEnabled

func (h *Hub) IsAutoAcceptEnabled() bool

check if auto accept is true

func (*Hub) IsRemoteServiceForSKIPaired

func (h *Hub) IsRemoteServiceForSKIPaired(ski string) bool

check if the SKI is paired

func (*Hub) PairingDetailForSki

func (h *Hub) PairingDetailForSki(ski string) *api.ConnectionStateDetail

Provide the current pairing state for a SKI

returns:

ErrNotPaired if the SKI is not in the (to be) paired list
ErrNoConnectionFound if no connection for the SKI was found

func (*Hub) RegisterRemoteSKI

func (h *Hub) RegisterRemoteSKI(ski string)

Sets the SKI as being paired or not Should be used for services which completed the pairing process and which were stored as having the process completed

func (*Hub) ReportMdnsEntries

func (h *Hub) ReportMdnsEntries(entries map[string]*api.MdnsEntry)

Process reported mDNS services

func (*Hub) ReportServiceShipID

func (h *Hub) ReportServiceShipID(ski string, shipdID string)

report the ship ID provided during the handshake

func (*Hub) ServeHTTP

func (h *Hub) ServeHTTP(w http.ResponseWriter, r *http.Request)

HTTP Server callback for handling incoming connection requests

func (*Hub) ServiceForSKI

func (h *Hub) ServiceForSKI(ski string) *api.ServiceDetails

return the service for a SKI

func (*Hub) SetupRemoteDevice

report an approved handshake by a remote device

func (*Hub) Shutdown

func (h *Hub) Shutdown()

close all connections

func (*Hub) Start

func (h *Hub) Start()

Start the ConnectionsHub with all its services

func (*Hub) UnregisterRemoteSKI

func (h *Hub) UnregisterRemoteSKI(ski string)

Remove pairing for the SKI

Jump to

Keyboard shortcuts

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