| 1 | package barkscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/ |
| 2 | |
| 3 | // PushPayload represents the JSON payload sent to the Bark server API. |
| 4 | // This structure contains all notification parameters that can be customized. |
| 5 | type PushPayloadscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload# struct { |
| 6 | Bodyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Body. string `json:"body"` |
| 7 | DeviceKeyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#DeviceKey. string `json:"device_key"` |
| 8 | Titlescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Title. string `json:"title"` |
| 9 | Soundscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Sound. string `json:"sound,omitempty"` |
| 10 | Badgescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Badge. *int64 `json:"badge,omitempty"` |
| 11 | Iconscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Icon. string `json:"icon,omitempty"` |
| 12 | Groupscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Group. string `json:"group,omitempty"` |
| 13 | URLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#URL. string `json:"url,omitempty"` |
| 14 | Categoryscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Category. string `json:"category,omitempty"` |
| 15 | Copyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/PushPayload#Copy. string `json:"copy,omitempty"` |
| 16 | } |
| 17 | |
| 18 | // APIResponse represents the response structure returned by the Bark server API. |
| 19 | // The server responds with a JSON object containing status code, message, and timestamp. |
| 20 | // |
| 21 | //nolint:errname // APIResponse name is mandated by the Bark API response format |
| 22 | type APIResponsescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/APIResponse# struct { |
| 23 | Codescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/APIResponse#Code. int64 `json:"code"` |
| 24 | Messagescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/APIResponse#Message. string `json:"message"` |
| 25 | Timestampscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/APIResponse#Timestamp. int64 `json:"timestamp"` |
| 26 | } |
| 27 | |
| 28 | // Error returns the error message from the Bark API response. |
| 29 | // This method implements the error interface for APIResponse. |
| 30 | // |
| 31 | // Returns: |
| 32 | // - A formatted error string containing the server message. |
| 33 | func (e *APIResponsescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/APIResponse#) Errorscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/APIResponse#Error().() string { |
| 34 | return "server response: " + e.Messagescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/bark`/APIResponse#Message. |
| 35 | } |