commit - d5a4fb2806bc51b5b41bc2a13003c55d6e77461f
commit + 8bad08a52304a12ea5374182f13b83b6286e378d
blob - 41119f9322acb87af84f93940a73f20f78e98dc2
blob + 55b2b71a0bca811b47b52a81aeca95f42e468f1a
--- pushover.go
+++ pushover.go
"fmt"
"net/http"
"net/url"
+ "strconv"
"strings"
)
const MaxMsgLength = 1024
const MaxTitleLength = 250
+const (
+ PriorityLowest = -2 + iota
+ PriorityLow
+ PriorityNormal
+ PriorityHigh
+)
+
// Message represents a message in the Pushover Message API.
type Message struct {
User string
req.Add("user", m.User)
req.Add("title", m.Title)
req.Add("message", m.Message)
+ if m.Priority != 0 {
+ req.Add("priority", strconv.Itoa(m.Priority))
+ }
resp, err := http.PostForm(apiurl, req)
if err != nil {
return err