task

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Execute(command string) commandResult
}

Executor runs shell commands. The default implementation uses exec.Command.

type Runner

type Runner struct {
	State    StateTracker
	Executor Executor
}

Runner handles task execution with retry logic.

func NewRunner

func NewRunner(s StateTracker) *Runner

NewRunner creates a new task runner with the default shell executor.

func (*Runner) Run

func (r *Runner) Run(name, command string, retryConfig config.RetryConfig) error

Run executes a task command with retry logic. Retries are handled internally: the command is re-run up to retryConfig.Attempts times with retryConfig.Delay between attempts.

type StateTracker

type StateTracker interface {
	GetTaskState(name string) state.TaskState
	SetTaskState(name string, state state.TaskState)
	Save() error
}

StateTracker defines the interface for state operations needed by Runner.

Jump to

Keyboard shortcuts

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