function

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: GPL-3.0 Imports: 7 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPanic

func CheckPanic()

CheckPanic 检查错误

func GetCallerFuncName

func GetCallerFuncName(seps ...rune) string

GetCallerFuncName 获取调用者名称

func GetCurrentFuncName

func GetCurrentFuncName(seps ...rune) string

GetCurrentFuncName 获取当前方法名称

func GetFunctionName

func GetFunctionName(i interface{}, seps ...rune) string

GetFunctionName 获取函数名称

func InvokeFunc

func InvokeFunc(fn interface{}, args ...interface{}) interface{}

InvokeFunc 调用函数:fn要调用的方法;args方法参数

func InvokeTicker

func InvokeTicker(interval time.Duration, runRightNow bool, name string, fn interface{}, args ...interface{})

InvokeTicker 定时调用函数:interval时间间隔;runRightNow是否立即执行一次;name方法名称;fn要调用的方法;args方法参数

func InvokeTickerEx

func InvokeTickerEx(interval time.Duration, deadline time.Time, stop <-chan bool,
	runRightNow bool, name string, fn interface{}, args ...interface{})

InvokeTickerEx 定时调用函数:interval时间间隔;deadline过期时间;stop停止执行控制通道;runRightNow是否立即执行一次;name方法名称;fn要调用的方法;args方法参数

Types

type FuncContext

type FuncContext struct {
	// contains filtered or unexported fields
}

FuncContext context of function

type FuncContextMap

type FuncContextMap struct {
	// contains filtered or unexported fields
}

FuncContextMap map for FuncContext

func NewFuncContextMap

func NewFuncContextMap() *FuncContextMap

NewFuncContextMap returns new instance of FuncContextMap

func (*FuncContextMap) InvokeFunc

func (rm *FuncContextMap) InvokeFunc(name string, fn interface{}, args ...interface{}) interface{}

InvokeFunc 调用函数:name方法名称;fn要调用的方法;args方法参数

func (*FuncContextMap) InvokeFuncWithTimeout

func (rm *FuncContextMap) InvokeFuncWithTimeout(timeout time.Duration, name string, fn interface{}, args ...interface{}) interface{}

InvokeFuncWithTimeout 调用函数:timeout超时时间;name方法名称;fn要调用的方法;args方法参数

func (*FuncContextMap) StartTicker

func (rm *FuncContextMap) StartTicker(interval time.Duration, runRightNow bool, name string, fn interface{}, args ...interface{})

StartTicker 定时执行任务:interval时间间隔;runRightNow是否执行一次;name方法名称;fn要调用的方法;args方法参数

func (*FuncContextMap) StartTickerWithDeadline

func (rm *FuncContextMap) StartTickerWithDeadline(interval time.Duration, deadline time.Time,
	runRightNow bool, name string, fn interface{}, args ...interface{})

StartTickerWithDeadline 定时执行任务:interval时间间隔;deadline过期时间;runRightNow是否执行一次;name方法名称;fn要调用的方法;args方法参数

func (*FuncContextMap) StopFunc

func (rm *FuncContextMap) StopFunc(name string)

StopFunc 停止routine:name方法名称

Jump to

Keyboard shortcuts

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