Documentation
¶
Index ¶
- type Service
- func (s *Service) AddUseCase(useCase api.UseCaseInterface) error
- func (s *Service) AllowWaitingForTrust(identity shipapi.ServiceIdentity) bool
- func (s *Service) CancelPairing(identity shipapi.ServiceIdentity)
- func (s *Service) Configuration() *api.Configuration
- func (s *Service) DisconnectService(identity shipapi.ServiceIdentity, reason string)
- func (s *Service) GetActiveAnnouncements() []string
- func (s *Service) GetLocalCertificateFingerprint() (string, error)
- func (s *Service) GetTrustedAddCuDevice() *shipapi.ServiceDetails
- func (s *Service) IsAnnouncingTo(shipID string) bool
- func (s *Service) IsAutoAcceptEnabled() bool
- func (s *Service) IsRunning() bool
- func (s *Service) LocalDevice() spineapi.DeviceLocalInterface
- func (s *Service) LocalService() *shipapi.ServiceDetails
- func (s *Service) PairingDetailFor(identity shipapi.ServiceIdentity) *shipapi.ConnectionStateDetail
- func (s *Service) QRCodeText() (string, error)
- func (s *Service) RegisterRemoteService(identity shipapi.ServiceIdentity)
- func (s *Service) RemoteServiceConnected(identity shipapi.ServiceIdentity)
- func (s *Service) RemoteServiceDisconnected(identity shipapi.ServiceIdentity)
- func (s *Service) RemoteServiceFor(identity shipapi.ServiceIdentity) *shipapi.ServiceDetails
- func (s *Service) ServiceAutoTrustFailed(identity shipapi.ServiceIdentity, reason error)
- func (s *Service) ServiceAutoTrustRemoved(identity shipapi.ServiceIdentity, reason string)
- func (s *Service) ServiceAutoTrusted(identity shipapi.ServiceIdentity)
- func (s *Service) ServicePairingDetailUpdate(identity shipapi.ServiceIdentity, detail *shipapi.ConnectionStateDetail)
- func (s *Service) ServiceUpdated(identity shipapi.ServiceIdentity)
- func (s *Service) SetAutoAccept(value bool)
- func (s *Service) SetLogging(logger logging.LoggingInterface)
- func (s *Service) Setup() error
- func (s *Service) SetupRemoteService(identity shipapi.ServiceIdentity, ...) shipapi.ShipConnectionDataReaderInterface
- func (s *Service) Shutdown()
- func (s *Service) Start() error
- func (s *Service) StartAnnouncementTo(target shipapi.PairingTarget) error
- func (s *Service) StopAnnouncementTo(shipID string) error
- func (s *Service) UnregisterRemoteService(identity shipapi.ServiceIdentity)
- func (s *Service) UserIsAbleToApproveOrCancelPairingRequests(allow bool)
- func (s *Service) VisibleRemoteMdnsServicesUpdated(entries []shipapi.RemoteMdnsService)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶ added in v0.5.0
type Service struct {
// contains filtered or unexported fields
}
A service is the central element of an EEBUS service including its websocket server and a zeroconf service.
func NewService ¶ added in v0.5.0
func NewService(configuration *api.Configuration, serviceHandler api.ServiceReaderInterface) *Service
creates a new EEBUS service
func (*Service) AddUseCase ¶ added in v0.6.0
func (s *Service) AddUseCase(useCase api.UseCaseInterface) error
add a use case to the service
returns an error when adding features to the entity fails
errors should not occur during normal usage of eebus-go, and should generally be considered fatal implementation errors
see usecase.AddFeatures() for more information
func (*Service) AllowWaitingForTrust ¶ added in v0.5.0
func (s *Service) AllowWaitingForTrust(identity shipapi.ServiceIdentity) bool
return if the user is still able to trust the connection
func (*Service) CancelPairing ¶ added in v0.8.0
func (s *Service) CancelPairing(identity shipapi.ServiceIdentity)
Cancels the pairing process for a ServiceIdentity
func (*Service) Configuration ¶ added in v0.5.0
func (s *Service) Configuration() *api.Configuration
func (*Service) DisconnectService ¶ added in v0.8.0
func (s *Service) DisconnectService(identity shipapi.ServiceIdentity, reason string)
Disconnect a connection using ServiceIdentity
func (*Service) GetActiveAnnouncements ¶ added in v0.8.0
SHIP Pairing: Get Active Announcements. Used by devZ only.
func (*Service) GetLocalCertificateFingerprint ¶ added in v0.8.0
Calculate SHA-256 fingerprint of local certificate
func (*Service) GetTrustedAddCuDevice ¶ added in v0.8.0
func (s *Service) GetTrustedAddCuDevice() *shipapi.ServiceDetails
SHIP Pairing: Get the SHIP ID and Fingerprint of controlbox paired via SHIP Pairing Used by devA only.
func (*Service) IsAnnouncingTo ¶ added in v0.8.0
Return true if currently announcing to a specific target device Used by devZ only.
func (*Service) IsAutoAcceptEnabled ¶ added in v0.5.0
func (*Service) LocalDevice ¶ added in v0.5.0
func (s *Service) LocalDevice() spineapi.DeviceLocalInterface
func (*Service) LocalService ¶ added in v0.5.0
func (s *Service) LocalService() *shipapi.ServiceDetails
func (*Service) PairingDetailFor ¶ added in v0.8.0
func (s *Service) PairingDetailFor(identity shipapi.ServiceIdentity) *shipapi.ConnectionStateDetail
Get the current pairing details for a given ServiceIdentity
func (*Service) QRCodeText ¶ added in v0.8.0
Generate a QR code string. Must be called after Setup().
func (*Service) RegisterRemoteService ¶ added in v0.8.0
func (s *Service) RegisterRemoteService(identity shipapi.ServiceIdentity)
Pair a remote service using ServiceIdentity
func (*Service) RemoteServiceConnected ¶ added in v0.8.0
func (s *Service) RemoteServiceConnected(identity shipapi.ServiceIdentity)
report a connection to a remote service
is triggered whenever a SHIP connected was successful completed
func (*Service) RemoteServiceDisconnected ¶ added in v0.8.0
func (s *Service) RemoteServiceDisconnected(identity shipapi.ServiceIdentity)
report a disconnection from a remote service
is triggered whenever a SHIP connect was closed, is also triggered when the SHIP process wasn't successfully completed
NOTE: The connection may not have been reported as connected before!
func (*Service) RemoteServiceFor ¶ added in v0.8.0
func (s *Service) RemoteServiceFor(identity shipapi.ServiceIdentity) *shipapi.ServiceDetails
func (*Service) ServiceAutoTrustFailed ¶ added in v0.8.0
func (s *Service) ServiceAutoTrustFailed(identity shipapi.ServiceIdentity, reason error)
Called when SHIP pairing fails for a device
func (*Service) ServiceAutoTrustRemoved ¶ added in v0.8.0
func (s *Service) ServiceAutoTrustRemoved(identity shipapi.ServiceIdentity, reason string)
Called when device trust is automatically removed This can happen due to device replacement timeout or new device pairing
func (*Service) ServiceAutoTrusted ¶ added in v0.8.0
func (s *Service) ServiceAutoTrusted(identity shipapi.ServiceIdentity)
Called when a device is automatically trusted via SHIP pairing
func (*Service) ServicePairingDetailUpdate ¶ added in v0.5.0
func (s *Service) ServicePairingDetailUpdate(identity shipapi.ServiceIdentity, detail *shipapi.ConnectionStateDetail)
Provides the current pairing state for the remote service This is called whenever the state changes and can be used to provide user information for the pairing/connection process
func (*Service) ServiceUpdated ¶ added in v0.8.0
func (s *Service) ServiceUpdated(identity shipapi.ServiceIdentity)
report that service information has been updated This includes updates to ShipID, fingerprint, or other service details discovered during handshake
func (*Service) SetAutoAccept ¶ added in v0.5.0
func (*Service) SetLogging ¶ added in v0.5.0
func (s *Service) SetLogging(logger logging.LoggingInterface)
Sets a custom logging implementation By default NoLogging is used, so no logs are printed
func (*Service) SetupRemoteService ¶ added in v0.8.0
func (s *Service) SetupRemoteService(identity shipapi.ServiceIdentity, writeI shipapi.ShipConnectionDataWriterInterface) shipapi.ShipConnectionDataReaderInterface
report an approved handshake by a remote device
func (*Service) Shutdown ¶ added in v0.5.0
func (s *Service) Shutdown()
Shutdown all services and stop the server.
func (*Service) Start ¶ added in v0.5.0
Starts the service
Returns error with description of the error that cannot be recovered from
func (*Service) StartAnnouncementTo ¶ added in v0.8.0
func (s *Service) StartAnnouncementTo(target shipapi.PairingTarget) error
Start announcing pairing to a specific target device Used by devZ only.
func (*Service) StopAnnouncementTo ¶ added in v0.8.0
Stop announcing pairing to a specific target device Used by devZ only.
func (*Service) UnregisterRemoteService ¶ added in v0.8.0
func (s *Service) UnregisterRemoteService(identity shipapi.ServiceIdentity)
Unpair a remote service using ServiceIdentity
func (*Service) UserIsAbleToApproveOrCancelPairingRequests ¶ added in v0.5.0
Define wether the user is able to react to an incoming pairing request
Call this with `true` e.g. if the user is currently using a web interface where an incoming request can be accepted or denied
Default is set to false, meaning every incoming pairing request will be automatically denied
func (*Service) VisibleRemoteMdnsServicesUpdated ¶ added in v0.8.0
func (s *Service) VisibleRemoteMdnsServicesUpdated(entries []shipapi.RemoteMdnsService)
report all currently visible EEBUS services