service

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 14 Imported by: 12 modules, 12 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func (s *Service) GetActiveAnnouncements() []string

SHIP Pairing: Get Active Announcements. Used by devZ only.

func (*Service) GetLocalCertificateFingerprint added in v0.8.0

func (s *Service) GetLocalCertificateFingerprint() (string, error)

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

func (s *Service) IsAnnouncingTo(shipID string) bool

Return true if currently announcing to a specific target device Used by devZ only.

func (*Service) IsAutoAcceptEnabled added in v0.5.0

func (s *Service) IsAutoAcceptEnabled() bool

func (*Service) IsRunning added in v0.8.0

func (s *Service) IsRunning() bool

return if the service is running

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

func (s *Service) QRCodeText() (string, error)

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 (s *Service) SetAutoAccept(value bool)

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) Setup added in v0.5.0

func (s *Service) Setup() error

Starts the service by initializeing mDNS and the server.

func (*Service) SetupRemoteService added in v0.8.0

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

func (s *Service) Start() error

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

func (s *Service) StopAnnouncementTo(shipID string) error

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

func (s *Service) UserIsAbleToApproveOrCancelPairingRequests(allow bool)

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

Jump to

Keyboard shortcuts

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