diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-19 23:50:49 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-06-19 23:50:49 +0100 |
commit | 029f90de6895b68b5f3d1999858b09d055429679 (patch) | |
tree | 091541f5cb5d9e3d948ae69be5a5ac53aa7954c0 /mqtt/mqtt.go | |
parent | d544da3d08be66807831c03bf0f421c0addd8e9f (diff) |
basic wake-on-lan actuator
Diffstat (limited to 'mqtt/mqtt.go')
-rw-r--r-- | mqtt/mqtt.go | 29 |
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) +} |