Versions in this module Expand all Collapse all v1 v1.0.0 Feb 1, 2026 Changes in this version + func Register(name string, callback ShutdownCallback) + func RegisterFunc(name string, fn func()) + func SetGlobal(h *Handler) + func Shutdown() + type Config struct + OnShutdownDone func(elapsed time.Duration, errors []error) + OnShutdownStart func() + Signals []os.Signal + Timeout time.Duration + func DefaultConfig() Config + type Coordinator struct + func NewCoordinator() *Coordinator + func (c *Coordinator) Add(h *Handler) + func (c *Coordinator) ShutdownAll() + func (c *Coordinator) WaitAll() + type GracefulServer interface + Shutdown func(ctx context.Context) error + type Handler struct + func Global() *Handler + func New(cfg Config) *Handler + func NewDefault() *Handler + func (h *Handler) Context() context.Context + func (h *Handler) Done() <-chan struct{} + func (h *Handler) IsShuttingDown() bool + func (h *Handler) ListenAndShutdown() <-chan struct{} + func (h *Handler) Register(name string, callback ShutdownCallback) + func (h *Handler) RegisterFunc(name string, fn func()) + func (h *Handler) RegisterServer(name string, server GracefulServer) + func (h *Handler) Shutdown() + func (h *Handler) ShutdownNow() + func (h *Handler) Trigger() + func (h *Handler) Wait() + func (h *Handler) WaitWithContext(ctx context.Context) + type ShutdownCallback func(ctx context.Context) error + type ShutdownResult struct + Elapsed time.Duration + Errors []error + func (r *ShutdownResult) HasErrors() bool + type TimeoutError struct + CallbackName string + func (e *TimeoutError) Error() string