sentry

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOptions

func BuildOptions(ff ...Option) options

func ReportAlways

func ReportAlways(err error) bool

ReportAlways returns true if err is non-nil.

Types

type Handler

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

func New

func New(options sentryhttp.Options) *Handler

New returns a struct that provides Handle and HandleFunc methods that satisfy http.Handler and http.HandlerFunc interfaces.

func (*Handler) HandleFunc

func (h *Handler) HandleFunc(handler http.HandlerFunc) http.HandlerFunc

HandleFunc wraps http.HandleFunc and recovers from caught panics.

func (*Handler) HandleHttpRouter

func (h *Handler) HandleHttpRouter(handler httprouter.Handle) httprouter.Handle

HandleFunc wraps http.HandleFunc and recovers from caught panics.

type Option

type Option func(*options)

Option configures reporting behavior.

func WithRepanic

func WithRepanic(b bool) Option

WithRepanic configures whether to panic again after recovering from a panic. Use this option if you have other panic handlers.

func WithReportOn

func WithReportOn(r ReportOn) Option

WithReportOn configures whether to report on errors.

type ReportOn

type ReportOn func(error) bool

ReportOn decides error should be reported to sentry.

func ReportOnCodes

func ReportOnCodes(cc ...codes.Code) ReportOn

ReportOnCodes returns true if error code matches on of the given codes.

type WrappedServerStream

type WrappedServerStream struct {
	grpc.ServerStream
	// WrappedContext is the wrapper's own Context. You can assign it.
	WrappedContext context.Context
}

WrappedServerStream is a thin wrapper around grpc.ServerStream that allows modifying context.

func WrapServerStream

func WrapServerStream(stream grpc.ServerStream) *WrappedServerStream

WrapServerStream returns a ServerStream that has the ability to overwrite context.

func (*WrappedServerStream) Context

func (w *WrappedServerStream) Context() context.Context

Context returns the wrapper's WrappedContext, overwriting the nested grpc.ServerStream.Context()

Jump to

Keyboard shortcuts

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