core

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJob

func AddJob(spec string, cmd func()) error

func Context

func Context() context.Context

Context 获取全局顶层context

func GetContextWithCancel

func GetContextWithCancel() (context.Context, context.CancelFunc)

func RegisterHook

func RegisterHook(name string, cb func()) context.Context

RegisterHook 注册系统退出的hook

func Shutdown

func Shutdown()

Shutdown 关闭应用程序, 通知所有协程退出

func WaitForShutdown

func WaitForShutdown(d ...int)

WaitForShutdown 阻塞等待关闭信号

如果传入d, 视为等待d秒结束
如果没有传值, 则默认为等待信号

Types

This section is empty.

Jump to

Keyboard shortcuts

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