mqtt

package
v0.0.0-...-276f924 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: GPL-3.0 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 {
	Messages chan MqttMessage
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *config.Config) *Client

func (*Client) Disconnect

func (c *Client) Disconnect()

func (*Client) Publish

func (c *Client) Publish(topic string, qos byte, retained bool, message string)

func (*Client) PublishMessage

func (c *Client) PublishMessage(topic string, title string, message string)

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, qos byte)

func (*Client) WaitForMessages

func (c *Client) WaitForMessages()

type MessagePayload

type MessagePayload struct {
	Title    string `json:"title"`
	Body     string `json:"body"`
	Topic    string `json:"topic"`
	SentFrom string `json:"sentFrom"`
}

type MqttMessage

type MqttMessage struct {
	Topic   string
	Message string
}

Jump to

Keyboard shortcuts

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