sentrygrpc

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sentrygrpc provides interceptor for gRPC server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportAlways

func ReportAlways(err error) bool

ReportAlways returns true if err is non-nil.

func SentryStreamServerInterceptor

func SentryStreamServerInterceptor(
	options ...InterceptorOption,
) grpc.StreamServerInterceptor

SentryStreamServerInterceptor is a middleware implementation of a GRPC server interceptor for panics in Stream operations TODO: NEEDS TO BE TESTED

func SentryUnaryServerInterceptor

func SentryUnaryServerInterceptor(options ...InterceptorOption) grpc.UnaryServerInterceptor

SentryUnaryServerInterceptor is a middleware implementation of a GRPC server interceptor for panics in Unary operations

Types

type InterceptorOption

type InterceptorOption func(*option)

InterceptorOption configuration overrider.

func WithRelog

func WithRelog(reLog bool) InterceptorOption

WithReport configures which errors to report on.

func WithRepanic

func WithRepanic(repanic bool) InterceptorOption

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

func WithReportOn

func WithReportOn(repOn ReportOn) InterceptorOption

WithReportOn configures which errors to report on.

type ReportOn

type ReportOn func(error) bool

ReportOn decides error should be reported to sentry.

func ReportOnCodes

func ReportOnCodes(codes ...ferrors.ErrorCode) ReportOn

ReportOnCodes returns true if ferror code matches culprit error code.

Jump to

Keyboard shortcuts

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