engine

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Execute(ctx context.Context, execs []Exec, opts ...OptionFunc) ResultSummary
}

func NewExecEngine

func NewExecEngine() Engine

type Exec

type Exec struct {
	ID         string
	Function   func() error
	MaxRetries int
}

type ExecutionMode

type ExecutionMode int
const (
	Parallel ExecutionMode = iota
	Serial
)

type OptionFunc

type OptionFunc func(*Options)

func WithFailFast

func WithFailFast(failFast *bool) OptionFunc

func WithMaxThreads

func WithMaxThreads(maxThreads int) OptionFunc

func WithMode

func WithMode(mode ExecutionMode) OptionFunc

type Options

type Options struct {
	MaxThreads    int
	ExecutionMode ExecutionMode
	FailFast      *bool
}

type Result

type Result struct {
	ID      string
	Error   error
	Retries int
}

type ResultSummary

type ResultSummary struct {
	Results []Result
}

func (ResultSummary) HasErrors

func (rs ResultSummary) HasErrors() bool

func (ResultSummary) String

func (rs ResultSummary) String() string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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