pushover

package module
v0.0.0-...-a6b07fe Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: ISC Imports: 6 Imported by: 0

README

Pushover

Package pushover provides a small interface to send messages via the Pushover service using its Message API.

godocs.io

This repository contains the Go pushover package, the pover command-line utility, and example Icinga2 configuration and scripts to send notifications from Icinga2 using pover.

Documentation

Overview

Package pushover provides a small interface to send messages via the Pushover service using its Message API. There is no client to set up or state to manage; just create a message and send it.

The most basic usage is sending a simple message. For example, to send "Hello World!":

msg := pushover.Message{
	User: "abcde12345",
	Token: "zxcvb6789",
	Message: "Hello World!"
}
if err := pushover.Push(msg); err != nil {
	return err
}

To send a message with high priority, with a title:

msg := pushover.Message{
	User: "abcde12345",
	Token: "zxcvb6789",
	Message: "Hello World!",
	Title: "Greeting",
	Priority: PriorityHigh,
}
if err := pushover.Push(msg); err != nil {
	return err
}

For more detailed example usage, see cmd/pover/pover.go

Index

Constants

View Source
const (
	PriorityLowest = -2 + iota
	PriorityLow
	PriorityNormal
	PriorityHigh
)
View Source
const MaxMsgLength = 1024
View Source
const MaxTitleLength = 250

Variables

This section is empty.

Functions

func Push

func Push(m Message) error

Push sends the Message m to Pushover.

Types

type Message

type Message struct {
	User     string
	Token    string
	Title    string
	Message  string
	Priority int
}

Message represents a message in the Pushover Message API.

Source Files

  • pushover.go

Directories

Path Synopsis
cmd
pover command

Jump to

Keyboard shortcuts

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