airbrake

package module
v0.0.0-...-b21b6b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2013 License: MIT Imports: 3 Imported by: 0

README

#Traffic Airbrake Middleware

Package airbrake implements a Traffic Middleware for Airbrake.

This is a Middleware for Traffic. It is base on @tobi's Airbrake library.

Example:

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AirbrakeMiddleware

type AirbrakeMiddleware struct{}

func New

func New(apiKey string) *AirbrakeMiddleware

func (*AirbrakeMiddleware) ServeHTTP

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL