// Run notifications a line to the terminal func (d NotificationDriver) Run(args RunArgs) error { var buff bytes.Buffer tmpl, err := templates.New(d.line + "\n") if err != nil { return err } if err := tmpl.Execute(&buff, args); err != nil { return err } notification := gnotifier.Notification("ASSH", buff.String()) notification.GetConfig().Expiration = 3000 notification.GetConfig().ApplicationName = "assh" return notification.Push() }
func main() { results := asyncHTTPGets(urls) for _ = range urls { result := <-results var message string if result.err != nil { message = result.err.Error() } else { message = result.response.Status } notification := gnotifier.Notification(result.url, message) notification.GetConfig().Expiration = 2000 notification.GetConfig().ApplicationName = "monitor-app" notification.Push() } }