Categorygithub.com/zy4/scout
repositorypackage
0.0.0-20191119175005-4c3b0cbc1e83
Repository: https://github.com/zy4/scout.git
Documentation: pkg.go.dev

# README

scout

scout is a middleware for the chi-router to report events to sentry.io using the sentry-go client.

The sentry-go client must be initialized with sentry.Init.

This middleware also replaces middleware.Recoverer which should not be used alongside with this middleware.

Here is an example on how to use the middleware:

import (
	"net/http"

	"github.com/go-chi/chi"
	"github.com/zy4/scout"
)

r := chi.NewRouter()

// Use the middleware in the router
r.Use(scout.SentryRecovery)

r.Get("/", func(w http.ResponseWriter, r *http.Request) {
    panic("caught")
})

Attribution

scout was created to emulate the raven-go middleware raven-chi for the official sentry-go SDK since raven-go is deprecated.