Documentation ¶
Index ¶
- Constants
- type AghastMsgT
- type GeneralMsgT
- type MQTT
- func (m *MQTT) Disconnect()
- func (m *MQTT) Start(broker string, port int, username string, password string, clientID string, ...) chan AghastMsgT
- func (m *MQTT) SubscribeToTopic(topic string) chan GeneralMsgT
- func (m *MQTT) SubscribeToTopicUsingChan(topic string, c chan GeneralMsgT)
- func (m *MQTT) UnsubscribeFromTopic(topic string, ch chan GeneralMsgT)
Constants ¶
View Source
const (
// StatusSubtopic is used for sending important system-wide messages
StatusSubtopic = "/status"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AghastMsgT ¶
AghastMsgT is the type of messages sent via the AGHAST MQTT channels
type GeneralMsgT ¶
GeneralMsgT is the type of messages received or sent to third-parties
type MQTT ¶
type MQTT struct { PublishChan chan AghastMsgT ThirdPartyChan chan GeneralMsgT // contains filtered or unexported fields }
MQTT encapsulates a connection to an MQTT Broker
func (*MQTT) SubscribeToTopic ¶
func (m *MQTT) SubscribeToTopic(topic string) chan GeneralMsgT
SubscribeToTopic returns a channel which will receive any MQTT messages published to the topic
func (*MQTT) SubscribeToTopicUsingChan ¶
func (m *MQTT) SubscribeToTopicUsingChan(topic string, c chan GeneralMsgT)
SubscribeToTopicUsingChan uses the provided chan to receive any MQTT messages published to the topic
func (*MQTT) UnsubscribeFromTopic ¶
func (m *MQTT) UnsubscribeFromTopic(topic string, ch chan GeneralMsgT)
UnsubscribeFromTopic taked a chan as another parm and use it to correctly remove the right subbed chan from the subscription map
Click to show internal directories.
Click to hide internal directories.