pushover

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2019 License: MIT Imports: 4 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Pushover

GoDoc

Simple Pushover notifications that won't be in your way. Wrapper of gregdel's library.

Documentation

Index

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址