lets

package
v0.8.4 Latest Latest
Warning

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

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

Documentation

Overview

Package lets provides parsing and evaluation of lets blocks.

Index

Constants

View Source
const (
	ErrEval      errors.Kind = "lets eval"
	ErrRedefined errors.Kind = "lets redefined"
)

Errors returned when parsing and evaluating lets.

Variables

This section is empty.

Functions

func Load

func Load(letblock *ast.MergedBlock, ctx *eval.Context) error

Load loads all the lets from the hcl blocks.

Types

type Expr

type Expr struct {
	// Origin contains the information where the expr is defined.
	Origin info.Range

	hhcl.Expression
}

Expr is an unevaluated let expression.

type Exprs

type Exprs map[string]Expr

Exprs is the map of unevaluated let expressions visible in a directory.

func (Exprs) Eval

func (letExprs Exprs) Eval(ctx *eval.Context) error

Eval evaluates all lets expressions and returns an EvalReport..

type Map

type Map map[string]Value

Map is an evaluated lets map.

func (Map) Attributes

func (lets Map) Attributes() map[string]cty.Value

Attributes returns all the lets attributes, the key in the map is the attribute name with its corresponding value mapped

func (Map) String

func (lets Map) String() string

String provides a string representation of the evaluated lets.

type Value

type Value struct {
	Origin info.Range

	cty.Value
}

Value is an evaluated let.

Jump to

Keyboard shortcuts

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