Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ClientID random length specifies the length of client-id random part. ClientIDRandomLength = 10 // DisconnectTimeout is a waiting time for MQTT client disconnect in ms. DisconnectTimeout = 10 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct { IsRun bool // contains filtered or unexported fields }
Service is MQTT service for handling device communication.
func New ¶
New creates a new MQTT service instance. MQTT service receives messages from protocols and publish them on its channel.
func (*Service) Channel ¶
Channel returns a channel for consuming the received data Consuming this channel makes MQTT service work.
func (*Service) Exit ¶
func (s *Service) Exit()
Exit closes MQTT connection then closes all channels and return from all pipeline stages.
Click to show internal directories.
Click to hide internal directories.