aboutsummaryrefslogtreecommitdiff
path: root/mqtt
diff options
context:
space:
mode:
Diffstat (limited to 'mqtt')
-rw-r--r--mqtt/mqtt.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/mqtt/mqtt.go b/mqtt/mqtt.go
new file mode 100644
index 0000000..7736049
--- /dev/null
+++ b/mqtt/mqtt.go
@@ -0,0 +1,29 @@
+// Package mqtt wraps Paho MQTT with a few quality-of-life features.
+package mqtt
+
+import (
+ mqtt "github.com/eclipse/paho.mqtt.golang"
+)
+
+type (
+ Client = mqtt.Client
+ Message = mqtt.Message
+ MessageHandler = mqtt.MessageHandler
+)
+
+const (
+ AtMostOnce byte = iota
+ AtLeastOnce
+ ExactlyOnce
+)
+
+const (
+ Retain = true
+)
+
+func NewClientOptions() *mqtt.ClientOptions {
+ return mqtt.NewClientOptions()
+}
+func NewClient(opts *mqtt.ClientOptions) mqtt.Client {
+ return mqtt.NewClient(opts)
+}