jagipson / prowlgo

golang Interface to Prowl: Send Push Notifications to iOS Devices From Your go Application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prowlgo

golang Interface to Prowl: Send Push Notifications to iOS Devices From Your go Application

GoDoc Coverage Status Build Status

Quick-Start

  1. Make sure you've got go 1.4 installed, then install the prowlgo package

    go get github.com/tweithoener/prowlgo
    
  2. Visit Prowl and create yourself an API key and a provider key.

  3. Get the minimal example going. Grab the code from below, put it into a file (say prowling.go), replace the dummy API key with a real one, and run the program using go run prowling.go

    	package main
    
    	import (
    		"fmt"
    		prowl "github.com/tweithoener/prowlgo"
    	)
    
    	func main() {
    		//Create the client.
    		client, err := prowl.NewClient(prowl.Config{
    			APIKeys:     []string{"abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde"}, //Replace with something valid!
    			Application: "prowlgo Demo",
    		})
    		if err != nil {
    			fmt.Println("Can't create prowl client: " + err.Error())
    			return
    		}
    
    		//And send the message.
    		remaining, err := client.Add(prowl.PrioNormal, "Hello World", "Your first message via prowlgo")
    		if err != nil {
    			fmt.Println("can't send message: " + err.Error())
    			return
    		}
    
    		fmt.Printf("remaining api calls: %s\n", remaining)
    	}
  4. Congratulations your first prowl message was just delivered to your device.

  5. Make sure everything is working by running the tests.

    go test
    

Documentation

prowlgo is documented using godoc. Thre resulting documentation can be found here. Check it out it is full of code examples. Start at type Client and browse through it. It's easy to understand.

TODO And Open Issues

See the issues tracker.

About

golang Interface to Prowl: Send Push Notifications to iOS Devices From Your go Application

License:BSD 2-Clause "Simplified" License


Languages

Language:Go 100.0%