Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 949 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 949 Bytes

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)

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