-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
43 lines (37 loc) · 1.21 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package pushover
type (
// Message contains all the required settings for sending messages via the
//pushover.net API. https://pushover.net/api
Message struct {
// Required
Token string `json:"token"`
User string `json:"user"`
Message string `json:"message"`
//Optional
Device string `json:"device"`
Title string `json:"title"`
URL string `json:"url"`
URLTitle string `json:"url_title"`
Priority Priority `json:"priority"`
Timestamp int32 `json:"timestamp"`
Sound Sound `json:"sound"`
// For when we have PriorityEmergency messages
Retry int `json:"retry"` // Must be greater than 30s
Expire int `json:"expire"` // Must be less than 10800s (3h)
}
// Response contains the JSON response returned by the pushover.net API
Response struct {
Request string `json:"request"`
Status int `json:"status"`
Errors []string `json:"errors"`
}
// Config helps with managing the ability to enforce constraints more easily
Config struct {
UserKey string `yaml:"user_key"`
Token string `yaml:"api_token"`
}
// Sound is a an acceptable string for the Pushover API
Sound string
// Priority is an acceptable priority for the Pushover API
Priority int
)