reference

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string

Kind identifies the type of entity a reference points to.

const (
	// KindVariable references a declared input variable (var.<name>).
	KindVariable Kind = "variable"

	// KindComputed references a computed value (computed.<name>).
	KindComputed Kind = "computed"

	// KindTask references a task (task.<name>).
	KindTask Kind = "task"
)

type Located

type Located struct {
	Ref   Ref
	Range hcl.Range
}

Located pairs a Ref with the source range where the reference was written, so hcl.Diagnostic can point to the exact position.

func FromExpr

func FromExpr(expr hcl.Expression) ([]Located, hcl.Diagnostics)

FromExpr extracts all references from the variables in an hcl.Expression. Traversals that cannot be resolved into a known reference kind are reported as hcl.Diagnostic and excluded from the result.

func FromTraversal

func FromTraversal(t hcl.Traversal) (Located, hcl.Diagnostics)

FromTraversal resolves an hcl.Traversal into a Located reference. The traversal must have the form <kind>.<name>, where kind is one of "var", "computed", or "task". The returned Located carries the traversal's source range.

type Ref

type Ref struct {
	Kind Kind
	Name string
}

Ref is a resolved reference to a named playbook entity. It serves as the identity key for map lookups and DAG vertices.

Jump to

Keyboard shortcuts

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