xrun

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: GPL-2.0 Imports: 8 Imported by: 0

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.                   //

---------------------------------------------------------------------//

Index

Constants

View Source
const (
	UNKONWN_SOURCE = "[?]"
)

Variables

This section is empty.

Functions

func Caller

func Caller(stack int, fullpath bool) string

获取函数调用堆栈信息,stack-堆栈层级,fullpath-全路径

func Caught

func Caught(exit bool, handler ...func(string, int))

捕捉goroutine的异常,exit-是否结束进程,handler-回调

func Elapse

func Elapse(stack int, callback ...func()) func()

计算函数执行消耗的时间,在起始处调用defer Elapse(stack)(),stack-堆栈层级(0为当前层)

func Exec

func Exec(fun interface{}, params ...interface{})

goroutine的wrapper(panic不会引起crash,recover后该goroutine结束)

func Run

func Run(fun interface{}, params ...interface{})

goroutine的wrapper(panic不会引起crash,recover后重启该goroutine)

func StackTrace

func StackTrace(stack int, err interface{}) (string, int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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