mqtt_agent

package
v0.0.0-...-4275cfc Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefMqttClientId = "mqtt2ping_agent" // no longer than 23 characters
	DefBrokerURL    = "tcp://broker.hivemq.com:1883"
	DefBrokerUser   = ""
	DefBrokerPass   = ""
	DefTopicPrefix  = "mqtt2ping/"
)

Variables

This section is empty.

Functions

func FirstN

func FirstN(s string, n int) string

func GetTopicSubConfig

func GetTopicSubConfig(topic string) string

func GetTopicSubDestinationConfig

func GetTopicSubDestinationConfig(topic string) (string, bool)

func GetTopicSubDestinationStatus

func GetTopicSubDestinationStatus(topic string) (string, bool)

func GetTopicSubStatus

func GetTopicSubStatus(topic string) string

func MsgPubAdvInfo

func MsgPubAdvInfo(name, info string) (string, string)

func MsgPubAdvState

func MsgPubAdvState(name string, isOnline bool) (string, string)

func Start

func Start(config *Config, mqttSubMsgChannel chan<- Msg) chan<- Msg

Types

type Config

type Config struct {
	ClientId    string
	BrokerUrl   string
	User        string
	Pass        string
	TopicPrefix string
}

type Msg

type Msg struct {
	Topic   string
	Payload string
}

Jump to

Keyboard shortcuts

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