agent

package module
v0.0.0-...-bdfbbe2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 6 Imported by: 0

README

mqttagent

Tiny wrapper around https://github.com/eclipse/paho.mqtt.golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent runs an mqtt client

func NewAgent

func NewAgent(host string, clientID string, user string, pass string) (a *Agent)

NewAgent creates an agent

func (*Agent) Close

func (a *Agent) Close()

Close agent

func (*Agent) Connect

func (a *Agent) Connect() (err error)

Connect opens a new connection

func (*Agent) IsTerminated

func (a *Agent) IsTerminated() bool

func (*Agent) Publish

func (a *Agent) Publish(topic string, retain bool, payload string) (err error)

Publish things

func (*Agent) Subscribe

func (a *Agent) Subscribe(topic string, handler mqtt.MessageHandler) (err error)

Subscribe to topic

Jump to

Keyboard shortcuts

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