From 254f1c413c5b9eec87faaa3e5282ce405877bab4 Mon Sep 17 00:00:00 2001 From: WriterPass Date: Mon, 20 Jan 2025 19:52:26 +0800 Subject: [PATCH] add main.go for demo add README.md for description --- main.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..f473c66 --- /dev/null +++ b/main.go @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "nad-plain-notifier-golang-sdk/plain" +) + +func main() { + n := plain.Notify{ + Notify: "test", + Title: "test", + Device: "pc", + } + + notifier := plain.NadNotifier{ + Address: "https://host:port/path", + SkipSSLVerify: true, + AccessToken: "token", + } + + err := notifier.Notify(&n) + if err != nil { + _ = fmt.Errorf("notify error: %v", err) + } +}