mqtt

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distribute

func Distribute(topic *string, qos int, retained bool, payload *[]byte) error

分发

func DistributeObject

func DistributeObject(topic *string, qos int, retained bool, obj interface{}) error

分发Object

func Init

func Init(c *Config)

func New

func New() (MQTT.Client, error)

func Options

func Options() *MQTT.ClientOptions

func Subscribe

func Subscribe(connHandler MQTT.OnConnectHandler, lostHandler MQTT.ConnectionLostHandler) error

订阅,当事件为nil时可获取client

func UnSubscribe

func UnSubscribe(topic string)

取消订阅

Types

type Config

type Config struct {
	Host     string
	Username string
	Password string
	ClientID string
}

Jump to

Keyboard shortcuts

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