pubsub

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PUBLIC_BROKER = "broker.emqx.io"
	LOCAL_BROKER  = "localhost"
)
View Source
const (
	TOPIC_CONTROL = "topic/control"
	TOPIC_INFO    = "topic/info"
	TOPIC_ERROR   = "topic/error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(broker string, port int, credentials *tls.Config) *Client

func (*Client) Disconnect

func (c *Client) Disconnect(delay uint, done chan bool)

func (*Client) Publish

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

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, handle mqtt.MessageHandler)

type PublishHandler

type PublishHandler func(topic string, payloads ...interface{})

type SubscribeHandler

type SubscribeHandler func(topic string, handle mqtt.MessageHandler)

Jump to

Keyboard shortcuts

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