mqtt

package
v0.0.0-...-5988c10 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqttClient

type MqttClient struct {
	Broker       string
	User         string
	Password     string
	CleanSession bool
	Clientid     string
	// contains filtered or unexported fields
}

func NewMqttClient

func NewMqttClient(cfg interface{}) (*MqttClient, error)

func (*MqttClient) Publish

func (m *MqttClient) Publish(topic string, payload interface{}, qos byte, retained bool) error

func (*MqttClient) PublishRetain

func (m *MqttClient) PublishRetain(topic string, payload interface{}) error

PublishRetain is simplified version of Publish intended to use by sensors

func (*MqttClient) Run

func (m *MqttClient) Run(ctx context.Context) error

func (*MqttClient) Subscribe

func (m *MqttClient) Subscribe(topic string, qos byte) (<-chan *MqttMessage, error)

func (*MqttClient) SubscribeMultiple

func (m *MqttClient) SubscribeMultiple(topics []string, qos byte) (<-chan *MqttMessage, error)

type MqttMessage

type MqttMessage struct {
	Topic string
	Value string
}

Jump to

Keyboard shortcuts

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