core

package
v0.1.1 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

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

func (*Runner) SetProgressCallback added in v0.1.1

func (r *Runner) SetProgressCallback(callback func(stepID string, event string, data interface{}))

SetProgressCallback sets a callback function for progress notifications

func (*Runner) State added in v0.1.1

func (r *Runner) State() *ExecutionState

State returns the current execution state

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