rollbar

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

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 9 Imported by: 0

README

Rollbar handler

GitHub Workflow Status Codecov Go Report Card Go Version go.dev reference

Error handler integration for Rollbar.

Installation

go get emperror.dev/handler/rollbar

Usage

package main

import (
	"emperror.dev/handler/rollbar"
)

func main() {
    	token := "token"

	handler := rollbar.New(token, "env", "version", "host", "serverRoot")
}

Development

When all coding and testing is done, please run the test suite:

$ make check

License

The MIT License (MIT). Please see License File for more information.

Documentation

Overview

Package rollbar provides Rollbar integration.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is responsible for sending errors to Rollbar.

func New

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

New creates a new handler.

Example
package main

import (
	rollbarhandler "emperror.dev/handler/rollbar"
)

func main() {
	token := "token"

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

}
Output:

func NewFromClient

func NewFromClient(client *rollbar.Client) *Handler

NewFromClient creates a new handler from a client instance.

Example
token := "token"

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

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.

Jump to

Keyboard shortcuts

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