Documentation
¶
Index ¶
- type Hub
- func (h *Hub) AllowWaitingForTrust(ski string) bool
- func (h *Hub) CancelPairingWithSKI(ski string)
- func (h *Hub) DisconnectSKI(ski string, reason string)
- func (h *Hub) HandleConnectionClosed(connection api.ShipConnectionInterface, handshakeCompleted bool)
- func (h *Hub) HandleShipHandshakeStateUpdate(ski string, state model.ShipState)
- func (h *Hub) IsAutoAcceptEnabled() bool
- func (h *Hub) IsRemoteServiceForSKIPaired(ski string) bool
- func (h *Hub) PairingDetailForSki(ski string) *api.ConnectionStateDetail
- func (h *Hub) RegisterRemoteSKI(ski string)
- func (h *Hub) ReportMdnsEntries(entries map[string]*api.MdnsEntry, newEntries bool)
- func (h *Hub) ReportServiceShipID(ski string, shipdID string)
- func (h *Hub) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Hub) ServiceForSKI(ski string) *api.ServiceDetails
- func (h *Hub) SetAutoAccept(autoaccept bool)
- func (h *Hub) SetupRemoteDevice(ski string, writeI api.ShipConnectionDataWriterInterface) api.ShipConnectionDataReaderInterface
- func (h *Hub) Shutdown()
- func (h *Hub) Start()
- func (h *Hub) UnregisterRemoteSKI(ski string)
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 ¶
check if the user is still able to trust the connection
func (*Hub) CancelPairingWithSKI ¶
Cancels the pairing process for a SKI
func (*Hub) DisconnectSKI ¶
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 ¶
report the updated SHIP handshake state and optional error message for a SKI
func (*Hub) IsAutoAcceptEnabled ¶
check if auto accept is true
func (*Hub) IsRemoteServiceForSKIPaired ¶
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 ¶
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 ¶
Process reported mDNS services
func (*Hub) ReportServiceShipID ¶
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) SetAutoAccept ¶
func (*Hub) SetupRemoteDevice ¶
func (h *Hub) SetupRemoteDevice(ski string, writeI api.ShipConnectionDataWriterInterface) api.ShipConnectionDataReaderInterface
report an approved handshake by a remote device
func (*Hub) UnregisterRemoteSKI ¶
Remove pairing for the SKI