Documentation
¶
Index ¶
- type Controller
- func (c *Controller) SendCustomMsg(msg Message) (err error)
- func (c *Controller) SendEmergencyPriorityMsg(msg, title string) (err error)
- func (c *Controller) SendHighPriorityMsg(msg, title string) (err error)
- func (c *Controller) SendLowPriorityMsg(msg, title string) (err error)
- func (c *Controller) SendLowestPriorityMsg(msg, title string) (err error)
- func (c *Controller) SendNormalPriorityMsg(msg, title string) (err error)
- type Message
- type Priority
- type ServerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller will wrap access to pushover notifications
func New ¶
func New(applicationKey, userKey string) (c *Controller)
New will return an initialized and ready to use Controller. If applicationKey or userKey is nil, all methods will have no effect.
func (*Controller) SendCustomMsg ¶
func (c *Controller) SendCustomMsg(msg Message) (err error)
SendCustomMsg allow to send a custom message
func (*Controller) SendEmergencyPriorityMsg ¶
func (c *Controller) SendEmergencyPriorityMsg(msg, title string) (err error)
SendEmergencyPriorityMsg sends a message with a title as emergency notification
func (*Controller) SendHighPriorityMsg ¶
func (c *Controller) SendHighPriorityMsg(msg, title string) (err error)
SendHighPriorityMsg sends a message with a title as high priority notification
func (*Controller) SendLowPriorityMsg ¶
func (c *Controller) SendLowPriorityMsg(msg, title string) (err error)
SendLowPriorityMsg sends a message with a title as low priority notification
func (*Controller) SendLowestPriorityMsg ¶
func (c *Controller) SendLowestPriorityMsg(msg, title string) (err error)
SendLowestPriorityMsg sends a message with a title as lowest priority notification
func (*Controller) SendNormalPriorityMsg ¶
func (c *Controller) SendNormalPriorityMsg(msg, title string) (err error)
SendNormalPriorityMsg sends a message with a title as normal notification
type Message ¶
type Message struct {
Message string
Title string
Priority Priority
URL string
URLTitle string
Timestamp int64
Retry time.Duration
Expire time.Duration
CallbackURL string
DeviceName string
Sound string
HTML bool
Attachment io.Reader
}
Message represents all the usable fields for a message
type Priority ¶
type Priority int
Priority represents a given message priority
const ( // PriorityEmergency will be shown as red notification bypassing silence settings on dest. PriorityEmergency Priority = pushover.PriorityEmergency // PriorityHigh will be shown as red notifications PriorityHigh Priority = pushover.PriorityHigh // PriorityNormal will create a notification tile and sound PriorityNormal Priority = pushover.PriorityNormal // PriorityLow will create a notification tile only (no sound or vibration) PriorityLow Priority = pushover.PriorityLow // PriorityLowest will send the message which will show up on application but won't generate any notification PriorityLowest Priority = pushover.PriorityLowest )
type ServerError ¶
func (ServerError) Error ¶
func (e ServerError) Error() string
func (ServerError) IsLimitReached ¶
func (e ServerError) IsLimitReached() bool