Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gravityblast/traffic-airbrake
Traffic Airbrake Middleware #go, #golang
https://github.com/gravityblast/traffic-airbrake
Last synced: about 9 hours 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 (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-09T23:02:51.000Z (almost 11 years ago)
- Last Synced: 2023-07-10T10:04:00.746Z (over 1 year ago)
- Language: Go
- Size: 133 KB
- Stars: 6
- Watchers: 3
- 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 mainimport (
"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()
}
```