Skip to content

zy4/scout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published

Languages