hub

package
v0.0.0-...-dc2708e Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

Hub ...

func New

func New(device *mtrf.Connection, options Options) (*Hub, error)

New создает инстанс Hub и подключается к брокеру Возвращает ошибку если не получилось подключиться

func (*Hub) Loop

func (h *Hub) Loop() error

Loop ... . @TODO: выходить когда порвалась связь с брокером или модулем

func (*Hub) Publish

func (h *Hub) Publish(topic string, payload string)

Publish отправляет сообщение брокеру

type Options

type Options struct {
	Broker   string // MQTT broken
	Topic    string // MQTT root topic
	ClientID string // MQTT client ID
	User     string // MQTT user
	Password string // MQTT password
}

Options ...

Jump to

Keyboard shortcuts

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