refreshoutputs

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package refreshoutputs implements read-only state refresh — it reads current Outputs from providers and updates the persisted state when fields differ. It never invokes Update or Replace at the cloud level; the contract is strictly "Read and reconcile in-memory state".

Refresh is the foundation for two consumers in W-2:

  • wfctl infra refresh-outputs (T2.2): explicit operator-driven refresh.
  • wfctl infra apply pre-step (T2.3): opt-in via WFCTL_REFRESH_OUTPUTS to keep stale outputs from poisoning the planner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Refresh

Refresh issues a bounded-concurrency Read against p for each entry in states and returns a copy with Outputs reconciled to the live values. Resources whose live Outputs are deeply equal to the persisted Outputs are returned unchanged (callers can rely on this to skip writes).

Refresh never mutates the input slice. The returned slice is a fresh copy of states with possibly-updated Outputs maps; on any Read or ResourceDriver failure, Refresh returns (nil, err) and discards partial progress so callers don't half-persist a refresh.

Aliasing: for entries whose live Outputs match the persisted Outputs, out[i].Outputs is the same map as states[i].Outputs (unchanged maps are not cloned). Callers must not mutate Outputs maps in the returned slice in place.

Types

type Options

type Options struct {
	// Concurrency is the maximum number of concurrent Read calls. Values < 1
	// fall back to defaultConcurrency (8).
	Concurrency int
}

Options tunes Refresh behaviour. The zero value is valid and uses defaultConcurrency.

Jump to

Keyboard shortcuts

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