add main.go for demo
add README.md for description
This commit is contained in:
25
main.go
Normal file
25
main.go
Normal file
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user