Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type MessageHandler ¶
func NewMessageHandlerAdapter ¶
func NewMessageHandlerAdapter(h func(mqtt.Client, Message), parser Parser) MessageHandler
type MessageHandlerAdapter ¶
type MessageHandlerAdapter struct {
// contains filtered or unexported fields
}
func (*MessageHandlerAdapter) MessageHandle ¶
func (adapter *MessageHandlerAdapter) MessageHandle(client mqtt.Client, msg mqtt.Message)
type MqttManager ¶
type MqttManager struct {
// contains filtered or unexported fields
}
func NewMqttManager ¶
func NewMqttManager(brokerURL, clientId, username, password string) *MqttManager
func (*MqttManager) Connect ¶
func (m *MqttManager) Connect() error
func (*MqttManager) Disconnect ¶
func (m *MqttManager) Disconnect(timeout uint)
func (*MqttManager) IsConnected ¶
func (m *MqttManager) IsConnected() bool
func (*MqttManager) Publish ¶
func (m *MqttManager) Publish(topic string, payload interface{}) error
func (*MqttManager) SetTopicHandle ¶
func (m *MqttManager) SetTopicHandle(topic string, h MessageHandler)
type Parser ¶
func NewDefaultTopicParser ¶
func NewDefaultTopicParser() Parser
type PayloadConversionError ¶
type PayloadConversionError struct {
Payload string
}
func (*PayloadConversionError) Error ¶
func (e *PayloadConversionError) Error() string
type TopicFormatError ¶
type TopicFormatError struct {
Topic string
}
func (*TopicFormatError) Error ¶
func (e *TopicFormatError) Error() string
type ValidationError ¶
type ValidationError struct {
Message string
}
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.