shutdown

package
v0.0.0-...-d80aada Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package shutdown provides graceful shutdown with progress display

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles graceful shutdown with progress display

func NewManager

func NewManager() *Manager

NewManager creates a new shutdown manager

func (*Manager) AddTask

func (m *Manager) AddTask(task Task)

AddTask adds a task to monitor during shutdown

func (*Manager) WaitWithProgress

func (m *Manager) WaitWithProgress(ctx context.Context) error

WaitWithProgress displays a progress bar while waiting for tasks to complete

type Task

type Task struct {
	Name        string
	Description string
	Check       func() bool // Returns true when complete
	Timeout     time.Duration
}

Task represents a shutdown task to be monitored

Jump to

Keyboard shortcuts

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