airbrake

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package airbrake provides Airbrake integration.

Create a new handler as you would create a gobrake.Notifier:

projectID  := int64(1)
projectKey := "key"

handler := airbrake.NewHandler(projectID, projectKey)

If you need access to the underlying Notifier instance (or need more advanced construction), you can access it from the handler:

handler.Notifier.SetHost("https://errbit.domain.com")

By default Gobrake sends errors asynchronously and expects to be closed before the program finishes:

func main() {
	defer handler.Close()
}

If you want to Flush notices you can do it as you would with Gobrake's notifier or you can configure the handler to send notices synchronously:

handler.SendSynchronously = true

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Notifier          *gobrake.Notifier
	SendSynchronously bool
}

Handler is responsible for sending errors to Airbrake/Errbit.

func NewHandler

func NewHandler(projectID int64, projectKey string) *Handler

NewHandler creates a new Airbrake handler.

func (*Handler) Close

func (h *Handler) Close() error

Close closes the underlying Airbrake instance.

func (*Handler) Handle

func (h *Handler) Handle(err error)

Handle calls the underlying Airbrake notifier.

Jump to

Keyboard shortcuts

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