noopraven

package module
v0.0.0-...-5d19926 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2015 License: MIT Imports: 1 Imported by: 0

README

noop-raven

Build Status

This is an Interface and a no-op implementation for Raven.

This is useful if you want to drop a Raven client instance into some code without having to always check if it's enabled or not when using it.

Installation

go get github.com/bigcommerce/noopraven-go

Usage

Import:

import "github.com/bigcommerce/noopraven-go"
import "github.com/getsentry/raven-go"

...

var ravenClient noopraven.RavenClient
if ravenEnabled {
    var err error
    ravenClient, err = raven.NewClient(dsn, nil)
    // ...
} else {
    ravenClient = &noopraven.NoopRavenClient{}
}

// use ravenClient whether it's enabled or not

// use the noopraven.RavenClient interface type for arguments in your
// functions which expect a raven client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopRavenClient

type NoopRavenClient struct {
}

func (*NoopRavenClient) Capture

func (client *NoopRavenClient) Capture(packet *raven.Packet, captureTags map[string]string) (eventID string, ch chan error)

func (*NoopRavenClient) CaptureError

func (client *NoopRavenClient) CaptureError(err error, tags map[string]string, interfaces ...raven.Interface) string

func (*NoopRavenClient) CaptureErrorAndWait

func (client *NoopRavenClient) CaptureErrorAndWait(err error, tags map[string]string, interfaces ...raven.Interface) string

func (*NoopRavenClient) CaptureMessage

func (client *NoopRavenClient) CaptureMessage(message string, tags map[string]string, interfaces ...raven.Interface) string

func (*NoopRavenClient) CapturePanic

func (client *NoopRavenClient) CapturePanic(f func(), tags map[string]string, interfaces ...raven.Interface) (err interface{}, errorID string)

func (*NoopRavenClient) Close

func (client *NoopRavenClient) Close()

func (*NoopRavenClient) ProjectID

func (client *NoopRavenClient) ProjectID() string

func (*NoopRavenClient) Release

func (client *NoopRavenClient) Release() string

func (*NoopRavenClient) SetDSN

func (client *NoopRavenClient) SetDSN(dsn string) error

func (*NoopRavenClient) SetRelease

func (client *NoopRavenClient) SetRelease(release string)

func (*NoopRavenClient) URL

func (client *NoopRavenClient) URL() string

func (*NoopRavenClient) Wait

func (client *NoopRavenClient) Wait()

type RavenClient

type RavenClient interface {
	Capture(packet *raven.Packet, captureTags map[string]string) (eventID string, ch chan error)
	CaptureError(err error, tags map[string]string, interfaces ...raven.Interface) string
	CaptureErrorAndWait(err error, tags map[string]string, interfaces ...raven.Interface) string
	CaptureMessage(message string, tags map[string]string, interfaces ...raven.Interface) string
	CapturePanic(f func(), tags map[string]string, interfaces ...raven.Interface) (err interface{}, errorID string)
	Close()
	ProjectID() string
	Release() string
	SetDSN(dsn string) error
	SetRelease(release string)
	URL() string
	Wait()
}

Jump to

Keyboard shortcuts

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