sentry

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrentHub     = sentry.CurrentHub
	ConfigureScope = sentry.ConfigureScope
)

Exported functions from sentry's original package to avoid importing it

Functions

func CaptureException

func CaptureException(hub *sentry.Hub, err error)

func NotifyError added in v0.0.4

func NotifyError(err error, contexts map[string]sentry.Context)

NotifyError to sentry

func NotifyErrorOnce added in v0.0.4

func NotifyErrorOnce(err error, contexts map[string]sentry.Context)

NotifyErrorOnce will send an error if it has never occurred in this current process

func NotifyIfPanic

func NotifyIfPanic()

NotifyIfPanic recovers from the panic and sends the error to Sentry, panicking shortly thereafter

func SentryMiddleware

func SentryMiddleware(handler http.Handler) http.Handler

func Setup

func Setup(dsn string, release, environment, name string, opts ...Option)

Setup sentry global scope, and add some initial context tags: environment and application name

Types

type ClientOptions added in v0.1.1

type ClientOptions = sentry.ClientOptions

type Context added in v0.0.5

type Context = sentry.Context

type Hasher added in v0.1.3

type Hasher interface {
	Hash() string
}

Hasher transforms the object into an unique hash string

type Option

type Option func(*sentry.Hub)

func WithClientOptions added in v0.1.1

func WithClientOptions(opts ClientOptions) Option

func WithTag

func WithTag(key, value string) Option

func WithTags

func WithTags(tags map[string]string) Option

func WithTransport added in v0.1.1

func WithTransport(transport sentry.Transport) Option

type Scope added in v0.1.1

type Scope = sentry.Scope

type Typeable

type Typeable interface {
	Type() string
}

Typeable interface is used to define a type for the error, to show in Sentry instead of the usual fmt.Wrap or errors.withStack

type User added in v0.1.1

type User = sentry.User

Jump to

Keyboard shortcuts

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