From 029f90de6895b68b5f3d1999858b09d055429679 Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Fri, 19 Jun 2020 23:50:49 +0100 Subject: basic wake-on-lan actuator --- mqtt/mqtt.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 mqtt/mqtt.go (limited to 'mqtt/mqtt.go') 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) +} -- cgit v1.2.3