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 ¶
Click to show internal directories.
Click to hide internal directories.