Versions in this module Expand all Collapse all v0 v0.12.0 Jun 30, 2023 v0.11.0 Jun 30, 2023 Changes in this version + var ConnectionDownError = errors.New("connection with the MQTT broker is currently down") + type ClientConfig struct + BrokerUrls []*url.URL + ConnectRetryDelay time.Duration + ConnectTimeout time.Duration + Debug paho.Logger + KeepAlive uint16 + OnConnectError func(error) + OnConnectionUp func(*ConnectionManager, *paho.Connack) + PahoDebug paho.Logger + PahoErrors paho.Logger + TlsCfg *tls.Config + WebSocketCfg *WebSocketConfig + func (cfg *ClientConfig) ResetUsernamePassword() + func (cfg *ClientConfig) SetConnectPacketConfigurator(fn func(*paho.Connect) *paho.Connect) bool + func (cfg *ClientConfig) SetUsernamePassword(username string, password []byte) + func (cfg *ClientConfig) SetWillMessage(topic string, payload []byte, qos byte, retain bool) + type ConnectionManager struct + func NewConnection(ctx context.Context, cfg ClientConfig) (*ConnectionManager, error) + func (c *ConnectionManager) AwaitConnection(ctx context.Context) error + func (c *ConnectionManager) Disconnect(ctx context.Context) error + func (c *ConnectionManager) Done() <-chan struct{} + func (c *ConnectionManager) Publish(ctx context.Context, p *paho.Publish) (*paho.PublishResponse, error) + func (c *ConnectionManager) Subscribe(ctx context.Context, s *paho.Subscribe) (*paho.Suback, error) + func (c *ConnectionManager) Unsubscribe(ctx context.Context, u *paho.Unsubscribe) (*paho.Unsuback, error) + type DisconnectError struct + func (d *DisconnectError) Error() string + type WebSocketConfig struct + Dialer func(url *url.URL, tlsCfg *tls.Config) *websocket.Dialer + Header func(url *url.URL, tlsCfg *tls.Config) http.Header