Documentation
¶
Overview ¶
Package transport is the protocol-level abstraction for network resources the engine talks to. Mirrors driver/, but at a different lifecycle scope: drivers come from the device manifest at engine boot, transports come from deploy config per deploy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MQTTMessage ¶
MQTTMessage is one message delivered by an MQTT subscription.
type MQTTTransport ¶
type MQTTTransport interface {
Transport
// Publish sends payload to topic.
Publish(topic string, payload []byte, qos byte, retain bool) error
// Subscribe returns a buffered channel of messages matching filter. Each
// call creates a separate subscription with its own channel; sends are
// non-blocking and drop on full so a slow subscriber can never stall the
// paho receive loop.
Subscribe(filter string, qos byte) (<-chan MQTTMessage, error)
}
MQTTTransport multiplexes one TCP connection across many topics.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds the per-deploy MQTT transport instances, keyed by network ID. Constructed fresh for each deploy via the engine's deploy plumbing; closed and replaced on the next deploy. Mirrors driver.Registry's open-on-construct + close-on-partial-fail discipline.
func NewRegistry ¶
func NewRegistry(ext *engine.ExternalResources) (*Registry, error)
NewRegistry opens every MQTT transport in the deploy's external resources, keyed by external resource id. On any failure transports opened so far are closed.