Documentation
¶
Overview ¶
---------------------------------------------------------------------//
GNU GENERAL PUBLIC LICENSE //
Version 2, June 1991 //
//
Copyright (C) Wells Hsu, wellshsu@outlook.com, All rights reserved. // Everyone is permitted to copy and distribute verbatim copies // of this license document, but changing it is not allowed. //
SEE LICENSE.md FOR MORE DETAILS. //
---------------------------------------------------------------------// Package xrun: 协程上层封装,包括异常捕捉、闪退重启、消耗时间、调用堆栈等功能.
Index ¶
- Constants
- func Caller(stack int, fullpath bool) string
- func Caught(exit bool, handler ...func(string, int))
- func Elapse(stack int, callback ...func()) func()
- func Exec(fun interface{}, params ...interface{})
- func Run(fun interface{}, params ...interface{})
- func StackTrace(stack int, err interface{}) (string, int)
Constants ¶
View Source
const (
UNKONWN_SOURCE = "[?]"
)
Variables ¶
This section is empty.
Functions ¶
func Elapse ¶
func Elapse(stack int, callback ...func()) func()
计算函数执行消耗的时间,在起始处调用defer Elapse(stack)()
stack: 堆栈层级(0为当前层)
func Exec ¶
func Exec(fun interface{}, params ...interface{})
协程封装器(panic不会引起crash,recover后该goroutine结束)
func Run ¶
func Run(fun interface{}, params ...interface{})
协程封装器(panic不会引起crash,recover后重启该goroutine)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.