package mqtt
import "github.com/influxdata/flux/dependencies/mqtt"
Index ¶
- Constants
- func Inject(ctx context.Context, dialer Dialer) context.Context
- type Client
- type DefaultDialer
- type Dependency
- type Dialer
- type ErrorDialer
- type Options
Constants ¶
Functions ¶
func Inject ¶
Inject will inject this Dialer into the dependency chain.
Types ¶
type Client ¶
type Client interface { // Publish will publish the payload to a particular topic. Publish(ctx context.Context, topic string, qos byte, retain bool, payload interface{}) error io.Closer }
Client is an mqtt client that can publish to an mqtt broker.
type DefaultDialer ¶
type DefaultDialer struct{}
DefaultDialer is the default dialer that uses the default mqtt client.
func (DefaultDialer) Dial ¶
type Dependency ¶
type Dependency struct { Dialer Dialer }
Dependency will inject the Dialer into the dependency chain.
func (Dependency) Inject ¶
func (d Dependency) Inject(ctx context.Context) context.Context
Inject will inject the Dialer into the dependency chain.
type Dialer ¶
type Dialer interface { // Dial will connect to the given brokers and return a Client. Dial(ctx context.Context, brokers []string, options Options) (Client, error) }
Dialer provides a method to connect a client to one or more mqtt brokers.
func GetDialer ¶
GetDialer will return the Dialer for the current context. If no Dialer has been injected into the dependencies, this will return a default provider.
type ErrorDialer ¶
type ErrorDialer struct{}
ErrorDialer is the default dialer that uses the default mqtt client.
func (ErrorDialer) Dial ¶
type Options ¶
Options contains additional options for configuring the mqtt client.
Source Files ¶
- Version
- v0.196.1 (latest)
- Published
- Feb 19, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 1 day ago –
Tools for package owners.