core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionState

type ExecutionState struct {
	SetupName      string            `json:"setup_name"`
	SetupVersion   string            `json:"setup_version"`
	Platform       string            `json:"platform"`
	StartedAt      time.Time         `json:"started_at"`
	UpdatedAt      time.Time         `json:"updated_at"`
	CompletedSteps []string          `json:"completed_steps"`
	CurrentStep    string            `json:"current_step"`
	FailedFiles    []string          `json:"failed_files"`
	InstalledTools map[string]string `json:"installed_tools"`
}

ExecutionState represents the current state of an execution

type Executor

type Executor interface {
	Name() string
	Execute(ctx context.Context, file executors.ExecutionFile) (*executors.ExecutionResult, error)
	Validate(config map[string]interface{}) error
}

Executor defines the interface for all executors

type Runner

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

Runner manages the execution of an execution plan

func NewRunner

func NewRunner(plan *config.ExecutionPlan, stateFile string) (*Runner, error)

NewRunner creates a new runner

func (*Runner) Execute

func (r *Runner) Execute(ctx context.Context) error

Execute runs the execution plan

func (*Runner) RegisterExecutor

func (r *Runner) RegisterExecutor(name string, executor Executor) error

RegisterExecutor registers a custom executor

type StateManager

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

StateManager manages the execution state

func NewStateManager

func NewStateManager(filePath string) (*StateManager, error)

NewStateManager creates a new state manager

func (*StateManager) AddInstalledTool

func (sm *StateManager) AddInstalledTool(name, version string) error

AddInstalledTool records an installed tool and its version

func (*StateManager) IsStepCompleted

func (sm *StateManager) IsStepCompleted(stepID string) bool

IsStepCompleted checks if a step has been completed

func (*StateManager) Load

func (sm *StateManager) Load() (*ExecutionState, error)

Load loads the state from file

func (*StateManager) MarkStepCompleted

func (sm *StateManager) MarkStepCompleted(stepID string) error

MarkStepCompleted marks a step as completed

func (*StateManager) Reset

func (sm *StateManager) Reset() error

Reset removes the state file

func (*StateManager) Save

func (sm *StateManager) Save(state *ExecutionState) error

Save saves the state to file

func (*StateManager) SetCurrentStep

func (sm *StateManager) SetCurrentStep(stepID string) error

SetCurrentStep sets the current step being executed

Jump to

Keyboard shortcuts

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