gobrake

package module
v1.0.0-...-f12667a Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2014 License: BSD-3-Clause Imports: 12 Imported by: 7

README

Airbrake Golang Notifier Build Status

Example

import "gopkg.in/airbrake/gobrake.v1"

airbrake = gobrake.NewNotifier(projectId, apiKey)
airbrake.SetContext("environment", "production")

if err := processRequest(req); err != nil {
   go airbrake.Notify(err, req)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Type      string       `json:"type"`
	Message   string       `json:"message"`
	Backtrace []StackFrame `json:"backtrace"`
}

type Notice

type Notice struct {
	Notifier notifier               `json:"notifier"`
	Errors   []Error                `json:"errors"`
	Context  map[string]string      `json:"context"`
	Env      map[string]interface{} `json:"environment"`
	Session  map[string]interface{} `json:"session"`
	Params   map[string]interface{} `json:"params"`
}

func NewNotice

func NewNotice(e interface{}, stack []StackFrame, req *http.Request) *Notice

type Notifier

type Notifier struct {
	Client      *http.Client
	StackFilter func(string, int, string, string) bool
	// contains filtered or unexported fields
}

func NewNotifier

func NewNotifier(projectID int64, key string) *Notifier

func (*Notifier) Notice

func (n *Notifier) Notice(e interface{}, req *http.Request, startFrame int) *Notice

func (*Notifier) Notify

func (n *Notifier) Notify(e interface{}, req *http.Request) error

func (*Notifier) SendNotice

func (n *Notifier) SendNotice(notice *Notice) error

func (*Notifier) SetContext

func (n *Notifier) SetContext(name, value string)

type StackFrame

type StackFrame struct {
	File string `json:"file"`
	Line int    `json:"line"`
	Func string `json:"function"`
}

Jump to

Keyboard shortcuts

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