diff options
| author | xengineering <me@xengineering.eu> | 2025-12-20 12:09:44 +0100 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2025-12-20 12:09:44 +0100 |
| commit | b0fcc3e7590b9f3486f1edf8c2b004d035e38652 (patch) | |
| tree | 81c123444d97f311e3b45a1881c9d2ff4ad2581b /vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go | |
| parent | f9fac85222892e45554a2cc49dd93455a374ef68 (diff) | |
| download | sia-server-b0fcc3e7590b9f3486f1edf8c2b004d035e38652.tar sia-server-b0fcc3e7590b9f3486f1edf8c2b004d035e38652.tar.zst sia-server-b0fcc3e7590b9f3486f1edf8c2b004d035e38652.zip | |
Add github.com/eclipse/paho.mqtt.golang
This dependency is required to use MQTT with Go.
Diffstat (limited to 'vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go')
| -rw-r--r-- | vendor/github.com/eclipse/paho.mqtt.golang/connnotf.go | 79 |
1 files changed, 79 insertions, 0 deletions
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 +} |
