/go-dmswebhooks

Dead Man's Snitch Webhook Handler for Go

Primary LanguageGo

Receiver for Dead Man's Snitch Webhooks

GoDoc

This package provides a net/http compatible handler to for parsing and receiving Alert Webhooks from Dead Man's Snitch.

Webhook Docs

Basic Usage:

// NewHandler takes a callback function which is called when alerts are received
handler := dmswebhooks.NewHandler(
  func(alert *dmswebhooks.Alert) error {
    if(alert.Type == dmswebhooks.TypeSnitchReporting) {
      fmt.Println("🎉")
    }

    return nil
  }
)

# Handler will process requests at root (/)
http.ListenAndServe(":8080", handler)

Hipchat Example

For a more complete (and fully functional example) we've built a basic Hipchat alerter.