...

Package rollbarhandler

import "github.com/goph/emperror/handler/rollbarhandler"
Overview
Index
Examples

Overview ▾

Package rollbarhandler provides Rollbar integration.

type Handler

Handler is responsible for sending errors to Rollbar.

type Handler struct {
    // contains filtered or unexported fields
}

func New

func New(token, environment, codeVersion, serverHost, serverRoot string) *Handler

New creates a new handler.

Example

Code:

token := "token"

_ = rollbarhandler.New(token, "env", "version", "host", "serverRoot")

func NewFromClient

func NewFromClient(client *rollbar.Client) *Handler

NewFromClient creates a new handler from a client instance.

Example

Code:

token := "token"

_ = rollbarhandler.NewFromClient(rollbar.New(
    token,
    "env",
    "version",
    "host",
    "serverRoot",
))

func (*Handler) Close

func (h *Handler) Close() error

Close closes the underlying notifier and waits for asynchronous reports to finish.

func (*Handler) Handle

func (h *Handler) Handle(err error)

Handle sends the error to Rollbar.