orchestration

package
v0.3.4 Latest Latest
Warning

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

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

Documentation

Overview

Package orchestration provides orchestration for executing commands across multiple packs. It owns the outer loop: discover packs → execute command → aggregate results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	// ExecuteForPack executes the command for a single pack.
	// This is called by the pack pipeline for each discovered pack.
	ExecuteForPack(pack types.Pack, opts Options) (*PackResult, error)

	// Name returns the command name for logging and identification
	Name() string
}

Command defines the interface for pack-level commands. Each command implements how to process a single pack.

type Options

type Options struct {
	// DotfilesRoot is the path to the root of the dotfiles directory
	DotfilesRoot string

	// DryRun specifies whether to perform a dry run without making changes
	DryRun bool

	// FileSystem to use (optional, defaults to OS filesystem)
	FileSystem types.FS

	// Additional command-specific options can be embedded
	CommandOptions interface{}
}

Options contains execution options for the pack pipeline.

type PackResult

type PackResult struct {
	// Pack that was processed
	Pack types.Pack

	// Success indicates if the command succeeded for this pack
	Success bool

	// Error if the command failed
	Error error

	// CommandSpecificResult allows commands to return additional data
	CommandSpecificResult interface{}
}

PackResult contains the execution result for a single pack.

func ExecuteSingle

func ExecuteSingle(command Command, pack types.Pack, opts Options) (*PackResult, error)

ExecuteSingle executes a command for a single pack without pack discovery. This is useful for commands that already have a specific pack.

type Result

type Result struct {
	// Command that was executed
	Command string

	// TotalPacks is the number of packs discovered
	TotalPacks int

	// SuccessfulPacks is the number of packs successfully processed
	SuccessfulPacks int

	// FailedPacks is the number of packs that failed
	FailedPacks int

	// PackResults contains individual results for each pack
	PackResults []PackResult

	// Error if the entire pipeline failed
	Error error
}

Result contains the aggregated results from executing a command across multiple packs.

func Execute

func Execute(command Command, packNames []string, opts Options) (*Result, error)

Execute runs the pack pipeline for a given command. It discovers packs, executes the command for each pack, and aggregates results.

Jump to

Keyboard shortcuts

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