wrapper

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attempt

type Attempt struct {
	Number   int       `yaml:"number"`
	Command  string    `yaml:"command"`
	ExitCode int       `yaml:"exit_code"`
	Output   string    `yaml:"output,omitempty"`
	EndedAt  time.Time `yaml:"ended_at"`
}

type CommandResult

type CommandResult struct {
	Command  string
	Output   string
	ExitCode int
}

type Options

type Options struct {
	Runner      Runner
	MaxAttempts int
	Now         func() time.Time
}

type Result

type Result struct {
	Attempts []Attempt `yaml:"attempts"`
	Stopped  bool      `yaml:"stopped"`
	Reason   string    `yaml:"reason"`
}

func Run

func Run(ctx context.Context, opts Options) (Result, error)

type Runner

type Runner interface {
	Run(ctx context.Context, attempt int) (CommandResult, error)
}

type RunnerFunc

type RunnerFunc func(ctx context.Context, attempt int) (CommandResult, error)

func (RunnerFunc) Run

func (f RunnerFunc) Run(ctx context.Context, attempt int) (CommandResult, error)

Jump to

Keyboard shortcuts

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