mqtt

package
v0.0.0-...-fae0b3d Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MQTT = "mqtt"

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	Broker        string `json:"broker"`
	User          string `json:"user"`
	Password      string `json:"password"`
	Topic         string `json:"topic"`
	AutoReconnect bool   `json:"autoReconnect"`
	KeepAlive     bool   `json:"keepAlive"`
}

type Publisher

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

func NewPublisher

func NewPublisher(params []byte) (*Publisher, error)

func (*Publisher) Connect

func (m *Publisher) Connect() error

func (*Publisher) Disconnect

func (m *Publisher) Disconnect()

func (*Publisher) Publish

func (p *Publisher) Publish(b []byte)

type Subscriber

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

func NewSubscriber

func NewSubscriber(params []byte) (*Subscriber, error)

func (*Subscriber) Connect

func (m *Subscriber) Connect() error

func (*Subscriber) Disconnect

func (m *Subscriber) Disconnect()

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(events chan<- []byte) error

Jump to

Keyboard shortcuts

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