mapexpr

package
v0.9.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mapexpr implements the `map` block as an HCL expression type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	ForEach    hhcl.Expression
	Iterator   string
	Key        hhcl.Expression
	ValueAttr  hhcl.Expression
	ValueBlock *ast.MergedBlock
}

Attributes of the MapExpr block.

type MapExpr

type MapExpr struct {
	Origin   info.Range
	Attrs    Attributes
	Children []*MapExpr
}

MapExpr represents a `map` block.

func NewMapExpr

func NewMapExpr(block *ast.MergedBlock) (*MapExpr, error)

NewMapExpr creates a new MapExpr instance.

func (*MapExpr) Range

func (m *MapExpr) Range() hhcl.Range

Range of the map block.

func (*MapExpr) StartRange

func (m *MapExpr) StartRange() hhcl.Range

StartRange of the map block.

func (*MapExpr) Value

func (m *MapExpr) Value(ctx *hhcl.EvalContext) (cty.Value, hhcl.Diagnostics)

Value evaluates the map block.

func (*MapExpr) Variables

func (m *MapExpr) Variables() []hhcl.Traversal

Variables returns the outer variables referenced by the map block. It ignores local scoped variables.

Directories

Path Synopsis
Package test implements testcases and test helpers for dealing with map blocks.
Package test implements testcases and test helpers for dealing with map blocks.

Jump to

Keyboard shortcuts

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