mqttclient

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqttConf

type MqttConf struct {
	Addr     string
	ClientId string
	UserName string
	Password string
}

type MqttWrapperClient

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

func InitMqtt

func InitMqtt(c *MqttConf) (*MqttWrapperClient, error)

func (*MqttWrapperClient) Close

func (m *MqttWrapperClient) Close()

func (*MqttWrapperClient) Publish

func (m *MqttWrapperClient) Publish(topic string, payload []byte) error

func (*MqttWrapperClient) Subscribe

func (m *MqttWrapperClient) Subscribe(ctx context.Context, topic string, h mqtt.MessageHandler) (err error)

Jump to

Keyboard shortcuts

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