コード例 #1
0
ファイル: notify.go プロジェクト: nictuku/zmon
func (p *pushoverNotification) notify(msg []byte) error {
	sent := pushover.Notify(p.identity, string(msg))
	if !sent {
		return fmt.Errorf("pushover notification failed.")
	}
	return nil
}
コード例 #2
0
ファイル: main.go プロジェクト: nictuku/mothership
func notify(destination, message string) error {
	// TODO: cache this.
	pushauth := pushover.Authenticate(config.PushoverKey, destination)
	if !pushover.Notify(pushauth, message) {
		return fmt.Errorf("pushover notification failed.")
	}
	return nil
}
コード例 #3
0
ファイル: home-test.go プロジェクト: pvinis/homeserver
func sendNotification() bool {
	identity := pushover.Authenticate("ajUCEgKvd9QmeMKFHBmvwMct1DYytx", "iBzANa9RG4jhS3s9QK9MAGNruSoGSz")
	sent := pushover.Notify(identity, "turn on server")
	if !sent {
		///log
		return false
	}
	return true
}
コード例 #4
0
ファイル: main.go プロジェクト: rphillips/gonotify
func PushoverBackend(file *ini.File, event *string, text *string) {
	api_key, ok := file.Get("pushover", "api_key")
	if !ok {
		log.Fatal("Pushover API key not found")
	}

	user_key, ok := file.Get("pushover", "user_key")
	if !ok {
		log.Fatal("Pushover User key not found")
	}

	identity := pushover.Authenticate(api_key, user_key)
	sent := pushover.Notify(identity, fmt.Sprintf("%s:%s", event, text))
	if !sent {
		fmt.Println("[!] notification failed.")
		os.Exit(1)
	}
}