1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-11 15:19:02 +02:00

Do not print ugly WS error; tests

This commit is contained in:
Philipp Heckel 2022-01-15 22:33:35 -05:00
parent 846ee0fb2d
commit 707c58a120
9 changed files with 204 additions and 65 deletions
client

View file

@ -36,14 +36,16 @@ type Client struct {
// Message is a struct that represents a ntfy message
type Message struct { // TODO combine with server.message
ID string
Event string
Time int64
Topic string
Message string
Title string
Priority int
Tags []string
ID string
Event string
Time int64
Topic string
Message string
Title string
Priority int
Tags []string
Click string
Attachment *Attachment
// Additional fields
TopicURL string
@ -51,6 +53,15 @@ type Message struct { // TODO combine with server.message
Raw string
}
type Attachment struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
Size int64 `json:"size,omitempty"`
Expires int64 `json:"expires,omitempty"`
URL string `json:"url"`
Owner string `json:"-"` // IP address of uploader, used for rate limiting
}
type subscription struct {
ID string
topicURL string