mq

package
v0.0.0-...-fc663ca Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	OnConnectHandler func()
	// contains filtered or unexported fields
}

Broker wrapper over MQTT

func NewClient

func NewClient(id, url string) (*Client, error)

func (*Client) DeleteRetained

func (c *Client) DeleteRetained(topic string)

func (*Client) Publish

func (c *Client) Publish(topic string, msg interface{})

func (*Client) PublishAsJSON

func (c *Client) PublishAsJSON(topic string, msg interface{})

func (*Client) PublishAsJSONRetained

func (c *Client) PublishAsJSONRetained(topic string, msg interface{}) error

func (*Client) PublishRetained

func (c *Client) PublishRetained(topic string, msg interface{}) error

func (*Client) SetConnectHandler

func (c *Client) SetConnectHandler(fn func())

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, handler func(topic string, payload []byte)) error

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(topics ...string) error

Jump to

Keyboard shortcuts

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