func (p *Pushover) SendGlanceUpdate(msg *Glance, rec *Recipient) (*Response, error) {
	if err := p.validate(); err != nil {
		return nil, err
	}
	if err := rec.validate(); err != nil {
		return nil, err
	}
	if err := msg.validate(); err != nil {
		return nil, err
	}
	return msg.send(p.token, rec.token)
}
SendGlanceUpdate is used to send glance updates to a recipient.
It can be used to display widgets on a smart watch
package pushover
import (
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"regexp"
)
var tokenRegexp *regexp.Regexp
func init() {
	tokenRegexp = regexp.MustCompile(`^[A-Za-z0-9]{30}$`)
}
var APIEndpoint = "https://api.pushover.net/1"
var (
	ErrHTTPPushover              = errors.New("pushover: http error")
	ErrEmptyToken                = errors.New("pushover: empty API token")
	ErrEmptyURL                  = errors.New("pushover: empty URL, URLTitle needs an URL")
	ErrEmptyRecipientToken       = errors.New("pushover: empty recipient token")
	ErrInvalidRecipientToken     = errors.New("pushover: invalid recipient token")
	ErrInvalidHeaders            = errors.New("pushover: invalid headers in server response")
	ErrInvalidPriority           = errors.New("pushover: invalid priority")
	ErrInvalidToken              = errors.New("pushover: invalid API token")
	ErrMessageEmpty              = errors.New("pushover: message empty")
	ErrMessageTitleTooLong       = errors.New("pushover: message title too long")
	ErrMessageTooLong            = errors.New("pushover: message too long")
	ErrMessageAttachmentTooLarge = errors.New("pushover: message attachment is too large")
	ErrMessageURLTitleTooLong    = errors.New("pushover: message URL title too long")
	ErrMessageURLTooLong         = errors.New("pushover: message URL too long")
	ErrMissingAttachment         = errors.New("pushover: missing attachment")
	ErrMissingEmergencyParameter = errors.New("pushover: missing emergency parameter")
	ErrInvalidDeviceName         = errors.New("pushover: invalid device name")
	ErrEmptyReceipt              = errors.New("pushover: empty receipt")
	ErrGlancesMissingData        = errors.New("pushover: glance update data missing")
	ErrGlancesTitleTooLong       = errors.New("pushover: glance title too long")
	ErrGlancesTextTooLong        = errors.New("pushover: glance text too long")
	ErrGlancesSubtextTooLong     = errors.New("pushover: glance subtext too long")
	ErrGlancesInvalidPercent     = errors.New("pushover: glance percent must be in range of 0-100")
)
const (
	MessageMaxLength = 1024
	MessageTitleMaxLength = 250
	MessageURLMaxLength = 512
	MessageURLTitleMaxLength = 100
	MessageMaxAttachmentByte = 2621440
)
const (
	PriorityLowest    = -2
	PriorityLow       = -1
	PriorityNormal    = 0
	PriorityHigh      = 1
	PriorityEmergency = 2
)
const (
	SoundPushover     = "pushover"
	SoundBike         = "bike"
	SoundBugle        = "bugle"
	SoundCashRegister = "cashregister"
	SoundClassical    = "classical"
	SoundCosmic       = "cosmic"
	SoundFalling      = "falling"
	SoundGamelan      = "gamelan"
	SoundIncoming     = "incoming"
	SoundIntermission = "intermission"
	SoundMagic        = "magic"
	SoundMechanical   = "mechanical"
	SoundPianobar     = "pianobar"
	SoundSiren        = "siren"
	SoundSpaceAlarm   = "spacealarm"
	SoundTugBoat      = "tugboat"
	SoundAlien        = "alien"
	SoundClimb        = "climb"
	SoundPersistent   = "persistent"
	SoundEcho         = "echo"
	SoundUpDown       = "updown"
	SoundVibrate      = "vibrate"
	SoundNone         = "none"
)
type Pushover struct {
	token string
}
func New(token string) *Pushover {
	return &Pushover{token}
}
func (p *Pushover) validate() error {
	if p.token == "" {
		return ErrEmptyToken
	}
	if !tokenRegexp.MatchString(p.token) {
		return ErrInvalidToken
	}
	return nil
}
func (p *Pushover) SendMessage(message *Message, recipient *Recipient) (*Response, error) {
	if err := p.validate(); err != nil {
		return nil, err
	}
	if err := recipient.validate(); err != nil {
		return nil, err
	}
	if err := message.validate(); err != nil {
		return nil, err
	}
	return message.send(p.token, recipient.token)
}