shutdown

package module
v0.0.0-...-e621d65 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook interface {
	// WithSignals add more signals into hook
	// WithSignals 添加要监听的系统信号
	WithSignals(signals ...syscall.Signal) Hook

	Close(funcs ...func())
}

Hook a graceful shutdown hook, default with signals of SIGINT and SIGTERM Hook 定义了一个优雅关闭的钩子接口,默认监听 SIGINT 和 SIGTERM 信号 可通过 WithSignals 添加其他信号,并通过 Close 注册关闭时的处理函数

func NewHook

func NewHook() Hook

NewHook create a Hook instance

Jump to

Keyboard shortcuts

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