sdmqtt

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sdmqtt MQTT协议客户端

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(loggers Loggers)

Types

type Client

type Client struct {
	mqtt.Client
}

func Dial

func Dial(opts *mqtt.ClientOptions) *Client

func (*Client) ConnectSync

func (c *Client) ConnectSync() error

func (*Client) PublishSync

func (c *Client) PublishSync(topic string, qos byte, retained bool, payload any) error

func (*Client) SubscribeSync

func (c *Client) SubscribeSync(topic string, qos byte, callback mqtt.MessageHandler) error

func (*Client) UnsubscribeSync

func (c *Client) UnsubscribeSync(topics ...string) error

type Loggers

type Loggers struct {
	Debug    mqtt.Logger
	Error    mqtt.Logger
	Warn     mqtt.Logger
	Critical mqtt.Logger
}

Jump to

Keyboard shortcuts

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