Documentation
¶
Index ¶
Constants ¶
View Source
const ( PriorityIngress = 0 PriorityDefault = 100 PriorityWorkers = 200 PriorityDatabase = 300 PriorityCritical = 400 )
Variables ¶
This section is empty.
Functions ¶
func AddHook ¶
func AddHook(label string, fn func())
AddHook registers a shutdown hook with default priority
func AddHookWithPriority ¶
AddHookWithPriority registers a shutdown hook with specific priority
func RecoverAndShutdown ¶
func RecoverAndShutdown()
RecoverAndShutdown is intended to be deferred in main(). On panic it runs all shutdown hooks and restores terminal state, then re-panics so the stack trace is preserved.
func RunAndWait ¶
RunAndWait runs the provided function and then waits for shutdown signal
func SetTerminalRestoreFunc ¶
func SetTerminalRestoreFunc(fn func())
SetTerminalRestoreFunc registers a callback that performs full terminal state restoration (e.g. term.Restore with saved state). Called automatically during Shutdown, force-exit, and RecoverAndShutdown.
func WaitForSignal ¶
func WaitForSignal()
WaitForSignal waits for interrupt signals and triggers shutdown
Types ¶
Click to show internal directories.
Click to hide internal directories.