Skip to content

gogearbox/sentry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


DeepSource

sentry middleware

Supported Go versions & installation

⚙️ gearbox requires version 1.14 or higher of Go (Download Go)

Just use go get to download and install gearbox

go get -u github.com/gogearbox/gearbox
go get u- github.com/gogearbox/sentry

Examples

package main

import (
	  "github.com/getsentry/sentry-go"
	  "github.com/gogearbox/gearbox"
    sentrymiddleware "github.com/gogearbox/sentry"
)

func main() {
	// Setup gearbox
	gb := gearbox.New()

	// Initialize sentry
	_ = sentry.Init(sentry.ClientOptions{
		Dsn:              PROJECT_DSN,
	})

	// Register the sentry middleware for all requests
	gb.Use(sentrymiddleware.New())

	// Define your handler
	gb.Post("/hello", func(ctx gearbox.Context) {
		panic("There is an issue")
	})

	// Start service
	gb.Start(":3000")
}