Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHandler ¶
func DefaultHandler(reason string)
DefaultHandler is the default termination behavior It triggers a panic which will be caught by the graceful shutdown handler
Types ¶
type Handler ¶
type Handler func(reason string)
Handler defines the function signature for termination handlers
type ManagerShutdown ¶
type ManagerShutdown struct {
// contains filtered or unexported fields
}
ManagerShutdown handles termination behavior
func New ¶
func New() *ManagerShutdown
New creates a new termination manager with the default handler
func (*ManagerShutdown) SetHandler ¶
func (m *ManagerShutdown) SetHandler(handler Handler)
SetHandler updates the termination handler This should be called during application startup, before any validation occurs
func (*ManagerShutdown) Terminate ¶
func (m *ManagerShutdown) Terminate(reason string)
Terminate invokes the termination handler This will trigger the application to gracefully shut down
Click to show internal directories.
Click to hide internal directories.