Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOptions ¶
func BuildOptions(ff ...Option) options
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 ¶
WithRepanic configures whether to panic again after recovering from a panic. Use this option if you have other panic handlers.
func WithReportOn ¶
WithReportOn configures whether to report on errors.
type ReportOn ¶
ReportOn decides error should be reported to sentry.
func ReportOnCodes ¶
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()