goprowl

package module
v0.0.0-...-4ea871e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: BSD-3-Clause Imports: 7 Imported by: 1

README

ProwlApp Client for Go Build Status GoDoc

A wrapper for Prowl, Growl-like iPhone push notifications, written in Go.

Originally written by Yanko D Sanchez Bolanos, 07/12/2011. See attached license for more details.

Usage

See example/prowl.go for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Application string
	Description string
	Event       string
	Priority    int
	URL         string
	// contains filtered or unexported fields
}

Notification is a Prowl notification

func (*Notification) AddKey

func (n *Notification) AddKey(key string) error

AddKey appends an API key to the notification list

func (*Notification) DelKey

func (n *Notification) DelKey(key string) error

DelKey removes a key from the notification list

type ProwlClient

type ProwlClient struct {
	ProviderKey string
}

ProwlClient is used to interface with Prowl

func (ProwlClient) Push

func (c ProwlClient) Push(n Notification) error

Push a notification to ProwlApp

func (ProwlClient) RequestToken

func (c ProwlClient) RequestToken() (*Tokens, error)

RequestToken retrieves a token from the ProwlApp API. Tokens are used to authenticate a user and generate their API key with prowlapp

func (ProwlClient) RetrieveAPIKey

func (c ProwlClient) RetrieveAPIKey(token string) (string, error)

RetrieveAPIKey returns an API key given a token from RequestToken. API keys can be added to lists etc

type ProwlDispatcher

type ProwlDispatcher interface {
	Push(n Notification) error                   // push the notification
	RequestToken() (*Tokens, error)              // request an access token
	RetrieveAPIKey(token string) (string, error) // retrieve an api key from prowlapp
}

ProwlDispatcher defines the methods for interacting with the Prowl API

func NewProwlClient

func NewProwlClient(providerKey string) ProwlDispatcher

NewProwlClient creates a new client for interfacing with Prowl

type Tokens

type Tokens struct {
	Token string `xml:"token,attr"`
	URL   string `xml:"url,attr"`
}

Tokens contains the information with which to request an API key.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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