Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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()
}
```