Documentation
¶
Overview ¶
Package mqtt is a minimal MQTT 3.1.1 publish-only client: enough to feed motion and status into mosquitto / Home Assistant / Frigate without pulling in a full client library. It publishes QoS 0 or QoS 1, reconnects on the next Publish after any error, and uses keep-alive 0 so an idle connection is never dropped by the broker (there is no subscribe path to service pings).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client publishes to a single broker. It is safe for concurrent use; each Publish is serialised. A dropped connection is re-established on the next Publish, so a broker restart heals itself.
func New ¶
New returns a client for broker addr ("host:port"). clientID must be unique on the broker; user and pass may be empty for an anonymous broker.