Documentation
¶
Overview ¶
Package call implements the bind and expand engine for parameterized provider calls (spec.calls). It is a pure utility over pkg/spec: it binds already-resolved call-site argument values against a Call definition's declared arguments and builds the enriched evaluation data that exposes those arguments under the "args" namespace. It deliberately imports only pkg/spec so that provider dispatch (which lives in the resolver and action executors) can depend on it without creating an import cycle.
Index ¶
Constants ¶
const ArgsNamespace = "args"
ArgsNamespace is the key under which bound arguments are exposed in the evaluation data. Definition inputs reference arguments as _.args.x (CEL) and {{ .args.x }} (Go templates).
Variables ¶
This section is empty.
Functions ¶
func BindArgs ¶
BindArgs binds already-resolved call-site argument values against a Call definition's ArgDefs. It rejects unknown arguments, enforces required arguments, applies defaults for omitted optional arguments, and coerces every value to its declared type. The returned map contains exactly the declared arguments. callName is included in all error messages so diagnostics are call-site aware.
func DedupKey ¶
DedupKey builds a stable, canonical de-duplication key for a call invocation. The key combines the call name with a canonical JSON encoding of the bound arguments so that logically-equal argument sets collide regardless of the order in which they were written. Bound arguments must already be coerced.
func ExpandData ¶
ExpandData returns a shallow copy of resolverData with the bound arguments injected under the args namespace so definition inputs and the invoked provider can reference them as _.args.x and {{ .args.x }}. The input map is not mutated.
Types ¶
type Memo ¶
type Memo struct {
// contains filtered or unexported fields
}
Memo is a per-run, in-memory memo for opt-in call de-duplication. It is never persisted and is scoped to a single run. Each key computes its value exactly once, even under concurrent access, so identical bound arguments within a run reuse the first result instead of re-invoking the provider.