Documentation
¶
Overview ¶
Package variables is the catalog of every Argo Workflows expression variable. Each variable is declared once via Define (in util/variables/keys/) and obtains a *Key handle. A *Scope's storage is unexported, so Key.Set and Key.SetSkipped are its only write paths and both key entries through the catalog — the Scope write sites therefore cannot drift from the catalog.
Scopes that are not a *Scope (the metric, loop and retry substitution maps are plain map[string]string) still derive their keys from the catalog via Key.Template / Key.Concretize, but, being ordinary maps, are not structurally constrained to it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllTemplateKinds = []TemplateKind{ TmplContainer, TmplContainerSet, TmplScript, TmplResource, TmplSteps, TmplDAG, TmplData, TmplSuspend, TmplHTTP, TmplPlugin, TmplExitHandler, TmplCronWorkflow, }
Functions ¶
func GenerateMarkdown ¶
func GenerateMarkdown() string
GenerateMarkdown renders the catalog as Markdown. Sections: alphabetical index, by Kind, matrix by TemplateKind, by LifecyclePhase.
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is the handle for a single variable. Obtainable only via Define.
func Define ¶
Define registers a variable and returns its handle. Panics on duplicate or empty Template — these are programmer errors.
func (*Key) Concretize ¶
Concretize substitutes placeholders in Template with the given args.
func (*Key) SetSkipped ¶
SetSkipped writes through a Key, marking the variable as skipped
type LifecyclePhase ¶
type LifecyclePhase string
LifecyclePhase is a coarse point-in-time within one workflow execution. Phase names are surfaced verbatim in the generated docs.
const ( PhWorkflowStart LifecyclePhase = "workflow-start" PhPreDispatch LifecyclePhase = "pre-dispatch" PhDuringExecute LifecyclePhase = "during-execute" PhInsideLoop LifecyclePhase = "inside-loop" PhInsideRetry LifecyclePhase = "inside-retry" PhAfterNodeInit LifecyclePhase = "after-node-init" PhAfterPodStart LifecyclePhase = "after-pod-start" PhAfterNodeComplete LifecyclePhase = "after-node-complete" PhAfterNodeSucceeded LifecyclePhase = "after-node-succeeded" PhAfterLoop LifecyclePhase = "after-loop" PhExitHandler LifecyclePhase = "exit-handler" PhMetricEmission LifecyclePhase = "metric-emission" PhCronEval LifecyclePhase = "cron-eval" )
func ReachablePhases ¶
func ReachablePhases(k TemplateKind) []LifecyclePhase
ReachablePhases returns the lifecycle phases that can actually fire from inside a template body of the given kind. Used by the doc generator to gate matrix `•` marks: a variable is only shown reachable from a TemplateKind column if at least one of its declared phases is in this set. This prevents "narrow" phases (PhInsideLoop, PhInsideRetry, PhExitHandler, PhCronEval) from leaking into columns that never enter those phases — e.g. `item` showing up under the exit-handler column.
TmplExitHandler is treated as a context, not a body type: any leaf body (container/script/etc.) can serve as an onExit handler, but the matrix renders it as a separate column for catalog readers, so its column reflects exit-handler semantics rather than generic body semantics.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope holds variable values. Writes only via Key.Set.
func (*Scope) AsStringMap ¶
AsStringMap returns a snapshot of string-valued entries. Nil-safe.
type Spec ¶
type Spec struct {
Template string
Kind Kind
ValueType string
AppliesTo []TemplateKind
Phases []LifecyclePhase
Description string
}
Spec holds a Key's metadata. Passed to Define.
type TemplateKind ¶
type TemplateKind string
TemplateKind categorises a wfv1.Template by its body type.
const ( TmplAll TemplateKind = "any" TmplContainer TemplateKind = "container" TmplContainerSet TemplateKind = "container-set" TmplScript TemplateKind = "script" TmplResource TemplateKind = "resource" TmplSteps TemplateKind = "steps" TmplDAG TemplateKind = "dag" TmplData TemplateKind = "data" TmplSuspend TemplateKind = "suspend" TmplHTTP TemplateKind = "http" TmplPlugin TemplateKind = "plugin" TmplExitHandler TemplateKind = "exit-handler" TmplCronWorkflow TemplateKind = "cron-workflow" )