From 9d96d1a9422b30dd6caa42cca2a561970735f160 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 21 Apr 2024 21:14:58 -0700 Subject: notify when we don't receive a thing in the last 24 hours --- ntfy/publisher.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ntfy/publisher.go (limited to 'ntfy/publisher.go') diff --git a/ntfy/publisher.go b/ntfy/publisher.go new file mode 100644 index 0000000..68f8e49 --- /dev/null +++ b/ntfy/publisher.go @@ -0,0 +1,16 @@ +package ntfy + +import ( + "net/http" + "strings" +) + +func SendMessage(message string, endpoint string, topics []string) error { + for _, topic := range topics { + _, err := http.Post(endpoint+"/"+topic, "text/plain", strings.NewReader(message)) + if err != nil { + return err + } + } + return nil +} -- cgit v1.2.3-70-g09d2