Documentation
¶
Index ¶
- type Controller
- func (c *Controller) SendCustomMsg(msg Message, logprefix string)
- func (c *Controller) SendEmergencyPriorityMsg(msg, title, logprefix string)
- func (c *Controller) SendHighPriorityMsg(msg, title, logprefix string)
- func (c *Controller) SendLowPriorityMsg(msg, title, logprefix string)
- func (c *Controller) SendLowestPriorityMsg(msg, title, logprefix string)
- func (c *Controller) SendNormalPriorityMsg(msg, title, logprefix string)
- type Message
- type Priority
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, logger *hllogger.HlLogger) *Controller
New will return an initialized and ready to use Controller. If logger is nil logging will be disabled. If applicationKey or userKey is nil, all methods will have no effect.
func (*Controller) SendCustomMsg ¶
func (c *Controller) SendCustomMsg(msg Message, logprefix string)
SendCustomMsg allow to send a custom message
func (*Controller) SendEmergencyPriorityMsg ¶
func (c *Controller) SendEmergencyPriorityMsg(msg, title, logprefix string)
SendEmergencyPriorityMsg sends a message with a title as emergency notification
func (*Controller) SendHighPriorityMsg ¶
func (c *Controller) SendHighPriorityMsg(msg, title, logprefix string)
SendHighPriorityMsg sends a message with a title as high priority notification
func (*Controller) SendLowPriorityMsg ¶
func (c *Controller) SendLowPriorityMsg(msg, title, logprefix string)
SendLowPriorityMsg sends a message with a title as low priority notification
func (*Controller) SendLowestPriorityMsg ¶
func (c *Controller) SendLowestPriorityMsg(msg, title, logprefix string)
SendLowestPriorityMsg sends a message with a title as lowest priority notification
func (*Controller) SendNormalPriorityMsg ¶
func (c *Controller) SendNormalPriorityMsg(msg, title, logprefix string)
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
}
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 )