From b0fcc3e7590b9f3486f1edf8c2b004d035e38652 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 20 Dec 2025 12:09:44 +0100 Subject: Add github.com/eclipse/paho.mqtt.golang This dependency is required to use MQTT with Go. --- .../eclipse/paho.mqtt.golang/connnotf.go | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go (limited to 'vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go') diff --git a/vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go b/vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go new file mode 100644 index 0000000..3f50fca --- /dev/null +++ b/vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go @@ -0,0 +1,79 @@ +package mqtt + +import "net/url" + +type ConnectionNotificationType int64 + +const ( + ConnectionNotificationTypeConnected ConnectionNotificationType = iota + ConnectionNotificationTypeConnecting + ConnectionNotificationTypeFailed + ConnectionNotificationTypeLost + ConnectionNotificationTypeBroker + ConnectionNotificationTypeBrokerFailed +) + +type ConnectionNotification interface { + Type() ConnectionNotificationType +} + +// Connected + +type ConnectionNotificationConnected struct { +} + +func (n ConnectionNotificationConnected) Type() ConnectionNotificationType { + return ConnectionNotificationTypeConnected +} + +// Connecting + +type ConnectionNotificationConnecting struct { + IsReconnect bool + Attempt int +} + +func (n ConnectionNotificationConnecting) Type() ConnectionNotificationType { + return ConnectionNotificationTypeConnecting +} + +// Connection Failed + +type ConnectionNotificationFailed struct { + Reason error +} + +func (n ConnectionNotificationFailed) Type() ConnectionNotificationType { + return ConnectionNotificationTypeFailed +} + +// Connection Lost + +type ConnectionNotificationLost struct { + Reason error // may be nil +} + +func (n ConnectionNotificationLost) Type() ConnectionNotificationType { + return ConnectionNotificationTypeLost +} + +// Broker Connection + +type ConnectionNotificationBroker struct { + Broker *url.URL +} + +func (n ConnectionNotificationBroker) Type() ConnectionNotificationType { + return ConnectionNotificationTypeBroker +} + +// Broker Connection Failed + +type ConnectionNotificationBrokerFailed struct { + Broker *url.URL + Reason error +} + +func (n ConnectionNotificationBrokerFailed) Type() ConnectionNotificationType { + return ConnectionNotificationTypeBrokerFailed +} -- cgit v1.2.3-70-g09d2