mqtt_client

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIdGen added in v0.1.0

func ClientIdGen(args ...interface{}) string

ClientIdGen ...

Types

type Client

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

Client ...

func NewClient

func NewClient(cfg *Config) (client *Client, err error)

NewClient ...

func (*Client) Connect

func (c *Client) Connect() (err error)

Connect ...

func (*Client) Disconnect

func (c *Client) Disconnect()

Disconnect ...

func (*Client) IsConnected

func (c *Client) IsConnected() bool

IsConnected ...

func (*Client) Publish

func (c *Client) Publish(topic string, payload interface{}) (err error)

Publish ...

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, qos byte, callback MQTT.MessageHandler) (err error)

Subscribe ...

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(topic string) (err error)

Unsubscribe ...

type Config

type Config struct {
	KeepAlive      int
	PingTimeout    int
	Broker         string
	ClientID       string
	ConnectTimeout int
	CleanSession   bool
	Username       string
	Password       string
	Qos            byte
}

Config ...

type Subscribe

type Subscribe struct {
	Qos      byte
	Callback MQTT.MessageHandler
}

Subscribe ...

Jump to

Keyboard shortcuts

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