Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultTimeout = 1 * time.Second DefaultClientID = "flux-mqtt" )
Variables ¶
This section is empty.
Functions ¶
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.
type Dependency ¶
type Dependency struct {
Dialer Dialer
}
Dependency 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.
type ErrorDialer ¶
type ErrorDialer struct{}
ErrorDialer is the default dialer that uses the default mqtt client.
Click to show internal directories.
Click to hide internal directories.