mqtt

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mqtt implements the MQTT transport for CoreC.

Index

Constants

View Source
const TypeName = "mqtt"

TypeName identifies this transport's protocol. It is returned by Type() and embedded in Status() so the transport kind is reported consistently from a single source of truth rather than a scattered string literal.

Variables

This section is empty.

Functions

func NewMQTTTransport

func NewMQTTTransport(config core.TransportConfig) (core.Transport, error)

NewMQTTTransport creates a new MQTT transport from configuration.

Types

type MQTTTransport

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

MQTTTransport implements core.Transport for MQTT protocol.

func (*MQTTTransport) CommandDeadLetterEntries added in v0.0.3

func (t *MQTTTransport) CommandDeadLetterEntries() []core.DeadLetterEntry

CommandDeadLetterEntries returns a copy of the transport-local dead-letter entries for commands dropped at ingress (command channel full). It is intended for operator inspection / replay tooling and is not part of the core.Transport interface (callers type-assert to *MQTTTransport).

func (*MQTTTransport) ForwardCommand added in v0.0.3

func (t *MQTTTransport) ForwardCommand(ctx context.Context, cmd core.WriteCommand) error

ForwardCommand publishes a write command to the command-forward-topic, enabling chained-core command passthrough. Relay nodes that have no local driver for the command target use this to forward commands to downstream nodes.

When command-forward-secret is configured, the forwarded command is signed with HMAC-SHA256 and includes a fresh timestamp so the downstream node can authenticate it and enforce replay protection. When no secret is configured, the command is forwarded unsigned (backward compatible with unauthenticated command setups).

func (*MQTTTransport) Init

func (t *MQTTTransport) Init(ctx context.Context, config core.TransportConfig) error

func (*MQTTTransport) Name

func (t *MQTTTransport) Name() string

func (*MQTTTransport) OnCommand

func (t *MQTTTransport) OnCommand() <-chan core.WriteCommand

func (*MQTTTransport) OnData

func (t *MQTTTransport) OnData() <-chan core.DataPoint

OnData returns the channel of data points received from the subscribed data topic. Returns a non-nil channel only when data-topic is configured.

func (*MQTTTransport) Publish

func (t *MQTTTransport) Publish(ctx context.Context, point core.DataPoint) error

func (*MQTTTransport) PublishBatch

func (t *MQTTTransport) PublishBatch(ctx context.Context, points []core.DataPoint) error

func (*MQTTTransport) Start

func (t *MQTTTransport) Start(ctx context.Context) (err error)

func (*MQTTTransport) Status

func (t *MQTTTransport) Status() core.TransportStatus

func (*MQTTTransport) Stop

func (t *MQTTTransport) Stop() error

func (*MQTTTransport) Type

func (t *MQTTTransport) Type() string

Jump to

Keyboard shortcuts

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