Documentation
¶
Index ¶
- func DeduplicateTargets(targets []ResolvedTarget) ([]ResolvedTarget, []ItemResult)deprecated
- func ExitCodeFromReport(report Report) int
- func FormatHuman(report Report) string
- func HasExecutableTargets(targets []PreparedTarget) bool
- func ResolveTargets(raw []RawTarget) ([]ResolvedTarget, []ItemResult)deprecated
- type ExecuteOptionsdeprecated
- type ExecutionMode
- type ItemResult
- type ItemResultStatus
- type OperationType
- type Plandeprecated
- type PlanItemdeprecated
- type PreparedTarget
- type RawTarget
- type Report
- type ResolvedTargetdeprecated
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeduplicateTargets
deprecated
func DeduplicateTargets(targets []ResolvedTarget) ([]ResolvedTarget, []ItemResult)
DeduplicateTargets keeps first occurrence and reports duplicates as skipped.
Deprecated: transitional v1.1 helper from the legacy plan-based path. Prefer PrepareTargets for new code.
func ExitCodeFromReport ¶
ExitCodeFromReport returns zero when all items succeeded or were skipped.
func FormatHuman ¶
FormatHuman renders a stable, human-readable report.
func HasExecutableTargets ¶
func HasExecutableTargets(targets []PreparedTarget) bool
HasExecutableTargets reports whether at least one target can be executed.
func ResolveTargets
deprecated
func ResolveTargets(raw []RawTarget) ([]ResolvedTarget, []ItemResult)
ResolveTargets validates and parses raw targets into integer IDs.
Deprecated: transitional v1.1 helper from the legacy plan-based path. Prefer PrepareTargets for new code.
Types ¶
type ExecuteOptions
deprecated
type ExecutionMode ¶ added in v1.2.0
type ExecutionMode string
ExecutionMode identifies batch execution strategy semantics.
const ( ExecutionModeContinueOnError ExecutionMode = "continue_on_error" ExecutionModeFailFast ExecutionMode = "fail_fast" )
type ItemResult ¶
type ItemResult struct {
ID int64 `json:"id"`
RawValue string `json:"raw_value,omitempty"`
Status ItemResultStatus `json:"status"`
Message string `json:"message,omitempty"`
InvariantCode string `json:"invariant_code,omitempty"`
RecommendedAction string `json:"recommended_action,omitempty"`
OutputPath string `json:"output_path,omitempty"`
OriginalName string `json:"original_name,omitempty"`
}
ItemResult describes the outcome of one target.
type ItemResultStatus ¶
type ItemResultStatus string
ItemResultStatus is the per-item execution outcome.
const ( ResultSuccess ItemResultStatus = "success" ResultFailed ItemResultStatus = "failed" ResultSkipped ItemResultStatus = "skipped" ResultPlanned ItemResultStatus = "planned" )
type OperationType ¶
type OperationType string
OperationType identifies the command-level operation executed in a batch.
const ( OperationRestore OperationType = "restore" OperationRemove OperationType = "remove" OperationRepair OperationType = "repair" )
type Plan
deprecated
type Plan struct {
Items []PlanItem
}
Plan is a sequence of planned operations.
Deprecated: transitional v1.1 type used only by legacy plan-based helpers.
func BuildPlan
deprecated
func BuildPlan(op OperationType, targets []ResolvedTarget) Plan
BuildPlan creates a deterministic execution plan from resolved targets.
Deprecated: transitional v1.1 helper from the legacy plan-based path. Prefer PrepareTargets + ExecutePrepared for new code.
type PlanItem
deprecated
type PlanItem struct {
Op OperationType
Target ResolvedTarget
Skipped bool
Reason string
}
PlanItem is a single planned batch operation.
Deprecated: transitional v1.1 type used only by legacy plan-based helpers.
type PreparedTarget ¶
type PreparedTarget struct {
ID int64
Executable bool
Result ItemResult
}
PreparedTarget retains input-order target preparation state.
func PrepareTargets ¶
func PrepareTargets(raw []RawTarget) []PreparedTarget
PrepareTargets parses and deduplicates raw targets while preserving input order.
type Report ¶
type Report struct {
Operation OperationType `json:"operation"`
DryRun bool `json:"dry_run"`
ExecutionMode ExecutionMode `json:"execution_mode"`
Summary Summary `json:"summary"`
Results []ItemResult `json:"results"`
}
Report contains per-item outcomes and an aggregate summary.
func ExecutePlan
deprecated
func ExecutePrepared ¶
func ExecutePrepared(op OperationType, dryRun bool, failFast bool, targets []PreparedTarget, execFunc func(id int64) ItemResult) Report
ExecutePrepared runs prepared targets in input order.
func NewReport ¶
func NewReport(op OperationType, dryRun bool, results []ItemResult) Report
NewReport builds a report and computes its summary.
type ResolvedTarget
deprecated
type ResolvedTarget struct {
ID int64
}
ResolvedTarget is a validated target ready for planning.
Deprecated: transitional v1.1 type kept for legacy plan-based helpers (ResolveTargets/DeduplicateTargets/BuildPlan/ExecutePlan). New CLI paths use RawTarget -> PrepareTargets -> ExecutePrepared.
type Summary ¶
type Summary struct {
Total int `json:"total"`
Planned int `json:"planned"`
Success int `json:"success"`
Failed int `json:"failed"`
Skipped int `json:"skipped"`
}
Summary aggregates all item outcomes.
func Summarize ¶
func Summarize(results []ItemResult) Summary
Summarize computes aggregate counts from per-item results.