Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowCORS ¶
func AllowCORS() gin.HandlerFunc
func GetHubFromContext ¶ added in v1.0.3
GetHubFromContext retrieves attached *sentry.Hub instance from gin.Context.
func New ¶ added in v1.0.3
func New(options Options) gin.HandlerFunc
New returns a function that satisfies gin.HandlerFunc interface It can be used with Use() methods.
func PanicLogger ¶
func PanicLogger() gin.HandlerFunc
func RecoveryWithWriter ¶
func RecoveryWithWriter(out io.Writer) gin.HandlerFunc
RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
func SentryRecover ¶ added in v1.0.3
func SentryRecover(isUseSentry bool) gin.HandlerFunc
Types ¶
type Options ¶ added in v1.0.3
type Options struct {
// Repanic configures whether Sentry should repanic after recovery, in most cases it should be set to true,
// as gin.Default includes it's own Recovery middleware what handles http responses.
Repanic bool
// WaitForDelivery configures whether you want to block the request before moving forward with the response.
// Because Gin's default Recovery handler doesn't restart the application,
// it's safe to either skip this option or set it to false.
WaitForDelivery bool
// Timeout for the event delivery requests.
Timeout time.Duration
}
Click to show internal directories.
Click to hide internal directories.