processor

package
v0.0.12-beta Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package processor provides functionality for managing tool installations and updates. It handles concurrent processing of tools, caching of tool versions, and progress tracking during downloads. The package coordinates the entire lifecycle of tool installation from configuration to execution.

Package processor handles the processing of tool installations and management.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorColors   = text.Colors{text.FgRed}
	InfoColors    = text.Colors{text.FgYellow}
	SuccessColors = text.Colors{text.FgGreen}
	WarningColors = text.Colors{text.FgHiYellow}
	DefaultColors = text.Colors{text.BgBlack}
)

Common color providers for different result states.

View Source
var ErrToolsFailedToInstall = errors.New("tools failed to install")

ErrToolsFailedToInstall is returned when one or more tools failed to install.

Functions

This section is empty.

Types

type HeaderConfig

type HeaderConfig struct {
	// Name is the header column name.
	Name any

	// WidthMax is the maximum width for the column.
	WidthMax int

	// Bold indicates if the header should be displayed in bold.
	Bold bool
}

HeaderConfig defines the configuration for a table header column.

type Processor

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

Processor handles tool installation and management.

func New

func New(toolsList tools.Tools, cfg *config.Config, log *logger.Logger) *Processor

New creates a new Processor.

func (*Processor) Process

func (p *Processor) Process(tags tags.IncludeTags, dry bool) error

Process installs and manages tools with the given tags.

func (*Processor) UpdateCache

func (p *Processor) UpdateCache(tool *tool.Tool)

UpdateCache attempts to update the cache with tool version information.

type ResultTable

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

ResultTable encapsulates the table creation and rendering logic for displaying tool processing results.

func NewResultTable

func NewResultTable(headers ...HeaderConfig) *ResultTable

NewResultTable creates a new result table with properly configured styling.

func (*ResultTable) AddResult

func (rt *ResultTable) AddResult(tool *tool.Tool, color text.Colors, message string)

AddResult adds a single result to the table with specified coloring.

func (*ResultTable) Clear

func (rt *ResultTable) Clear()

Clear removes all rows from the table (except the header).

func (*ResultTable) Render

func (rt *ResultTable) Render() string

Render returns the rendered table as a string.

Jump to

Keyboard shortcuts

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