rtpanic

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package rtpanic wraps panic handling during golang app panic.

Index

Constants

View Source
const (
	StackTraceSize = 4096
)

Variables

This section is empty.

Functions

func Recover

func Recover(recoverCallback, cleanupCallback RecoverCallback)

Recover used to hook a on-panic-function. @RecoverCallback: 复活函数, 即如果某个 goroutine panic 后, 可以指定某个函数, 继续复活该 goroutine @cleanupCallback: 清理/善后回调函数, 比如上报 panic 信息, 现场清理等等 TRICK: 尽量将这些回调定义成本地函数, 这样便于处理现场, 比如 recoverCallback:.

Types

type RecoverCallback

type RecoverCallback func(info []byte, err error)

Jump to

Keyboard shortcuts

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