locals

package
v0.2.0-rc10 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const BlockLocals = "locals"

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor struct{}

Processor processes local declarations in a block. This is the workhorse of the evaluator. It computes dependencies across local variables and evaluates them in dependency order checking for circularity. Given an eval context, it checks whether there is any expression that relies on an unknown local or on other unknown values in the eval context and produces an error if that is the case. At the end of processing, it returns a child context with the locals having computed values. Note that "computed" does not mean "complete" - locals may have incomplete values if they refer to resource properties that are not yet known.

func NewProcessor

func NewProcessor() *Processor

NewProcessor returns a locals processor.

func (*Processor) Expressions

func (l *Processor) Expressions(content *hcl.BodyContent) (map[string]hcl.Expression, hcl.Diagnostics)

Expressions returns expressions keyed by local name under the supplied content.

func (*Processor) Process

func (l *Processor) Process(ctx *hcl.EvalContext, content *hcl.BodyContent) (*hcl.EvalContext, hcl.Diagnostics)

Process processes all local blocks found in the supplied body contents as a single unit and returns a child context which has values for all locals.

Jump to

Keyboard shortcuts

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