mqttclient

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetMQTTClient

func ResetMQTTClient()

ResetMQTTClient resets once

Types

type Heartbeat

type Heartbeat struct {
	Topic             string
	Client            *MQTTClient
	OnHeartbeatMissed func(error)
	LastHeartbeat     time.Time

	MaxDurationMs int64
	// contains filtered or unexported fields
}

Heartbeat for MQTT Client Will Subscribe and Publish to MQTT

func (*Heartbeat) Start

func (h *Heartbeat) Start() error

Start the heartbeat

type MQTTClient

type MQTTClient struct {
	MQTTServerHost   string
	MQTTServerPort   int
	MQTTClient       mqtt.Client
	Heartbeat        *Heartbeat
	OnConnectHandler mqtt.OnConnectHandler
}

MQTTClient contains the data needed to connect the client

func GetMQTTClient

func GetMQTTClient(onConnectHandler mqtt.OnConnectHandler) *MQTTClient

GetMQTTClient creates the mqttclient and returns it

Jump to

Keyboard shortcuts

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