https://github.com/gravityblast/traffic-airbrake
Traffic Airbrake Middleware #go, #golang
https://github.com/gravityblast/traffic-airbrake
Last synced: about 1 year ago
JSON representation
Traffic Airbrake Middleware #go, #golang
- Host: GitHub
- URL: https://github.com/gravityblast/traffic-airbrake
- Owner: gravityblast
- License: mit
- Created: 2013-10-14T19:49:16.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-09T23:02:51.000Z (over 12 years ago)
- Last Synced: 2025-04-12T04:09:12.075Z (about 1 year ago)
- Language: Go
- Size: 133 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Traffic Airbrake Middleware
Package airbrake implements a [Traffic](https://github.com/pilu/traffic) Middleware for [Airbrake](http://airbrake.io).
This is a Middleware for [Traffic](https://github.com/pilu/traffic).
It is base on [@tobi](https://github.com/tobi)'s [Airbrake library](https://github.com/tobi/airbrake-go).
## Example:
```go
package main
import (
"os"
"fmt"
"time"
"net/http"
"github.com/pilu/traffic"
"github.com/pilu/traffic-airbrake"
)
func rootHandler(w traffic.ResponseWriter, r *http.Request) {
err := fmt.Sprintf("Error at %v", time.Now())
panic(err)
}
func main() {
traffic.SetVar("env", "production")
router := traffic.New()
router.Use(airbrake.New(os.Getenv("AIRBRAKE_API_KEY")))
// Routes
router.Get("/", rootHandler)
router.Run()
}
```