context

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionContext

type ExecutionContext struct {
	// Command is the command being executed (deploy, install, etc.)
	Command string

	// PackResults contains results organized by pack
	PackResults map[string]*PackExecutionResult

	// StartTime is when execution began
	StartTime time.Time

	// EndTime is when execution completed
	EndTime time.Time

	// DryRun indicates if this was a dry run
	DryRun bool

	// TotalHandlers is the total count of handlers across all packs
	TotalHandlers int

	// CompletedHandlers is the count of successfully completed handlers
	CompletedHandlers int

	// FailedHandlers is the count of failed handlers
	FailedHandlers int

	// SkippedHandlers is the count of skipped handlers
	SkippedHandlers int

	// Messages contains any user-facing messages to display after execution
	Messages []string
}

ExecutionContext tracks the complete context and results of a command execution

func (*ExecutionContext) GetPackResult

func (ec *ExecutionContext) GetPackResult(packName string) (*PackExecutionResult, bool)

GetPackResult retrieves a pack result by name

type HandlerResult

type HandlerResult struct {
	// HandlerName is the name of the Handler (symlink, homebrew, etc.)
	HandlerName string

	// Files are the files processed by this Handler
	Files []string

	// Status is the final status after execution
	Status execution.OperationStatus

	// Error contains any error that occurred
	Error error

	// StartTime is when the Handler execution began
	StartTime time.Time

	// EndTime is when the Handler execution completed
	EndTime time.Time

	// Message provides additional context
	Message string

	// Pack is the pack this Handler belongs to
	Pack string

	// Operations are the operations that were executed
	// TODO: Type this properly when operations package is available
	Operations []interface{}
}

HandlerResult tracks the result of a single Handler execution This is the atomic unit - if ANY operation in a Handler fails, the Handler fails

type Manager

type Manager struct{}

Manager handles the business logic for ExecutionContext operations. It provides methods to manipulate ExecutionContext without embedding business logic in the data structure itself.

func NewManager

func NewManager() *Manager

NewManager creates a new execution context manager

func (*Manager) AddPackResult

func (m *Manager) AddPackResult(ec *ExecutionContext, packName string, result *PackExecutionResult)

AddPackResult adds or updates a pack result and recalculates totals

func (*Manager) CompleteContext

func (m *Manager) CompleteContext(ec *ExecutionContext)

CompleteContext marks the execution as complete

func (*Manager) CreateContext

func (m *Manager) CreateContext(command string, dryRun bool) *ExecutionContext

CreateContext creates a new execution context

type PackExecutionResult

type PackExecutionResult struct {
	// Pack is the pack being executed
	Pack *types.Pack

	// HandlerResults contains all Handler results and their status
	HandlerResults []*HandlerResult

	// Status is the aggregated status for this pack
	Status execution.ExecutionStatus

	// StartTime is when this pack's execution began
	StartTime time.Time

	// EndTime is when this pack's execution completed
	EndTime time.Time

	// TotalHandlers in this pack
	TotalHandlers int

	// CompletedHandlers in this pack
	CompletedHandlers int

	// FailedHandlers in this pack
	FailedHandlers int

	// SkippedHandlers in this pack
	SkippedHandlers int
}

PackExecutionResult contains the execution results for a single pack

Jump to

Keyboard shortcuts

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