Versions in this module Expand all Collapse all v0 v0.1.0 Oct 1, 2026 Changes in this version + var Continue = ErrorStrategy + var StopAll = ErrorStrategy + func StructToMap(v any) map[string]any + type ErrorStrategy struct + func Retry(n int, opts ...RetryOption) ErrorStrategy + func (e ErrorStrategy) RetryCount() int + func (e ErrorStrategy) String() string + type GuardFn func(results Results) bool + type Hooks struct + AfterLevel func(level int, results []TaskResult) + AfterPlan func(report *Report) + AfterTask func(task *Task, result TaskResult) + BeforeLevel func(level int, tasks []*Task, parallel bool) + BeforePlan func(summary PlanSummary) + BeforeTask func(task *Task) + OnRetry func(task *Task, attempt int, err error) + OnSkip func(task *Task, reason string) + type HostResult struct + Changed bool + Data map[string]any + Error string + Hostname string + JobDuration time.Duration + Status string + type Plan struct + func NewPlan(client *osapiclient.Client, opts ...PlanOption) *Plan + func (p *Plan) Client() *osapiclient.Client + func (p *Plan) Config() PlanConfig + func (p *Plan) Explain() string + func (p *Plan) Levels() ([][]*Task, error) + func (p *Plan) Run(ctx context.Context) (*Report, error) + func (p *Plan) TaskFunc(name string, fn TaskFn) *Task + func (p *Plan) TaskFuncWithResults(name string, fn TaskFnWithResults) *Task + func (p *Plan) Tasks() []*Task + func (p *Plan) Validate() error + type PlanConfig struct + Hooks *Hooks + OnErrorStrategy ErrorStrategy + type PlanOption func(*PlanConfig) + func OnError(strategy ErrorStrategy) PlanOption + func WithHooks(hooks Hooks) PlanOption + type PlanSummary struct + Steps []StepSummary + TotalTasks int + type Report struct + Duration time.Duration + Tasks []TaskResult + func (r *Report) Summary() string + type Result struct + Changed bool + Data map[string]any + HostResults []HostResult + JobDuration time.Duration + JobID string + Status Status + func CollectionResult[T any](col client.Collection[T], rawJSON []byte, toHostResult func(T) HostResult) (*Result, error) + type Results map[string]*Result + func (r Results) Get(name string) *Result + type RetryOption func(*ErrorStrategy) + func WithRetryBackoff(initial time.Duration, maxInterval time.Duration) RetryOption + type Status string + const StatusChanged + const StatusFailed + const StatusPending + const StatusRunning + const StatusSkipped + const StatusUnchanged + type StepSummary struct + Parallel bool + Tasks []string + type Task struct + func NewTaskFunc(name string, fn TaskFn) *Task + func NewTaskFuncWithResults(name string, fn TaskFnWithResults) *Task + func (t *Task) Dependencies() []*Task + func (t *Task) DependsOn(deps ...*Task) *Task + func (t *Task) ErrorStrategy() *ErrorStrategy + func (t *Task) Fn() TaskFn + func (t *Task) Guard() GuardFn + func (t *Task) GuardReason() string + func (t *Task) IsFunc() bool + func (t *Task) Name() string + func (t *Task) OnError(strategy ErrorStrategy) + func (t *Task) OnlyIfChanged() + func (t *Task) RequiresChange() bool + func (t *Task) SetGuardReason(reason string) + func (t *Task) SetName(name string) + func (t *Task) When(fn GuardFn) + func (t *Task) WhenWithReason(fn GuardFn, reason string) + type TaskFn func(ctx context.Context, client *osapiclient.Client) (*Result, error) + type TaskFnWithResults func(ctx context.Context, client *osapiclient.Client, results Results) (*Result, error) + type TaskResult struct + Changed bool + Data map[string]any + Duration time.Duration + Error error + HostResults []HostResult + JobDuration time.Duration + JobID string + Name string + Status Status