sentry

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close flushes the Client's buffer and releases the associated ressources. The Client and all the cloned Clients must not be used afterward.

func InitSentry

func InitSentry(cfg Config) error

InitSentry creates a new Sentry client.

func Recoverer

func Recoverer(handler http.Handler) http.Handler

Recoverer wraps the stdlib net/http Mux.

func RecoveryHandler

func RecoveryHandler(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

RecoveryHandler wraps the stdlib net/http Mux.

Types

type Client

type Client 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
	Close()
}

Client is a client to send logs to Sentry.

func Sentry

func Sentry() Client

Sentry returns the singleton Sentry client implementation.

type Config

type Config struct {
	Enabled bool
	DSN     string
	Labels  map[string]string
}

Config stores Sentry configuration.

type NoopClient

type NoopClient struct{}

A NoopClient is a trivial, minimum overhead implementation of Client for which all operations are no-ops.

func (*NoopClient) Capture

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

Capture implements Client interface.

func (*NoopClient) CaptureError

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

CaptureError implements Client interface.

func (*NoopClient) Close

func (nc *NoopClient) Close()

Close implements Client interface.

Jump to

Keyboard shortcuts

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