processor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package processor handles the processing of tool installations and management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorDetail added in v0.1.15

type ErrorDetail struct {
	Error   error
	Tool    string
	Message string
}

ErrorDetail contains detailed error information for a failed tool.

type Processor

type Processor struct {
	Options    []tool.ResolveOption
	NoDownload bool
	// contains filtered or unexported fields
}

Processor is a thin orchestrator that coordinates tool processing.

func New

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

New creates a new Processor.

func (*Processor) Process

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

Process installs and manages tools with the given tags. Returns the aggregated summary and any infrastructure error (e.g. cache load failure).

type Result added in v0.1.15

type Result struct {
	Error    error
	Tool     *tool.Tool
	Metadata map[string]any
	Message  string
	Status   Status
}

Result represents the outcome of a tool operation.

type Status added in v0.1.15

type Status int

Status represents the possible states of a tool operation.

const (
	// StatusOK indicates a successful operation.
	StatusOK Status = iota
	// StatusSkipped indicates the operation was skipped.
	StatusSkipped
	// StatusFailed indicates the operation failed.
	StatusFailed
)

type Summary added in v0.1.15

type Summary struct {
	Results    []Result
	Errors     []ErrorDetail
	Total      int
	Successful int
	Failed     int
	Skipped    int
}

Summary provides an aggregated view of all results.

func (Summary) ByStatus added in v0.1.15

func (s Summary) ByStatus(status Status) []Result

ByStatus returns all results with the given status.

func (Summary) DetailedError added in v0.1.15

func (s Summary) DetailedError() error

DetailedError returns a detailed error with all failure messages.

func (Summary) Error added in v0.1.15

func (s Summary) Error() error

Error returns an aggregated error if there are any failures.

func (Summary) HasErrors added in v0.1.15

func (s Summary) HasErrors() bool

HasErrors returns true if there are any failed results.

Jump to

Keyboard shortcuts

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