From 3528a25a9a01acb7553526b79dda779e95fc7c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D7=A0=CF=85=CE=B1=CE=B7=20=D7=A0=CF=85=CE=B1=CE=B7=D1=95?= =?UTF-8?q?=CF=83=CE=B7?= Date: Sun, 29 Mar 2026 13:49:36 -0700 Subject: [PATCH] =?UTF-8?q?chore:=20fix=20audit=20violations=20=E2=80=94?= =?UTF-8?q?=20remove=20docs/gen,=20fix=20README,=20consolidate=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete docs/gen/ (re-added by PR #32 after our cleanup) - Remove gomarkdoc from go.mod tools - Fix README: add pkg.go.dev badge and link, emoji headers - Consolidate TestStructToMapUnmarshalError into TestStructToMap table 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 18 +- docs/gen/engine.md | 656 ----------------- docs/gen/orchestrator.md | 989 -------------------------- go.mod | 27 - go.sum | 103 --- internal/engine/bridge_public_test.go | 77 +- 6 files changed, 36 insertions(+), 1834 deletions(-) delete mode 100644 docs/gen/engine.md delete mode 100644 docs/gen/orchestrator.md diff --git a/README.md b/README.md index 63c8294..3d146c1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![conventional commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org) [![built with just](https://img.shields.io/badge/Built_with-Just-black?style=for-the-badge&logo=just&logoColor=white)](https://just.systems) ![gitHub commit activity](https://img.shields.io/github/commit-activity/m/osapi-io/osapi-orchestrator?style=for-the-badge) +[![go reference](https://img.shields.io/badge/go-reference-00ADD8?style=for-the-badge&logo=go&logoColor=white)](https://pkg.go.dev/github.com/osapi-io/osapi-orchestrator/pkg/orchestrator) # OSAPI Orchestrator @@ -14,7 +15,7 @@ A Go package for orchestrating operations across [OSAPI][]-managed hosts -- typed operations, chaining, conditions, and result decoding built on top of the [osapi-sdk][] engine. -## Install +## 📦 Install ```bash go install github.com/osapi-io/osapi-orchestrator@latest @@ -26,7 +27,7 @@ As a library dependency: go get github.com/osapi-io/osapi-orchestrator ``` -## Targeting +## 🎯 Targeting Most operations accept a `target` parameter to control which agents receive the request: @@ -38,7 +39,7 @@ the request: | `hostname` | Send to a specific host | | `key:value` | Send to agents matching a label | -## Operations +## ⚙️ Operations 37 typed constructors across 8 domains: @@ -53,15 +54,17 @@ the request: | Agent | [4 operations](docs/operations/agent/) | [agent-drain.go](examples/operations/agent-drain.go) | | Health | [1 operation](docs/operations/health/) | [basic.go](examples/features/basic.go) | -## Features +## ✨ Features - [Feature Guides](docs/features/README.md) -- Step chaining, guards, retry, broadcast, discovery, file workflows, host status awareness, and result decoding -- [API Reference](docs/gen/orchestrator.md) -- Auto-generated Go - documentation -## Examples +## 📖 Documentation + +See the [package documentation][] on pkg.go.dev for API details. + +## 📋 Examples Each example is a standalone Go file. Run with: @@ -115,4 +118,5 @@ The [MIT][] License. [OSAPI]: https://github.com/osapi-io/osapi [osapi-sdk]: https://github.com/osapi-io/osapi/tree/main/pkg/sdk +[package documentation]: https://pkg.go.dev/github.com/osapi-io/osapi-orchestrator/pkg/orchestrator [MIT]: LICENSE diff --git a/docs/gen/engine.md b/docs/gen/engine.md deleted file mode 100644 index 3d7a09a..0000000 --- a/docs/gen/engine.md +++ /dev/null @@ -1,656 +0,0 @@ - - -# engine - -```go -import "github.com/osapi-io/osapi-orchestrator/internal/engine" -``` - -Package orchestrator provides DAG\-based task orchestration primitives. - -## Index - -- [Variables](<#variables>) -- [func StructToMap\(v any\) map\[string\]any](<#StructToMap>) -- [type ErrorStrategy](<#ErrorStrategy>) - - [func Retry\(n int, opts ...RetryOption\) ErrorStrategy](<#Retry>) - - [func \(e ErrorStrategy\) RetryCount\(\) int](<#ErrorStrategy.RetryCount>) - - [func \(e ErrorStrategy\) String\(\) string](<#ErrorStrategy.String>) -- [type GuardFn](<#GuardFn>) -- [type Hooks](<#Hooks>) -- [type HostResult](<#HostResult>) -- [type Plan](<#Plan>) - - [func NewPlan\(client \*osapiclient.Client, opts ...PlanOption\) \*Plan](<#NewPlan>) - - [func \(p \*Plan\) Client\(\) \*osapiclient.Client](<#Plan.Client>) - - [func \(p \*Plan\) Config\(\) PlanConfig](<#Plan.Config>) - - [func \(p \*Plan\) Explain\(\) string](<#Plan.Explain>) - - [func \(p \*Plan\) Levels\(\) \(\[\]\[\]\*Task, error\)](<#Plan.Levels>) - - [func \(p \*Plan\) Run\(ctx context.Context\) \(\*Report, error\)](<#Plan.Run>) - - [func \(p \*Plan\) TaskFunc\(name string, fn TaskFn\) \*Task](<#Plan.TaskFunc>) - - [func \(p \*Plan\) TaskFuncWithResults\(name string, fn TaskFnWithResults\) \*Task](<#Plan.TaskFuncWithResults>) - - [func \(p \*Plan\) Tasks\(\) \[\]\*Task](<#Plan.Tasks>) - - [func \(p \*Plan\) Validate\(\) error](<#Plan.Validate>) -- [type PlanConfig](<#PlanConfig>) -- [type PlanOption](<#PlanOption>) - - [func OnError\(strategy ErrorStrategy\) PlanOption](<#OnError>) - - [func WithHooks\(hooks Hooks\) PlanOption](<#WithHooks>) -- [type PlanSummary](<#PlanSummary>) -- [type Report](<#Report>) - - [func \(r \*Report\) Summary\(\) string](<#Report.Summary>) -- [type Result](<#Result>) - - [func CollectionResult\[T any\]\(col client.Collection\[T\], rawJSON \[\]byte, toHostResult func\(T\) HostResult\) \(\*Result, error\)](<#CollectionResult>) -- [type Results](<#Results>) - - [func \(r Results\) Get\(name string\) \*Result](<#Results.Get>) -- [type RetryOption](<#RetryOption>) - - [func WithRetryBackoff\(initial time.Duration, maxInterval time.Duration\) RetryOption](<#WithRetryBackoff>) -- [type Status](<#Status>) -- [type StepSummary](<#StepSummary>) -- [type Task](<#Task>) - - [func NewTaskFunc\(name string, fn TaskFn\) \*Task](<#NewTaskFunc>) - - [func NewTaskFuncWithResults\(name string, fn TaskFnWithResults\) \*Task](<#NewTaskFuncWithResults>) - - [func \(t \*Task\) Dependencies\(\) \[\]\*Task](<#Task.Dependencies>) - - [func \(t \*Task\) DependsOn\(deps ...\*Task\) \*Task](<#Task.DependsOn>) - - [func \(t \*Task\) ErrorStrategy\(\) \*ErrorStrategy](<#Task.ErrorStrategy>) - - [func \(t \*Task\) Fn\(\) TaskFn](<#Task.Fn>) - - [func \(t \*Task\) Guard\(\) GuardFn](<#Task.Guard>) - - [func \(t \*Task\) GuardReason\(\) string](<#Task.GuardReason>) - - [func \(t \*Task\) IsFunc\(\) bool](<#Task.IsFunc>) - - [func \(t \*Task\) Name\(\) string](<#Task.Name>) - - [func \(t \*Task\) OnError\(strategy ErrorStrategy\)](<#Task.OnError>) - - [func \(t \*Task\) OnlyIfChanged\(\)](<#Task.OnlyIfChanged>) - - [func \(t \*Task\) RequiresChange\(\) bool](<#Task.RequiresChange>) - - [func \(t \*Task\) SetGuardReason\(reason string\)](<#Task.SetGuardReason>) - - [func \(t \*Task\) SetName\(name string\)](<#Task.SetName>) - - [func \(t \*Task\) When\(fn GuardFn\)](<#Task.When>) - - [func \(t \*Task\) WhenWithReason\(fn GuardFn, reason string\)](<#Task.WhenWithReason>) -- [type TaskFn](<#TaskFn>) -- [type TaskFnWithResults](<#TaskFnWithResults>) -- [type TaskResult](<#TaskResult>) - - -## Variables - -Continue skips dependents of the failed task but continues independent tasks. - -```go -var Continue = ErrorStrategy{/* contains filtered or unexported fields */} -``` - -StopAll cancels all remaining tasks on first failure. - -```go -var StopAll = ErrorStrategy{/* contains filtered or unexported fields */} -``` - - -## func [StructToMap]() - -```go -func StructToMap(v any) map[string]any -``` - -StructToMap converts a struct to map\[string\]any using its JSON tags. Returns nil if v is nil or cannot be marshaled. - - -## type [ErrorStrategy]() - -ErrorStrategy defines how the runner handles task failures. - -```go -type ErrorStrategy struct { - // contains filtered or unexported fields -} -``` - - -### func [Retry]() - -```go -func Retry(n int, opts ...RetryOption) ErrorStrategy -``` - -Retry returns a strategy that retries a failed task n times before failing. Options configure backoff behavior. - - -### func \(ErrorStrategy\) [RetryCount]() - -```go -func (e ErrorStrategy) RetryCount() int -``` - -RetryCount returns the number of retries for this strategy. - - -### func \(ErrorStrategy\) [String]() - -```go -func (e ErrorStrategy) String() string -``` - -String returns a human\-readable representation of the strategy. - - -## type [GuardFn]() - -GuardFn is a predicate that determines if a task should run. - -```go -type GuardFn func(results Results) bool -``` - - -## type [Hooks]() - -Hooks provides consumer\-controlled callbacks for plan execution events. All fields are optional — nil callbacks are skipped. The SDK performs no logging; hooks are the only output mechanism. - -```go -type Hooks struct { - BeforePlan func(summary PlanSummary) - AfterPlan func(report *Report) - BeforeLevel func(level int, tasks []*Task, parallel bool) - AfterLevel func(level int, results []TaskResult) - BeforeTask func(task *Task) - AfterTask func(task *Task, result TaskResult) - OnRetry func(task *Task, attempt int, err error) - OnSkip func(task *Task, reason string) -} -``` - - -## type [HostResult]() - -HostResult represents a single host's response within a broadcast operation. - -```go -type HostResult struct { - Hostname string - Status string - Changed bool - Error string - Data map[string]any - JobDuration time.Duration -} -``` - - -## type [Plan]() - -Plan is a DAG of tasks with dependency edges. - -```go -type Plan struct { - // contains filtered or unexported fields -} -``` - - -### func [NewPlan]() - -```go -func NewPlan(client *osapiclient.Client, opts ...PlanOption) *Plan -``` - -NewPlan creates a new plan bound to an OSAPI client. - - -### func \(\*Plan\) [Client]() - -```go -func (p *Plan) Client() *osapiclient.Client -``` - -Client returns the OSAPI client bound to this plan. - - -### func \(\*Plan\) [Config]() - -```go -func (p *Plan) Config() PlanConfig -``` - -Config returns the plan configuration. - - -### func \(\*Plan\) [Explain]() - -```go -func (p *Plan) Explain() string -``` - -Explain returns a human\-readable representation of the execution plan showing levels, parallelism, dependencies, and guards. - - -### func \(\*Plan\) [Levels]() - -```go -func (p *Plan) Levels() ([][]*Task, error) -``` - -Levels returns the levelized DAG \-\- tasks grouped into execution levels where all tasks in a level can run concurrently. Returns an error if the plan fails validation. - - -### func \(\*Plan\) [Run]() - -```go -func (p *Plan) Run(ctx context.Context) (*Report, error) -``` - -Run validates the plan, resolves the DAG, and executes tasks. - - -### func \(\*Plan\) [TaskFunc]() - -```go -func (p *Plan) TaskFunc(name string, fn TaskFn) *Task -``` - -TaskFunc creates a functional task, adds it to the plan, and returns it. - - -### func \(\*Plan\) [TaskFuncWithResults]() - -```go -func (p *Plan) TaskFuncWithResults(name string, fn TaskFnWithResults) *Task -``` - -TaskFuncWithResults creates a functional task that receives completed results from prior tasks, adds it to the plan, and returns it. - - -### func \(\*Plan\) [Tasks]() - -```go -func (p *Plan) Tasks() []*Task -``` - -Tasks returns all tasks in the plan. - - -### func \(\*Plan\) [Validate]() - -```go -func (p *Plan) Validate() error -``` - -Validate checks the plan for errors: duplicate names and cycles. - - -## type [PlanConfig]() - -PlanConfig holds plan\-level configuration. - -```go -type PlanConfig struct { - OnErrorStrategy ErrorStrategy - Hooks *Hooks -} -``` - - -## type [PlanOption]() - -PlanOption is a functional option for NewPlan. - -```go -type PlanOption func(*PlanConfig) -``` - - -### func [OnError]() - -```go -func OnError(strategy ErrorStrategy) PlanOption -``` - -OnError returns a PlanOption that sets the default error strategy. - - -### func [WithHooks]() - -```go -func WithHooks(hooks Hooks) PlanOption -``` - -WithHooks attaches lifecycle callbacks to plan execution. - - -## type [PlanSummary]() - -PlanSummary describes the execution plan before it runs. - -```go -type PlanSummary struct { - TotalTasks int - Steps []StepSummary -} -``` - - -## type [Report]() - -Report is the aggregate output of a plan execution. - -```go -type Report struct { - Tasks []TaskResult - Duration time.Duration -} -``` - - -### func \(\*Report\) [Summary]() - -```go -func (r *Report) Summary() string -``` - -Summary returns a human\-readable summary of the report. - - -## type [Result]() - -Result is the outcome of a single task execution. - -```go -type Result struct { - JobID string - Changed bool - Data map[string]any - Status Status - JobDuration time.Duration - HostResults []HostResult -} -``` - - -### func [CollectionResult]() - -```go -func CollectionResult[T any](col client.Collection[T], rawJSON []byte, toHostResult func(T) HostResult) (*Result, error) -``` - -CollectionResult builds a Result from a Collection response. It iterates all results, applies the toHostResult mapper to build per\-host details, and auto\-populates HostResult.Data via StructToMap when the mapper leaves it nil. Changed is true if any host reported a change. - -When rawJSON is non\-nil, it is unmarshaled into Result.Data to provide the full response for downstream consumers \(e.g., guards or Results.Decode\). Pass resp.RawJSON\(\) for this, or nil to skip. - - -## type [Results]() - -Results is a map of task name to Result, used for conditional logic. - -```go -type Results map[string]*Result -``` - - -### func \(Results\) [Get]() - -```go -func (r Results) Get(name string) *Result -``` - -Get returns the Result for the named task, or nil if not found. - - -## type [RetryOption]() - -RetryOption configures retry behavior. - -```go -type RetryOption func(*ErrorStrategy) -``` - - -### func [WithRetryBackoff]() - -```go -func WithRetryBackoff(initial time.Duration, maxInterval time.Duration) RetryOption -``` - -WithRetryBackoff enables exponential backoff between retry attempts with the given initial and maximum intervals. - - -## type [Status]() - -Status represents the outcome of a task execution. - -```go -type Status string -``` - -Task execution statuses. - -```go -const ( - // StatusPending and StatusRunning are reserved for future - // streaming status support. The runner does not currently - // assign these — tasks go directly to a terminal status. - StatusPending Status = "pending" - StatusRunning Status = "running" - StatusChanged Status = "changed" - StatusUnchanged Status = "unchanged" - StatusSkipped Status = "skipped" - StatusFailed Status = "failed" -) -``` - - -## type [StepSummary]() - -StepSummary describes a single execution step \(DAG level\). - -```go -type StepSummary struct { - Tasks []string - Parallel bool -} -``` - - -## type [Task]() - -Task is a unit of work in an orchestration plan. - -```go -type Task struct { - // contains filtered or unexported fields -} -``` - - -### func [NewTaskFunc]() - -```go -func NewTaskFunc(name string, fn TaskFn) *Task -``` - -NewTaskFunc creates a functional task with custom logic. - - -### func [NewTaskFuncWithResults]() - -```go -func NewTaskFuncWithResults(name string, fn TaskFnWithResults) *Task -``` - -NewTaskFuncWithResults creates a functional task that receives completed results from prior tasks. - - -### func \(\*Task\) [Dependencies]() - -```go -func (t *Task) Dependencies() []*Task -``` - -Dependencies returns the task's dependencies. - - -### func \(\*Task\) [DependsOn]() - -```go -func (t *Task) DependsOn(deps ...*Task) *Task -``` - -DependsOn sets this task's dependencies. Returns the task for chaining. - - -### func \(\*Task\) [ErrorStrategy]() - -```go -func (t *Task) ErrorStrategy() *ErrorStrategy -``` - -ErrorStrategy returns the per\-task error strategy, or nil to use the plan default. - - -### func \(\*Task\) [Fn]() - -```go -func (t *Task) Fn() TaskFn -``` - -Fn returns the task function, or nil if not set. - - -### func \(\*Task\) [Guard]() - -```go -func (t *Task) Guard() GuardFn -``` - -Guard returns the guard function, or nil if none is set. - - -### func \(\*Task\) [GuardReason]() - -```go -func (t *Task) GuardReason() string -``` - -GuardReason returns the current guard reason. - - -### func \(\*Task\) [IsFunc]() - -```go -func (t *Task) IsFunc() bool -``` - -IsFunc returns true if this is a functional task. - - -### func \(\*Task\) [Name]() - -```go -func (t *Task) Name() string -``` - -Name returns the task name. - - -### func \(\*Task\) [OnError]() - -```go -func (t *Task) OnError(strategy ErrorStrategy) -``` - -OnError sets a per\-task error strategy override. - - -### func \(\*Task\) [OnlyIfChanged]() - -```go -func (t *Task) OnlyIfChanged() -``` - -OnlyIfChanged marks this task to only run if at least one dependency reported Changed=true. - - -### func \(\*Task\) [RequiresChange]() - -```go -func (t *Task) RequiresChange() bool -``` - -RequiresChange returns true if OnlyIfChanged was set. - - -### func \(\*Task\) [SetGuardReason]() - -```go -func (t *Task) SetGuardReason(reason string) -``` - -SetGuardReason updates the skip reason shown when the guard returns false. Use inside a guard function to provide a dynamic reason based on runtime conditions. - - -### func \(\*Task\) [SetName]() - -```go -func (t *Task) SetName(name string) -``` - -SetName changes the task name. - - -### func \(\*Task\) [When]() - -```go -func (t *Task) When(fn GuardFn) -``` - -When sets a custom guard function that determines whether this task should execute. - - -### func \(\*Task\) [WhenWithReason]() - -```go -func (t *Task) WhenWithReason(fn GuardFn, reason string) -``` - -WhenWithReason sets a guard with a custom skip reason shown when the guard returns false. - - -## type [TaskFn]() - -TaskFn is the signature for functional tasks. The client parameter provides access to the OSAPI SDK for making API calls. - -```go -type TaskFn func( - ctx context.Context, - client *osapiclient.Client, -) (*Result, error) -``` - - -## type [TaskFnWithResults]() - -TaskFnWithResults is like TaskFn but receives completed task results for inter\-task data access. - -```go -type TaskFnWithResults func( - ctx context.Context, - client *osapiclient.Client, - results Results, -) (*Result, error) -``` - - -## type [TaskResult]() - -TaskResult records the full execution details of a task. - -```go -type TaskResult struct { - JobID string - Name string - Status Status - Changed bool - Duration time.Duration - JobDuration time.Duration - Error error - Data map[string]any - HostResults []HostResult -} -``` - -Generated by [gomarkdoc]() diff --git a/docs/gen/orchestrator.md b/docs/gen/orchestrator.md deleted file mode 100644 index 3d225ec..0000000 --- a/docs/gen/orchestrator.md +++ /dev/null @@ -1,989 +0,0 @@ - - -# orchestrator - -```go -import "github.com/osapi-io/osapi-orchestrator/pkg/orchestrator" -``` - -Package orchestrator provides a declarative DSL for OSAPI infrastructure operations. Users declare what operations to run, where, in what order, and under what conditions. The orchestrator handles DAG execution, parallelism, retries, and reporting. - -## Index - -- [Constants](<#constants>) -- [func MatchAll\(agent osapi.Agent, predicates ...Predicate\) bool](<#MatchAll>) -- [type ErrorStrategy](<#ErrorStrategy>) -- [type HostResult](<#HostResult>) - - [func \(h HostResult\) Decode\(v any\) error](<#HostResult.Decode>) -- [type Option](<#Option>) - - [func WithVerbose\(\) Option](<#WithVerbose>) -- [type Orchestrator](<#Orchestrator>) - - [func New\(url string, token string, opts ...Option\) \*Orchestrator](<#New>) - - [func \(o \*Orchestrator\) AgentDrain\(hostname string\) \*Step](<#Orchestrator.AgentDrain>) - - [func \(o \*Orchestrator\) AgentGet\(hostname string\) \*Step](<#Orchestrator.AgentGet>) - - [func \(o \*Orchestrator\) AgentList\(\) \*Step](<#Orchestrator.AgentList>) - - [func \(o \*Orchestrator\) AgentUndrain\(hostname string\) \*Step](<#Orchestrator.AgentUndrain>) - - [func \(o \*Orchestrator\) CommandExec\(target string, command string, args ...string\) \*Step](<#Orchestrator.CommandExec>) - - [func \(o \*Orchestrator\) CommandShell\(target string, command string\) \*Step](<#Orchestrator.CommandShell>) - - [func \(o \*Orchestrator\) CronCreate\(target string, opts osapi.CronCreateOpts\) \*Step](<#Orchestrator.CronCreate>) - - [func \(o \*Orchestrator\) CronDelete\(target string, entryName string\) \*Step](<#Orchestrator.CronDelete>) - - [func \(o \*Orchestrator\) CronGet\(target string, entryName string\) \*Step](<#Orchestrator.CronGet>) - - [func \(o \*Orchestrator\) CronList\(target string\) \*Step](<#Orchestrator.CronList>) - - [func \(o \*Orchestrator\) CronUpdate\(target string, entryName string, opts osapi.CronUpdateOpts\) \*Step](<#Orchestrator.CronUpdate>) - - [func \(o \*Orchestrator\) Discover\(ctx context.Context, predicates ...Predicate\) \(\[\]osapi.Agent, error\)](<#Orchestrator.Discover>) - - [func \(o \*Orchestrator\) DockerCreate\(target string, opts osapi.DockerCreateOpts\) \*Step](<#Orchestrator.DockerCreate>) - - [func \(o \*Orchestrator\) DockerExec\(target string, id string, opts osapi.DockerExecOpts\) \*Step](<#Orchestrator.DockerExec>) - - [func \(o \*Orchestrator\) DockerImageRemove\(target string, imageName string, params \*osapi.DockerImageRemoveParams\) \*Step](<#Orchestrator.DockerImageRemove>) - - [func \(o \*Orchestrator\) DockerInspect\(target string, id string\) \*Step](<#Orchestrator.DockerInspect>) - - [func \(o \*Orchestrator\) DockerList\(target string, params \*osapi.DockerListParams\) \*Step](<#Orchestrator.DockerList>) - - [func \(o \*Orchestrator\) DockerPull\(target string, opts osapi.DockerPullOpts\) \*Step](<#Orchestrator.DockerPull>) - - [func \(o \*Orchestrator\) DockerRemove\(target string, id string, params \*osapi.DockerRemoveParams\) \*Step](<#Orchestrator.DockerRemove>) - - [func \(o \*Orchestrator\) DockerStart\(target string, id string\) \*Step](<#Orchestrator.DockerStart>) - - [func \(o \*Orchestrator\) DockerStop\(target string, id string, opts osapi.DockerStopOpts\) \*Step](<#Orchestrator.DockerStop>) - - [func \(o \*Orchestrator\) FileChanged\(name string, data \[\]byte\) \*Step](<#Orchestrator.FileChanged>) - - [func \(o \*Orchestrator\) FileDeploy\(target string, opts osapi.FileDeployOpts\) \*Step](<#Orchestrator.FileDeploy>) - - [func \(o \*Orchestrator\) FileStatusGet\(target string, path string\) \*Step](<#Orchestrator.FileStatusGet>) - - [func \(o \*Orchestrator\) FileUndeploy\(target string, path string\) \*Step](<#Orchestrator.FileUndeploy>) - - [func \(o \*Orchestrator\) FileUpload\(name string, contentType string, data \[\]byte, opts ...UploadOption\) \*Step](<#Orchestrator.FileUpload>) - - [func \(o \*Orchestrator\) GroupByFact\(ctx context.Context, key string, predicates ...Predicate\) \(map\[string\]\[\]osapi.Agent, error\)](<#Orchestrator.GroupByFact>) - - [func \(o \*Orchestrator\) HealthCheck\(\) \*Step](<#Orchestrator.HealthCheck>) - - [func \(o \*Orchestrator\) NetworkDNSGet\(target string, interfaceName string\) \*Step](<#Orchestrator.NetworkDNSGet>) - - [func \(o \*Orchestrator\) NetworkDNSUpdate\(target string, interfaceName string, servers \[\]string, searchDomains \[\]string\) \*Step](<#Orchestrator.NetworkDNSUpdate>) - - [func \(o \*Orchestrator\) NetworkPingDo\(target string, address string\) \*Step](<#Orchestrator.NetworkPingDo>) - - [func \(o \*Orchestrator\) NodeDiskGet\(target string\) \*Step](<#Orchestrator.NodeDiskGet>) - - [func \(o \*Orchestrator\) NodeHostnameGet\(target string\) \*Step](<#Orchestrator.NodeHostnameGet>) - - [func \(o \*Orchestrator\) NodeHostnameUpdate\(target string, hostname string\) \*Step](<#Orchestrator.NodeHostnameUpdate>) - - [func \(o \*Orchestrator\) NodeLoadGet\(target string\) \*Step](<#Orchestrator.NodeLoadGet>) - - [func \(o \*Orchestrator\) NodeMemoryGet\(target string\) \*Step](<#Orchestrator.NodeMemoryGet>) - - [func \(o \*Orchestrator\) NodeOSGet\(target string\) \*Step](<#Orchestrator.NodeOSGet>) - - [func \(o \*Orchestrator\) NodeStatusGet\(target string\) \*Step](<#Orchestrator.NodeStatusGet>) - - [func \(o \*Orchestrator\) NodeUptimeGet\(target string\) \*Step](<#Orchestrator.NodeUptimeGet>) - - [func \(o \*Orchestrator\) Run\(ctx context.Context\) \(\*Report, error\)](<#Orchestrator.Run>) - - [func \(o \*Orchestrator\) TaskFunc\(name string, fn func\(ctx context.Context, c \*osapi.Client, r Results\) \(\*engine.Result, error\)\) \*Step](<#Orchestrator.TaskFunc>) -- [type Predicate](<#Predicate>) - - [func Arch\(architecture string\) Predicate](<#Arch>) - - [func FactEquals\(key string, value any\) Predicate](<#FactEquals>) - - [func HasCondition\(conditionType string\) Predicate](<#HasCondition>) - - [func HasLabel\(key string, value string\) Predicate](<#HasLabel>) - - [func Healthy\(\) Predicate](<#Healthy>) - - [func MinCPU\(count int\) Predicate](<#MinCPU>) - - [func MinMemory\(total int\) Predicate](<#MinMemory>) - - [func NoCondition\(conditionType string\) Predicate](<#NoCondition>) - - [func OS\(distribution string\) Predicate](<#OS>) -- [type Report](<#Report>) - - [func \(r \*Report\) Decode\(name string, v any\) error](<#Report.Decode>) - - [func \(r \*Report\) Summary\(\) string](<#Report.Summary>) -- [type Result](<#Result>) -- [type Results](<#Results>) - - [func NewResults\(sdkResults engine.Results\) Results](<#NewResults>) - - [func \(r Results\) Changed\(name string\) bool](<#Results.Changed>) - - [func \(r Results\) Decode\(name string, v any\) error](<#Results.Decode>) - - [func \(r Results\) HostResults\(name string\) \[\]HostResult](<#Results.HostResults>) - - [func \(r Results\) Status\(name string\) TaskStatus](<#Results.Status>) -- [type RetryOption](<#RetryOption>) - - [func WithBackoff\(initial time.Duration, maxInterval time.Duration\) RetryOption](<#WithBackoff>) - - [func WithExponentialBackoff\(\) RetryOption](<#WithExponentialBackoff>) -- [type Step](<#Step>) - - [func \(s \*Step\) After\(deps ...\*Step\) \*Step](<#Step.After>) - - [func \(s \*Step\) Named\(name string\) \*Step](<#Step.Named>) - - [func \(s \*Step\) OnError\(strategy ErrorStrategy\) \*Step](<#Step.OnError>) - - [func \(s \*Step\) OnlyIfAllChanged\(\) \*Step](<#Step.OnlyIfAllChanged>) - - [func \(s \*Step\) OnlyIfAllHostsChanged\(\) \*Step](<#Step.OnlyIfAllHostsChanged>) - - [func \(s \*Step\) OnlyIfAllHostsFailed\(\) \*Step](<#Step.OnlyIfAllHostsFailed>) - - [func \(s \*Step\) OnlyIfAnyHostChanged\(\) \*Step](<#Step.OnlyIfAnyHostChanged>) - - [func \(s \*Step\) OnlyIfAnyHostFailed\(\) \*Step](<#Step.OnlyIfAnyHostFailed>) - - [func \(s \*Step\) OnlyIfAnyHostSkipped\(\) \*Step](<#Step.OnlyIfAnyHostSkipped>) - - [func \(s \*Step\) OnlyIfChanged\(\) \*Step](<#Step.OnlyIfChanged>) - - [func \(s \*Step\) OnlyIfFailed\(\) \*Step](<#Step.OnlyIfFailed>) - - [func \(s \*Step\) Retry\(n int, opts ...RetryOption\) \*Step](<#Step.Retry>) - - [func \(s \*Step\) When\(fn func\(Results\) bool\) \*Step](<#Step.When>) - - [func \(s \*Step\) WhenFact\(agentListStep string, fn Predicate\) \*Step](<#Step.WhenFact>) -- [type TaskResult](<#TaskResult>) -- [type TaskStatus](<#TaskStatus>) -- [type UploadOption](<#UploadOption>) - - [func WithForce\(\) UploadOption](<#WithForce>) - - -## Constants - -Host\-level status constants returned by the API for per\-host results. These represent agent\-side outcomes, distinct from task\-level statuses \(TaskStatusChanged, TaskStatusSkipped, etc.\) which are DAG\-level. - -```go -const ( - // HostStatusOk indicates the operation completed successfully on the host. - HostStatusOk = "ok" - // HostStatusSkipped indicates the operation is not supported on the host - // (e.g., a Darwin host in a Linux fleet). This is NOT an error. - HostStatusSkipped = "skipped" - // HostStatusFailed indicates the operation failed on the host. - HostStatusFailed = "failed" -) -``` - - -## func [MatchAll]() - -```go -func MatchAll(agent osapi.Agent, predicates ...Predicate) bool -``` - -MatchAll returns true if the agent matches all given predicates. Returns true if no predicates are provided. - - -## type [ErrorStrategy]() - -ErrorStrategy controls what happens when a step fails. - -```go -type ErrorStrategy int -``` - - - -```go -const ( - // StopAll halts the entire plan on failure. - StopAll ErrorStrategy = iota - // Continue skips dependent steps and continues with the rest. - Continue -) -``` - - -## type [HostResult]() - -HostResult represents a single host's response within a broadcast operation. - -```go -type HostResult struct { - Hostname string - Status string - Changed bool - Error string - Data map[string]any -} -``` - - -### func \(HostResult\) [Decode]() - -```go -func (h HostResult) Decode(v any) error -``` - -Decode unmarshals host\-specific data into a typed result struct. - - -## type [Option]() - -Option configures the Orchestrator. - -```go -type Option func(*config) -``` - - -### func [WithVerbose]() - -```go -func WithVerbose() Option -``` - -WithVerbose enables verbose output showing stdout, stderr, and full response data for all tasks. - - -## type [Orchestrator]() - -Orchestrator is the top\-level entry point for building and running infrastructure plans. - -```go -type Orchestrator struct { - // contains filtered or unexported fields -} -``` - - -### func [New]() - -```go -func New(url string, token string, opts ...Option) *Orchestrator -``` - -New creates an Orchestrator connected to the given OSAPI server. - - -### func \(\*Orchestrator\) [AgentDrain]() - -```go -func (o *Orchestrator) AgentDrain(hostname string) *Step -``` - -AgentDrain creates a step that drains an agent, preventing it from accepting new jobs. - - -### func \(\*Orchestrator\) [AgentGet]() - -```go -func (o *Orchestrator) AgentGet(hostname string) *Step -``` - -AgentGet creates a step that retrieves detailed info about a specific agent. - - -### func \(\*Orchestrator\) [AgentList]() - -```go -func (o *Orchestrator) AgentList() *Step -``` - -AgentList creates a step that lists all active agents with their facts. - - -### func \(\*Orchestrator\) [AgentUndrain]() - -```go -func (o *Orchestrator) AgentUndrain(hostname string) *Step -``` - -AgentUndrain creates a step that undrains an agent, allowing it to accept new jobs again. - - -### func \(\*Orchestrator\) [CommandExec]() - -```go -func (o *Orchestrator) CommandExec(target string, command string, args ...string) *Step -``` - -CommandExec creates a step that executes a command. - - -### func \(\*Orchestrator\) [CommandShell]() - -```go -func (o *Orchestrator) CommandShell(target string, command string) *Step -``` - -CommandShell creates a step that executes a shell command string. - - -### func \(\*Orchestrator\) [CronCreate]() - -```go -func (o *Orchestrator) CronCreate(target string, opts osapi.CronCreateOpts) *Step -``` - -CronCreate creates a step that creates a new cron entry on the target host. - - -### func \(\*Orchestrator\) [CronDelete]() - -```go -func (o *Orchestrator) CronDelete(target string, entryName string) *Step -``` - -CronDelete creates a step that deletes a cron entry on the target host. - - -### func \(\*Orchestrator\) [CronGet]() - -```go -func (o *Orchestrator) CronGet(target string, entryName string) *Step -``` - -CronGet creates a step that retrieves a specific cron entry on the target host. - - -### func \(\*Orchestrator\) [CronList]() - -```go -func (o *Orchestrator) CronList(target string) *Step -``` - -CronList creates a step that lists cron entries on the target host. - - -### func \(\*Orchestrator\) [CronUpdate]() - -```go -func (o *Orchestrator) CronUpdate(target string, entryName string, opts osapi.CronUpdateOpts) *Step -``` - -CronUpdate creates a step that updates an existing cron entry on the target host. - - -### func \(\*Orchestrator\) [Discover]() - -```go -func (o *Orchestrator) Discover(ctx context.Context, predicates ...Predicate) ([]osapi.Agent, error) -``` - -Discover queries active agents and returns those matching all predicates. Runs synchronously at plan\-build time. With no predicates, returns all agents. - - -### func \(\*Orchestrator\) [DockerCreate]() - -```go -func (o *Orchestrator) DockerCreate(target string, opts osapi.DockerCreateOpts) *Step -``` - -DockerCreate creates a step that creates a new container on the target host. - - -### func \(\*Orchestrator\) [DockerExec]() - -```go -func (o *Orchestrator) DockerExec(target string, id string, opts osapi.DockerExecOpts) *Step -``` - -DockerExec creates a step that executes a command inside a running container. - - -### func \(\*Orchestrator\) [DockerImageRemove]() - -```go -func (o *Orchestrator) DockerImageRemove(target string, imageName string, params *osapi.DockerImageRemoveParams) *Step -``` - -DockerImageRemove creates a step that removes a container image from the target host. - - -### func \(\*Orchestrator\) [DockerInspect]() - -```go -func (o *Orchestrator) DockerInspect(target string, id string) *Step -``` - -DockerInspect creates a step that retrieves detailed info about a container. - - -### func \(\*Orchestrator\) [DockerList]() - -```go -func (o *Orchestrator) DockerList(target string, params *osapi.DockerListParams) *Step -``` - -DockerList creates a step that lists containers on the target host. - - -### func \(\*Orchestrator\) [DockerPull]() - -```go -func (o *Orchestrator) DockerPull(target string, opts osapi.DockerPullOpts) *Step -``` - -DockerPull creates a step that pulls a Docker image on the target host. - - -### func \(\*Orchestrator\) [DockerRemove]() - -```go -func (o *Orchestrator) DockerRemove(target string, id string, params *osapi.DockerRemoveParams) *Step -``` - -DockerRemove creates a step that removes a container from the target host. - - -### func \(\*Orchestrator\) [DockerStart]() - -```go -func (o *Orchestrator) DockerStart(target string, id string) *Step -``` - -DockerStart creates a step that starts a stopped container on the target host. - - -### func \(\*Orchestrator\) [DockerStop]() - -```go -func (o *Orchestrator) DockerStop(target string, id string, opts osapi.DockerStopOpts) *Step -``` - -DockerStop creates a step that stops a running container on the target host. - - -### func \(\*Orchestrator\) [FileChanged]() - -```go -func (o *Orchestrator) FileChanged(name string, data []byte) *Step -``` - -FileChanged creates a step that checks whether local content differs from the version stored in the Object Store. Computes SHA\-256 locally and compares against the stored hash. Pairs with OnlyIfChanged to skip uploads when content is unchanged. - - -### func \(\*Orchestrator\) [FileDeploy]() - -```go -func (o *Orchestrator) FileDeploy(target string, opts osapi.FileDeployOpts) *Step -``` - -FileDeploy creates a step that deploys a file from the Object Store to the target agent's filesystem. The objectName must reference a file previously uploaded to the Object Store. ContentType should be "raw" for literal content or "template" for Go\-template rendering with vars and agent facts. - - -### func \(\*Orchestrator\) [FileStatusGet]() - -```go -func (o *Orchestrator) FileStatusGet(target string, path string) *Step -``` - -FileStatusGet creates a step that checks the status of a deployed file on the target agent. Returns whether the file is in\-sync, drifted, or missing compared to the expected state. - - -### func \(\*Orchestrator\) [FileUndeploy]() - -```go -func (o *Orchestrator) FileUndeploy(target string, path string) *Step -``` - -FileUndeploy creates a step that removes a previously deployed file from the target agent's filesystem. - - -### func \(\*Orchestrator\) [FileUpload]() - -```go -func (o *Orchestrator) FileUpload(name string, contentType string, data []byte, opts ...UploadOption) *Step -``` - -FileUpload creates a step that uploads file content to the Object Store via the OSAPI REST API. Returns the object name that can be used in subsequent FileDeploy steps. This is a convenience wrapper that uses TaskFunc to call the file upload API directly. By default the upload is idempotent — the SDK compares SHA\-256 digests and skips the upload when content is unchanged. Pass WithForce to always upload regardless of content changes. - - -### func \(\*Orchestrator\) [GroupByFact]() - -```go -func (o *Orchestrator) GroupByFact(ctx context.Context, key string, predicates ...Predicate) (map[string][]osapi.Agent, error) -``` - -GroupByFact queries agents, optionally filters by predicates, and groups results by the string value at the given key. - - -### func \(\*Orchestrator\) [HealthCheck]() - -```go -func (o *Orchestrator) HealthCheck() *Step -``` - -HealthCheck creates a health check step. - - -### func \(\*Orchestrator\) [NetworkDNSGet]() - -```go -func (o *Orchestrator) NetworkDNSGet(target string, interfaceName string) *Step -``` - -NetworkDNSGet creates a step that retrieves DNS configuration. - - -### func \(\*Orchestrator\) [NetworkDNSUpdate]() - -```go -func (o *Orchestrator) NetworkDNSUpdate(target string, interfaceName string, servers []string, searchDomains []string) *Step -``` - -NetworkDNSUpdate creates a step that updates DNS configuration. - - -### func \(\*Orchestrator\) [NetworkPingDo]() - -```go -func (o *Orchestrator) NetworkPingDo(target string, address string) *Step -``` - -NetworkPingDo creates a step that pings an address. - - -### func \(\*Orchestrator\) [NodeDiskGet]() - -```go -func (o *Orchestrator) NodeDiskGet(target string) *Step -``` - -NodeDiskGet creates a step that retrieves disk usage. - - -### func \(\*Orchestrator\) [NodeHostnameGet]() - -```go -func (o *Orchestrator) NodeHostnameGet(target string) *Step -``` - -NodeHostnameGet creates a step that retrieves the hostname. - - -### func \(\*Orchestrator\) [NodeHostnameUpdate]() - -```go -func (o *Orchestrator) NodeHostnameUpdate(target string, hostname string) *Step -``` - -NodeHostnameUpdate creates a step that sets the system hostname. - - -### func \(\*Orchestrator\) [NodeLoadGet]() - -```go -func (o *Orchestrator) NodeLoadGet(target string) *Step -``` - -NodeLoadGet creates a step that retrieves load averages. - - -### func \(\*Orchestrator\) [NodeMemoryGet]() - -```go -func (o *Orchestrator) NodeMemoryGet(target string) *Step -``` - -NodeMemoryGet creates a step that retrieves memory stats. - - -### func \(\*Orchestrator\) [NodeOSGet]() - -```go -func (o *Orchestrator) NodeOSGet(target string) *Step -``` - -NodeOSGet creates a step that retrieves OS information. - - -### func \(\*Orchestrator\) [NodeStatusGet]() - -```go -func (o *Orchestrator) NodeStatusGet(target string) *Step -``` - -NodeStatusGet creates a step that retrieves node status. - - -### func \(\*Orchestrator\) [NodeUptimeGet]() - -```go -func (o *Orchestrator) NodeUptimeGet(target string) *Step -``` - -NodeUptimeGet creates a step that retrieves system uptime. - - -### func \(\*Orchestrator\) [Run]() - -```go -func (o *Orchestrator) Run(ctx context.Context) (*Report, error) -``` - -Run executes the plan and returns a report. - - -### func \(\*Orchestrator\) [TaskFunc]() - -```go -func (o *Orchestrator) TaskFunc(name string, fn func(ctx context.Context, c *osapi.Client, r Results) (*engine.Result, error)) *Step -``` - -TaskFunc creates a custom step that receives the OSAPI client and completed results from prior steps. Use this for operations not covered by the typed constructors — the client provides full access to the SDK for calling any API endpoint. - - -## type [Predicate]() - -Predicate filters agents by their facts and properties. - -```go -type Predicate func(osapi.Agent) bool -``` - - -### func [Arch]() - -```go -func Arch(architecture string) Predicate -``` - -Arch returns a predicate that matches agents with the given architecture \(case\-insensitive\). - - -### func [FactEquals]() - -```go -func FactEquals(key string, value any) Predicate -``` - -FactEquals returns a predicate that matches agents where the given fact key equals the expected value. - - -### func [HasCondition]() - -```go -func HasCondition(conditionType string) Predicate -``` - -HasCondition returns a predicate that matches agents with an active condition \(Status=true\) of the given type. - - -### func [HasLabel]() - -```go -func HasLabel(key string, value string) Predicate -``` - -HasLabel returns a predicate that matches agents with the given label key\-value pair. - - -### func [Healthy]() - -```go -func Healthy() Predicate -``` - -Healthy returns a predicate that matches agents with no active conditions \(all conditions are false or the list is empty\). - - -### func [MinCPU]() - -```go -func MinCPU(count int) Predicate -``` - -MinCPU returns a predicate that matches agents with at least the given number of CPUs. - - -### func [MinMemory]() - -```go -func MinMemory(total int) Predicate -``` - -MinMemory returns a predicate that matches agents with at least the given total memory \(in the same unit as Memory.Total\). - - -### func [NoCondition]() - -```go -func NoCondition(conditionType string) Predicate -``` - -NoCondition returns a predicate that matches agents that do NOT have an active condition of the given type. - - -### func [OS]() - -```go -func OS(distribution string) Predicate -``` - -OS returns a predicate that matches agents running the given distribution \(case\-insensitive\). - - -## type [Report]() - -Report summarizes plan execution. - -```go -type Report struct { - Tasks []engine.TaskResult - Duration time.Duration -} -``` - - -### func \(\*Report\) [Decode]() - -```go -func (r *Report) Decode(name string, v any) error -``` - -Decode retrieves the result of a named task from the report and decodes it into the given typed struct. - -For collection\-based operations that have host results, Decode unwraps the first host's data automatically. For non\-collection operations, it decodes from the task's top\-level data. - - -### func \(\*Report\) [Summary]() - -```go -func (r *Report) Summary() string -``` - -Summary returns a human\-readable summary of the plan execution. - - -## type [Result]() - -Result is the outcome of a single task execution. Users return this from TaskFunc callbacks. - -```go -type Result = engine.Result -``` - - -## type [Results]() - -Results provides access to completed step results inside When guards. - -```go -type Results struct { - // contains filtered or unexported fields -} -``` - - -### func [NewResults]() - -```go -func NewResults(sdkResults engine.Results) Results -``` - -NewResults creates a Results from SDK results. Intended for testing. - - -### func \(Results\) [Changed]() - -```go -func (r Results) Changed(name string) bool -``` - -Changed returns whether the named step reported changes. Returns false if the step is not found or did not report changes. - - -### func \(Results\) [Decode]() - -```go -func (r Results) Decode(name string, v any) error -``` - -Decode retrieves the result of a named step and decodes it into the given typed struct. - -For collection\-based operations \(CommandExec, NodeHostnameGet, etc.\) that have host results, Decode unwraps the first host's data automatically. For non\-collection operations \(TaskFunc, FileChanged, etc.\), it decodes from the step's top\-level data. - - -### func \(Results\) [HostResults]() - -```go -func (r Results) HostResults(name string) []HostResult -``` - -HostResults returns per\-host results for a broadcast operation. Returns nil for unicast operations or unknown step names. - - -### func \(Results\) [Status]() - -```go -func (r Results) Status(name string) TaskStatus -``` - -Status returns the terminal status of a completed dependency step. - - -## type [RetryOption]() - -RetryOption configures the Retry behavior. - -```go -type RetryOption func(*retryConfig) -``` - - -### func [WithBackoff]() - -```go -func WithBackoff(initial time.Duration, maxInterval time.Duration) RetryOption -``` - -WithBackoff sets custom initial and max intervals for exponential backoff between retry attempts. The delay doubles on each attempt, clamped to maxInterval. - - -### func [WithExponentialBackoff]() - -```go -func WithExponentialBackoff() RetryOption -``` - -WithExponentialBackoff enables exponential backoff between retry attempts with sensible defaults \(1s initial, 30s max\). - - -## type [Step]() - -Step represents a single operation in the plan. Users chain methods to declare ordering, conditions, and error handling. - -```go -type Step struct { - // contains filtered or unexported fields -} -``` - - -### func \(\*Step\) [After]() - -```go -func (s *Step) After(deps ...*Step) *Step -``` - -After declares that this step runs after the given steps complete. - - -### func \(\*Step\) [Named]() - -```go -func (s *Step) Named(name string) *Step -``` - -Named overrides the auto\-generated step name. - - -### func \(\*Step\) [OnError]() - -```go -func (s *Step) OnError(strategy ErrorStrategy) *Step -``` - -OnError sets the error strategy for this step. - - -### func \(\*Step\) [OnlyIfAllChanged]() - -```go -func (s *Step) OnlyIfAllChanged() *Step -``` - -OnlyIfAllChanged skips this step unless all dependencies reported changes. - - -### func \(\*Step\) [OnlyIfAllHostsChanged]() - -```go -func (s *Step) OnlyIfAllHostsChanged() *Step -``` - -OnlyIfAllHostsChanged skips this step unless every host in every dependency reported changes. Only meaningful for broadcast operations. - - -### func \(\*Step\) [OnlyIfAllHostsFailed]() - -```go -func (s *Step) OnlyIfAllHostsFailed() *Step -``` - -OnlyIfAllHostsFailed skips this step unless every host in every dependency has an error. Only meaningful for broadcast operations. - - -### func \(\*Step\) [OnlyIfAnyHostChanged]() - -```go -func (s *Step) OnlyIfAnyHostChanged() *Step -``` - -OnlyIfAnyHostChanged skips this step unless any host in any dependency reported changes. Only meaningful for broadcast operations. - - -### func \(\*Step\) [OnlyIfAnyHostFailed]() - -```go -func (s *Step) OnlyIfAnyHostFailed() *Step -``` - -OnlyIfAnyHostFailed skips this step unless any host in any dependency has an error. Only meaningful for broadcast operations. - - -### func \(\*Step\) [OnlyIfAnyHostSkipped]() - -```go -func (s *Step) OnlyIfAnyHostSkipped() *Step -``` - -OnlyIfAnyHostSkipped skips this step unless any host in any dependency was skipped \(unsupported operation\). Only meaningful for broadcast operations. Skipped hosts are NOT errors — they indicate the operation is not available on that OS family. - - -### func \(\*Step\) [OnlyIfChanged]() - -```go -func (s *Step) OnlyIfChanged() *Step -``` - -OnlyIfChanged skips this step unless a dependency reported changes. - - -### func \(\*Step\) [OnlyIfFailed]() - -```go -func (s *Step) OnlyIfFailed() *Step -``` - -OnlyIfFailed skips this step unless at least one dependency failed. - - -### func \(\*Step\) [Retry]() - -```go -func (s *Step) Retry(n int, opts ...RetryOption) *Step -``` - -Retry sets the number of retry attempts on failure. Options configure exponential backoff between attempts. - - -### func \(\*Step\) [When]() - -```go -func (s *Step) When(fn func(Results) bool) *Step -``` - -When adds a guard condition — the step only runs if the predicate returns true. - - -### func \(\*Step\) [WhenFact]() - -```go -func (s *Step) WhenFact(agentListStep string, fn Predicate) *Step -``` - -WhenFact adds a fact\-based guard. The step runs only if the predicate returns true for at least one agent. Requires a prior AgentList step referenced by name. The skip reason distinguishes between a missing/mistyped step name and no matching agents. - - -## type [TaskResult]() - -TaskResult records the full execution details of a task. Exposed via Report.Tasks. - -```go -type TaskResult = engine.TaskResult -``` - - -## type [TaskStatus]() - -TaskStatus represents the outcome of a step for guard inspection. - -```go -type TaskStatus int -``` - - - -```go -const ( - // TaskStatusUnknown indicates the step was not found or has not run. - TaskStatusUnknown TaskStatus = iota - // TaskStatusChanged indicates the step ran and reported changes. - TaskStatusChanged - // TaskStatusUnchanged indicates the step ran with no changes. - TaskStatusUnchanged - // TaskStatusSkipped indicates the step was skipped. - TaskStatusSkipped - // TaskStatusFailed indicates the step failed. - TaskStatusFailed -) -``` - - -## type [UploadOption]() - -UploadOption configures the FileUpload operation. - -```go -type UploadOption func(*uploadConfig) -``` - - -### func [WithForce]() - -```go -func WithForce() UploadOption -``` - -WithForce makes FileUpload bypass the SHA\-256 pre\-check and always upload regardless of whether the content has changed. Without this option FileUpload is idempotent — the SDK compares digests and skips the upload when content is unchanged. - -Generated by [gomarkdoc]() diff --git a/go.mod b/go.mod index c9226dc..e37f895 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.25.7 tool ( github.com/boumenot/gocover-cobertura github.com/golangci/golangci-lint/v2/cmd/golangci-lint - github.com/princjef/gomarkdoc/cmd/gomarkdoc github.com/segmentio/golines mvdan.cc/gofumpt ) @@ -21,7 +20,6 @@ require ( 4d63.com/gochecknoglobals v0.2.2 // indirect codeberg.org/chavacava/garif v0.2.0 // indirect codeberg.org/polyfloyd/go-errorlint v1.9.0 // indirect - dario.cat/mergo v1.0.0 // indirect dev.gaijin.team/go/exhaustruct/v4 v4.0.0 // indirect dev.gaijin.team/go/golib v0.6.0 // indirect github.com/4meepo/tagalign v1.4.3 // indirect @@ -34,11 +32,8 @@ require ( github.com/BurntSushi/toml v1.6.0 // indirect github.com/Djarvur/go-err113 v0.1.1 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect - github.com/Microsoft/go-winio v0.6.2 // indirect github.com/MirrexOne/unqueryvet v1.5.4 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect - github.com/ProtonMail/go-crypto v1.1.6 // indirect - github.com/VividCortex/ewma v1.2.0 // indirect github.com/alecthomas/chroma/v2 v2.23.1 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect github.com/alecthomas/kingpin/v2 v2.4.0 // indirect @@ -70,17 +65,13 @@ require ( github.com/charmbracelet/x/ansi v0.10.1 // indirect github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect github.com/charmbracelet/x/term v0.2.1 // indirect - github.com/cheggaaa/pb/v3 v3.0.8 // indirect github.com/ckaznocha/intrange v0.3.1 // indirect - github.com/cloudflare/circl v1.6.3 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect - github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/daixiang0/gci v0.13.7 // indirect github.com/dave/dst v0.27.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect - github.com/emirpasic/gods v1.18.1 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.19.0 // indirect github.com/fatih/structtag v1.2.0 // indirect @@ -89,9 +80,6 @@ require ( github.com/fzipp/gocyclo v0.6.0 // indirect github.com/ghostiam/protogetter v0.3.20 // indirect github.com/go-critic/go-critic v0.14.3 // indirect - github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.8.0 // indirect - github.com/go-git/go-git/v5 v5.17.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect @@ -106,7 +94,6 @@ require ( github.com/gobwas/glob v0.2.3 // indirect github.com/godoc-lint/godoc-lint v0.11.2 // indirect github.com/gofrs/flock v0.13.0 // indirect - github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golangci/asciicheck v0.5.0 // indirect github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect github.com/golangci/go-printf-func-name v0.1.1 // indirect @@ -130,13 +117,11 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jgautheron/goconst v1.8.2 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jjti/go-spancheck v0.6.5 // indirect github.com/julz/importas v0.2.0 // indirect github.com/karamaru-alpha/copyloopvar v1.2.2 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/errcheck v1.10.0 // indirect github.com/kkHAIKE/contextcheck v1.1.6 // indirect github.com/kulti/thelper v0.7.1 // indirect @@ -149,7 +134,6 @@ require ( github.com/ldez/tagliatelle v0.7.2 // indirect github.com/ldez/usetesting v0.5.0 // indirect github.com/leonklingele/grouper v1.1.2 // indirect - github.com/logrusorgru/aurora/v4 v4.0.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/macabu/inamedparam v0.2.0 // indirect github.com/manuelarte/embeddedstructfieldcheck v0.4.0 // indirect @@ -173,11 +157,7 @@ require ( github.com/nxadm/tail v1.4.11 // indirect github.com/oapi-codegen/runtime v1.3.1 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/pjbgf/sha1cd v0.3.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/princjef/gomarkdoc v1.1.0 // indirect - github.com/princjef/mageutil v1.0.0 // indirect - github.com/princjef/termdiff v0.1.0 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.67.5 // indirect @@ -190,7 +170,6 @@ require ( github.com/raeperd/recvcheck v0.2.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryancurrah/gomodguard v1.4.1 // indirect github.com/ryanrolds/sqlclosecheck v0.6.0 // indirect github.com/sagikazarmark/locafero v0.11.0 // indirect @@ -200,10 +179,8 @@ require ( github.com/sashamelentyev/usestdlibvars v1.29.0 // indirect github.com/securego/gosec/v2 v2.24.8-0.20260309165252-619ce2117e08 // indirect github.com/segmentio/golines v0.13.0 // indirect - github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/sivchari/containedctx v1.0.3 // indirect - github.com/skeema/knownhosts v1.3.1 // indirect github.com/sonatard/noctx v0.5.1 // indirect github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect @@ -226,7 +203,6 @@ require ( github.com/uudashr/gocognit v1.2.1 // indirect github.com/uudashr/iface v1.4.1 // indirect github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect - github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xen0n/gosmopolitan v1.3.0 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect @@ -249,17 +225,14 @@ require ( golang.org/x/crypto v0.49.0 // indirect golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 // indirect golang.org/x/mod v0.34.0 // indirect - golang.org/x/net v0.52.0 // indirect golang.org/x/sync v0.20.0 // indirect golang.org/x/sys v0.42.0 // indirect golang.org/x/term v0.41.0 // indirect golang.org/x/text v0.35.0 // indirect golang.org/x/tools v0.43.0 // indirect google.golang.org/protobuf v1.36.11 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect honnef.co/go/tools v0.7.0 // indirect mvdan.cc/gofumpt v0.9.2 // indirect mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect - mvdan.cc/xurls/v2 v2.2.0 // indirect ) diff --git a/go.sum b/go.sum index ab3179f..cd4945b 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,6 @@ codeberg.org/chavacava/garif v0.2.0 h1:F0tVjhYbuOCnvNcU3YSpO6b3Waw6Bimy4K0mM8y6M codeberg.org/chavacava/garif v0.2.0/go.mod h1:P2BPbVbT4QcvLZrORc2T29szK3xEOlnl0GiPTJmEqBQ= codeberg.org/polyfloyd/go-errorlint v1.9.0 h1:VkdEEmA1VBpH6ecQoMR4LdphVI3fA4RrCh2an7YmodI= codeberg.org/polyfloyd/go-errorlint v1.9.0/go.mod h1:GPRRu2LzVijNn4YkrZYJfatQIdS+TrcK8rL5Xs24qw8= -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dev.gaijin.team/go/exhaustruct/v4 v4.0.0 h1:873r7aNneqoBB3IaFIzhvt2RFYTuHgmMjoKfwODoI1Y= dev.gaijin.team/go/exhaustruct/v4 v4.0.0/go.mod h1:aZ/k2o4Y05aMJtiux15x8iXaumE88YdiB0Ai4fXOzPI= dev.gaijin.team/go/golib v0.6.0 h1:v6nnznFTs4bppib/NyU1PQxobwDHwCXXl15P7DV5Zgo= @@ -32,19 +30,11 @@ github.com/Djarvur/go-err113 v0.1.1 h1:eHfopDqXRwAi+YmCUas75ZE0+hoBHJ2GQNLYRSxao github.com/Djarvur/go-err113 v0.1.1/go.mod h1:IaWJdYFLg76t2ihfflPZnM1LIQszWOsFDh2hhhAVF6k= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= -github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/MirrexOne/unqueryvet v1.5.4 h1:38QOxShO7JmMWT+eCdDMbcUgGCOeJphVkzzRgyLJgsQ= github.com/MirrexOne/unqueryvet v1.5.4/go.mod h1:fs9Zq6eh1LRIhsDIsxf9PONVUjYdFHdtkHIgZdJnyPU= github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsuj3piCMx4= github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo= -github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw= -github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= -github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= -github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= -github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/chroma/v2 v2.23.1 h1:nv2AVZdTyClGbVQkIzlDm/rnhk1E9bU9nXwmZ/Vk/iY= @@ -67,12 +57,8 @@ github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQ github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/alingse/nilnesserr v0.2.0 h1:raLem5KG7EFVb4UIDAXgrv3N2JIaffeKNtcEXkEWd/w= github.com/alingse/nilnesserr v0.2.0/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/ashanbrown/forbidigo/v2 v2.3.0 h1:OZZDOchCgsX5gvToVtEBoV2UWbFfI6RKQTir2UZzSxo= github.com/ashanbrown/forbidigo/v2 v2.3.0/go.mod h1:5p6VmsG5/1xx3E785W9fouMxIOkvY2rRV9nMdWadd6c= github.com/ashanbrown/makezero/v2 v2.1.0 h1:snuKYMbqosNokUKm+R6/+vOPs8yVAi46La7Ck6QYSaE= @@ -118,19 +104,11 @@ github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0G github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= -github.com/cheggaaa/pb v2.0.7+incompatible/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/cheggaaa/pb/v3 v3.0.4/go.mod h1:7rgWxLrAUcFMkvJuv09+DYi7mMUYi8nO9iOWcvGJPfw= -github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA= -github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA= github.com/ckaznocha/intrange v0.3.1 h1:j1onQyXvHUsPWujDH6WIjhyH26gkRt/txNlV7LspvJs= github.com/ckaznocha/intrange v0.3.1/go.mod h1:QVepyz1AkUoFQkpEqksSYpNpUo3c5W7nWh/s6SHIJJk= -github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8= -github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+fbBAhrQPs= github.com/curioswitch/go-reassign v0.3.0/go.mod h1:nApPCCTtqLJN/s8HfItCcKV0jIPwluBOvZP+dsJGA88= -github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= -github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/daixiang0/gci v0.13.7 h1:+0bG5eK9vlI08J+J/NWGbWPTNiXPG4WhNLJOkSxWITQ= github.com/daixiang0/gci v0.13.7/go.mod h1:812WVN6JLFY9S6Tv76twqmNqevN0pa3SX3nih0brVzQ= github.com/dave/dst v0.27.3 h1:P1HPoMza3cMEquVf9kKy8yXsFirry4zEnWOdYPOoIzY= @@ -145,15 +123,8 @@ github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42 github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= -github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= @@ -169,18 +140,8 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/ghostiam/protogetter v0.3.20 h1:oW7OPFit2FxZOpmMRPP9FffU4uUpfeE/rEdE1f+MzD0= github.com/ghostiam/protogetter v0.3.20/go.mod h1:FjIu5Yfs6FT391m+Fjp3fbAYJ6rkL/J6ySpZBfnODuI= -github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= -github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-critic/go-critic v0.14.3 h1:5R1qH2iFeo4I/RJU8vTezdqs08Egi4u5p6vOESA0pog= github.com/go-critic/go-critic v0.14.3/go.mod h1:xwntfW6SYAd7h1OqDzmN6hBX/JxsEKl5up/Y2bsxgVQ= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.8.0 h1:I8hjc3LbBlXTtVuFNJuwYuMiHvQJDq1AT6u4DwDzZG0= -github.com/go-git/go-billy/v5 v5.8.0/go.mod h1:RpvI/rw4Vr5QA+Z60c6d6LXH0rYJo0uD5SqfmrrheCY= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.17.0 h1:AbyI4xf+7DsjINHMu35quAh4wJygKBKBuXVjV/pxesM= -github.com/go-git/go-git/v5 v5.17.0/go.mod h1:f82C4YiLx+Lhi8eHxltLeGC5uBTXSFa6PC5WW9o4SjI= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -219,8 +180,6 @@ github.com/godoc-lint/godoc-lint v0.11.2 h1:Bp0FkJWoSdNsBikdNgIcgtaoo+xz6I/Y9s5W github.com/godoc-lint/godoc-lint v0.11.2/go.mod h1:iVpGdL1JCikNH2gGeAn3Hh+AgN5Gx/I/cxV+91L41jo= github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= -github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= -github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golangci/asciicheck v0.5.0 h1:jczN/BorERZwK8oiFBOGvlGPknhvq0bjnysTj4nUfo0= github.com/golangci/asciicheck v0.5.0/go.mod h1:5RMNAInbNFw2krqN6ibBxN/zfRFa9S6tA1nPdM0l8qQ= github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 h1:WUvBfQL6EW/40l6OmeSBYQJNSif4O11+bmWEz+C7FYw= @@ -279,8 +238,6 @@ github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUq github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jgautheron/goconst v1.8.2 h1:y0XF7X8CikZ93fSNT6WBTb/NElBu9IjaY7CCYQrCMX4= github.com/jgautheron/goconst v1.8.2/go.mod h1:A0oxgBCHy55NQn6sYpO7UdnA9p+h7cPtoOZUmvNIako= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= @@ -292,17 +249,12 @@ github.com/julz/importas v0.2.0 h1:y+MJN/UdL63QbFJHws9BVC5RpA2iq0kpjrFajTGivjQ= github.com/julz/importas v0.2.0/go.mod h1:pThlt589EnCYtMnmhmRYY/qn9lCf/frPOK+WMx3xiJY= github.com/karamaru-alpha/copyloopvar v1.2.2 h1:yfNQvP9YaGQR7VaWLYcfZUlRP2eo2vhExWKxD/fP6q0= github.com/karamaru-alpha/copyloopvar v1.2.2/go.mod h1:oY4rGZqZ879JkJMtX3RRkcXRkmUvH0x35ykgaKgsgJY= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.10.0 h1:Lvs/YAHP24YKg08LA8oDw2z9fJVme090RAXd90S+rrw= github.com/kisielk/errcheck v1.10.0/go.mod h1:kQxWMMVZgIkDq7U8xtG/n2juOjbLgZtedi0D+/VL/i8= github.com/kkHAIKE/contextcheck v1.1.6 h1:7HIyRcnyzxL9Lz06NGhiKvenXq7Zw6Q0UQu/ttjfJCE= github.com/kkHAIKE/contextcheck v1.1.6/go.mod h1:3dDbMRNBFaq8HFXWC1JyvDSPm43CmE6IuHam8Wr0rkg= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.7.1 h1:fI8QITAoFVLx+y+vSyuLBP+rcVIB8jKooNSCT2EiI98= @@ -325,8 +277,6 @@ github.com/ldez/usetesting v0.5.0 h1:3/QtzZObBKLy1F4F8jLuKJiKBjjVFi1IavpoWbmqLwc github.com/ldez/usetesting v0.5.0/go.mod h1:Spnb4Qppf8JTuRgblLrEWb7IE6rDmUpGvxY3iRrzvDQ= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= -github.com/logrusorgru/aurora/v4 v4.0.0 h1:sRjfPpun/63iADiSvGGjgA1cAYegEWMPCJdUpJYn9JA= -github.com/logrusorgru/aurora/v4 v4.0.0/go.mod h1:lP0iIa2nrnT/qoFXcOZSrZQpJ1o6n2CUf/hyHi2Q4ZQ= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/macabu/inamedparam v0.2.0 h1:VyPYpOc10nkhI2qeNUdh3Zket4fcZjEWe35poddBCpE= @@ -341,22 +291,12 @@ github.com/maratori/testpackage v1.1.2 h1:ffDSh+AgqluCLMXhM19f/cpvQAKygKAJXFl9aU github.com/maratori/testpackage v1.1.2/go.mod h1:8F24GdVDFW5Ew43Et02jamrVMNXLUNaOynhDssITGfc= github.com/matoous/godox v1.1.0 h1:W5mqwbyWrwZv6OQ5Z1a/DHGMOvXYCBP3+Ht7KMoJhq4= github.com/matoous/godox v1.1.0/go.mod h1:jgE/3fUXiTurkdHOLT5WEkThTSuE7yxHv5iWPa80afs= -github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mgechev/revive v1.15.0 h1:vJ0HzSBzfNyPbHKolgiFjHxLek9KUijhqh42yGoqZ8Q= @@ -398,19 +338,9 @@ github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT9 github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4= -github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/princjef/gomarkdoc v1.1.0 h1:xtl7mESKQWVuGiFdd1AO3dFA6OenWG86bZu97IqBNPE= -github.com/princjef/gomarkdoc v1.1.0/go.mod h1:HI3w0Zv8H03ecak/IqVAcPFTuPt7sn7Top6xbgCs1Qk= -github.com/princjef/mageutil v1.0.0 h1:1OfZcJUMsooPqieOz2ooLjI+uHUo618pdaJsbCXcFjQ= -github.com/princjef/mageutil v1.0.0/go.mod h1:mkShhaUomCYfAoVvTKRcbAs8YSVPdtezI5j6K+VXhrs= -github.com/princjef/termdiff v0.1.0 h1:O3PWhfPFzX6GqzQ+41B3XzzJpMlx0+9Vysm+Pv76C9U= -github.com/princjef/termdiff v0.1.0/go.mod h1:JJOfCA/eR6T1JfsoxQQ6jsG3LGoQDoKUIRQrKqAO+p4= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= @@ -433,14 +363,11 @@ github.com/raeperd/recvcheck v0.2.0 h1:GnU+NsbiCqdC2XX5+vMZzP+jAJC5fht7rcVTAhX74 github.com/raeperd/recvcheck v0.2.0/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= github.com/retr0h/osapi v0.0.0-20260329025640-5e5b3c87c150 h1:myAfjno/+7oFGdhhi3GPxJnyY8aWAArfsf1BCvRTCdA= github.com/retr0h/osapi v0.0.0-20260329025640-5e5b3c87c150/go.mod h1:rM3VRcxtQ2by9hQpXFHJqMtZZdyaptp9weuICXBde5A= -github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.4.1 h1:eWC8eUMNZ/wM/PWuZBv7JxxqT5fiIKSIyTvjb7Elr+g= github.com/ryancurrah/gomodguard v1.4.1/go.mod h1:qnMJwV1hX9m+YJseXEBhd2s90+1Xn6x9dLz11ualI1I= @@ -464,13 +391,10 @@ github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= -github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= -github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= github.com/sonatard/noctx v0.5.1 h1:wklWg9c9ZYugOAk7qG4yP4PBrlQsmSLPTvW1K4PRQMs= github.com/sonatard/noctx v0.5.1/go.mod h1:64XdbzFb18XL4LporKXp8poqZtPKbCrqQ402CV+kJas= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= @@ -499,7 +423,6 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -534,8 +457,6 @@ github.com/uudashr/iface v1.4.1 h1:J16Xl1wyNX9ofhpHmQ9h9gk5rnv2A6lX/2+APLTo0zU= github.com/uudashr/iface v1.4.1/go.mod h1:pbeBPlbuU2qkNDn0mmfrxP2X+wjPMIQAy+r1MBXSXtg= github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= -github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= -github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xen0n/gosmopolitan v1.3.0 h1:zAZI1zefvo7gcpbCOrPSHJZJYA9ZgLfJqtKzZ5pHqQM= github.com/xen0n/gosmopolitan v1.3.0/go.mod h1:rckfr5T6o4lBtM1ga7mLGKZmLxswUoH1zxHgNXOsEt4= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= @@ -588,7 +509,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= @@ -618,7 +538,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= @@ -638,26 +557,18 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -709,24 +620,12 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= -gopkg.in/VividCortex/ewma.v1 v1.1.1/go.mod h1:TekXuFipeiHWiAlO1+wSS23vTcyFau5u3rxXUSXj710= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v2 v2.0.7/go.mod h1:0CiZ1p8pvtxBlQpLXkHuUTpdJ1shm3OqCF1QugkjHL4= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fatih/color.v1 v1.7.0/go.mod h1:P7yosIhqIl/sX8J8UypY5M+dDpD2KmyfP5IRs5v/fo0= -gopkg.in/mattn/go-colorable.v0 v0.1.0/go.mod h1:BVJlBXzARQxdi3nZo6f6bnl5yR20/tOL6p+V0KejgSY= -gopkg.in/mattn/go-isatty.v0 v0.0.4/go.mod h1:wt691ab7g0X4ilKZNmMII3egK0bTxl37fEn/Fwbd8gc= -gopkg.in/mattn/go-runewidth.v0 v0.0.4/go.mod h1:BmXejnxvhwdaATwiJbB1vZ2dtXkQKZGu9yLFCZb4msQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -736,5 +635,3 @@ mvdan.cc/gofumpt v0.9.2 h1:zsEMWL8SVKGHNztrx6uZrXdp7AX8r421Vvp23sz7ik4= mvdan.cc/gofumpt v0.9.2/go.mod h1:iB7Hn+ai8lPvofHd9ZFGVg2GOr8sBUw1QUWjNbmIL/s= mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 h1:ssMzja7PDPJV8FStj7hq9IKiuiKhgz9ErWw+m68e7DI= mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15/go.mod h1:4M5MMXl2kW6fivUT6yRGpLLPNfuGtU2Z0cPvFquGDYU= -mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A= -mvdan.cc/xurls/v2 v2.2.0/go.mod h1:EV1RMtya9D6G5DMYPGD8zTQzaHet6Jh8gFlRgGRJeO8= diff --git a/internal/engine/bridge_public_test.go b/internal/engine/bridge_public_test.go index 15c97df..23be9e9 100644 --- a/internal/engine/bridge_public_test.go +++ b/internal/engine/bridge_public_test.go @@ -31,6 +31,8 @@ type testNested struct { func (s *BridgePublicTestSuite) TestStructToMap() { tests := []struct { name string + setupFn func() + teardownFn func() input any validateFn func(m map[string]any) }{ @@ -85,10 +87,33 @@ func (s *BridgePublicTestSuite) TestStructToMap() { s.Nil(m) }, }, + { + name: "returns nil when unmarshal fails", + setupFn: func() { + engine.SetJSONUnmarshalFn(func( + _ []byte, + _ any, + ) error { + return fmt.Errorf("forced unmarshal error") + }) + }, + teardownFn: engine.ResetJSONUnmarshalFn, + input: testStruct{Name: "test"}, + validateFn: func(m map[string]any) { + s.Nil(m) + }, + }, } for _, tt := range tests { s.Run(tt.name, func() { + if tt.setupFn != nil { + tt.setupFn() + } + if tt.teardownFn != nil { + defer tt.teardownFn() + } + got := engine.StructToMap(tt.input) tt.validateFn(got) }) @@ -273,55 +298,3 @@ func (s *BridgePublicTestSuite) TestCollectionResult() { }) } } - -func (s *BridgePublicTestSuite) TestStructToMapUnmarshalError() { - type testInput struct { - Name string `json:"name"` - } - - tests := []struct { - name string - setupFn func() - teardownFn func() - input any - validateFunc func(result map[string]any) - }{ - { - name: "when unmarshal fails returns nil", - setupFn: func() { - engine.SetJSONUnmarshalFn(func( - _ []byte, - _ any, - ) error { - return fmt.Errorf("forced unmarshal error") - }) - }, - teardownFn: engine.ResetJSONUnmarshalFn, - input: testInput{Name: "test"}, - validateFunc: func(result map[string]any) { - s.Nil(result) - }, - }, - { - name: "when unmarshal succeeds returns populated map", - setupFn: func() {}, - teardownFn: func() {}, - input: testInput{Name: "test"}, - validateFunc: func(result map[string]any) { - s.NotNil(result) - s.Equal("test", result["name"]) - }, - }, - } - - for _, tt := range tests { - s.Run(tt.name, func() { - tt.setupFn() - defer tt.teardownFn() - - result := engine.StructToMap(tt.input) - - tt.validateFunc(result) - }) - } -}