startup

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 startup provides beautiful initialization 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 initialization with progress display

func NewManager

func NewManager() *Manager

NewManager creates a new startup manager

func (*Manager) AddTask

func (m *Manager) AddTask(task Task)

AddTask adds an initialization task

func (*Manager) OnComplete

func (m *Manager) OnComplete(fn func())

OnComplete sets the callback for when all tasks complete

func (*Manager) RunWithProgress

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

RunWithProgress displays a progress bar while executing tasks

type Task

type Task struct {
	Name        string
	Description string
	Execute     func() error  // Function to execute the task
	Duration    time.Duration // Expected duration for visual effect
}

Task represents an initialization task

Jump to

Keyboard shortcuts

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