commMqtt

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AutoTask *autoTask
)

Functions

func DelClient

func DelClient(clientId string)

func HasClient

func HasClient(clientId string) bool

func Keys

func Keys() map[string]interface{}

Types

type MqttClient

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

func GetClient

func GetClient(clientId string) *MqttClient

func NewClient

func NewClient(clientId string) *MqttClient

func (*MqttClient) Connect

func (e *MqttClient) Connect() error

func (*MqttClient) Disconnect

func (e *MqttClient) Disconnect() error

func (*MqttClient) GetClient

func (e *MqttClient) GetClient() mqtt.Client

func (*MqttClient) HasTopic

func (e *MqttClient) HasTopic(topic string) bool

func (*MqttClient) IsConnected

func (e *MqttClient) IsConnected() bool

func (*MqttClient) Publish

func (e *MqttClient) Publish(topic string, payload interface{}, timeout int64) error

func (*MqttClient) SetOption

func (e *MqttClient) SetOption(config map[string]interface{}) error

func (*MqttClient) Subscribe

func (e *MqttClient) Subscribe(topic string, handler mqtt.MessageHandler) error

func (*MqttClient) Topics

func (e *MqttClient) Topics() []string

func (*MqttClient) Unsubscribe

func (e *MqttClient) Unsubscribe(topic string) (mqtt.Token, error)

func (*MqttClient) Unsubscribes

func (e *MqttClient) Unsubscribes(topics ...string) (mqtt.Token, error)

Jump to

Keyboard shortcuts

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