-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.go
35 lines (28 loc) · 740 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
Package airbrake implements a Traffic Middleware for Airbrake.
This is a Middleware for Traffic (https://github.com/pilu/traffic).
It is base on @tobi's Airbrake library (https://github.com/tobi/airbrake-go).
Example:
package main
import (
"os"
"fmt"
"time"
"net/http"
"github.com/pilu/traffic"
"github.com/pilu/traffic-airbrake"
)
func rootHandler(w traffic.ResponseWriter, r *traffic.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()
}
*/
package airbrake