summaryrefslogtreecommitdiff
path: root/ntfy/publisher.go
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth@simponic.xyz>2025-01-12 23:09:34 -0800
committerElizabeth Hunt <elizabeth@simponic.xyz>2025-01-12 23:09:34 -0800
commit18a945aab9b3129b82076f633fab1d13ba28148e (patch)
tree09703cdc24992c42c5c14051e73e0b614280f5bd /ntfy/publisher.go
downloadphoneassistant-18a945aab9b3129b82076f633fab1d13ba28148e.tar.gz
phoneassistant-18a945aab9b3129b82076f633fab1d13ba28148e.zip
initial commit by simponic-infra
Diffstat (limited to 'ntfy/publisher.go')
-rw-r--r--ntfy/publisher.go16
1 files changed, 16 insertions, 0 deletions
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
+}