mqtt

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartBroker

func StartBroker(port, WsPort string) error

StartBroker 启动Broker服务

Types

type Client

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

func NewClient

func NewClient(host, clientId string) *Client

NewClient host例如:"tcp://iot.eclipse.org:1883"

func (*Client) Close

func (p *Client) Close()

Close 关闭客户端

func (*Client) Publish

func (p *Client) Publish(topic string, qos byte, payload interface{}, retain bool)

Publish 发布消息

func (*Client) Subscribe

func (p *Client) Subscribe(topic string, qos byte, callback mqtt.MessageHandler)

func (*Client) Unsubscribe

func (p *Client) Unsubscribe(topic string)

Jump to

Keyboard shortcuts

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