示例#1
0
func notifyProwl(n notifier, note notification) (err error) {
	p := goprowl.Goprowl{}
	p.RegisterKey(n.Config["apikey"])

	msg := goprowl.Notification{
		Application: n.Config["application"],
		Description: note.Msg,
		Event:       note.Event,
		Priority:    n.Config["priority"],
	}

	return p.Push(&msg)
}
示例#2
0
func notifyProwl(n notifier, note notification) error {
	p := goprowl.Goprowl{}
	if err := p.RegisterKey(n.Config["apikey"]); err != nil {
		return err
	}

	msg := goprowl.Notification{
		Application: n.Config["application"],
		Description: note.Msg,
		Event:       note.Event,
		Priority:    n.Config["priority"],
	}

	return p.Push(&msg)
}
示例#3
0
文件: prowl.go 项目: dustin/goprowl
func main() {
	flag.Parse()

	p := goprowl.Goprowl{}
	p.RegisterKey(apikey)

	n := goprowl.Notification{
		Application: application,
		Description: strings.Join(flag.Args(), " "),
		Event:       event,
		Priority:    priority,
		Url:         url,
	}

	if err := p.Push(&n); err != nil {
		fmt.Fprintf(os.Stderr, "Error sending message:  %v\n", err)
		os.Exit(1)
	}
}