mqtt

package
v0.0.0-...-d78bc1b Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MessagesTopic is the topic name for update messages
	MessagesTopic = "msgs"
	// EventsTopic is the topic name for events
	EventsTopic = "events"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgSource

type MsgSource struct {
	Server   *url.URL
	Prefix   string
	ClientID string
	Client   paho.Client
	// contains filtered or unexported fields
}

MsgSource processes messages from MQTT bus

func NewMsgSourceFromURL

func NewMsgSourceFromURL(serverURL string) (s *MsgSource, err error)

NewMsgSourceFromURL creates a MsgSource by parsing a URL

func (*MsgSource) Connect

func (s *MsgSource) Connect() error

Connect connects to MQTT

func (*MsgSource) ProcessMessages

func (s *MsgSource) ProcessMessages(sink vis.MessageSink) error

ProcessMessages implements vis.MsgSource

func (*MsgSource) RecvMessages

func (s *MsgSource) RecvMessages(msgs []vis.Msg)

RecvMessages implements vis.MessageSink

Jump to

Keyboard shortcuts

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