hclutils

package
v0.10.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package hclutils provides useful functions to build HCL documents. It is usually imported with . so building HCL documents can be done very fluently and yet in a type safe manner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Assert is a helper for a "assert" block.

func Backend

func Backend(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Backend is a helper for a "backend" block.

func Block

func Block(name string, builders ...hclwrite.BlockBuilder) *hclwrite.Block

Block is a helper for creating arbitrary blocks of specified name/type.

func Bool

func Bool(name string, val bool) hclwrite.BlockBuilder

Bool is a helper for a boolean attribute.

func Command added in v0.9.0

func Command(args ...string) hclwrite.BlockBuilder

Command is a helper for a "command" attribute.

func Commands added in v0.9.0

func Commands(args ...[]string) hclwrite.BlockBuilder

Commands is a helper for a "commands" attribute.

func Config

func Config(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Config is a helper for a "config" block.

func Content

func Content(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Content is a helper for a "content" block.

func Default

func Default(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Default is a helper for a "default" block.

func Doc

func Doc(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Doc is a helper for a HCL document.

func Env

func Env(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Env is a helper for a "env" block.

func EvalExpr

func EvalExpr(t *testing.T, name string, expr string) hclwrite.BlockBuilder

EvalExpr accepts an expr as the attribute value, similar to Expr, but will evaluate the expr and store the resulting value so it will be available as an attribute value instead of as an expression. If evaluation fails the test caller will fail.

The evaluation is quite limited, only suitable for evaluating objects/lists/etc, but won't work with any references to namespaces except default Terraform function calls.

func Experiments added in v0.10.1

func Experiments(names ...string) hclwrite.BlockBuilder

Experiments is a helper for adding an `experiments` attribute.

func Expr

func Expr(name string, expr string) hclwrite.BlockBuilder

Expr is a helper for a HCL expression.

func GenerateFile

func GenerateFile(builders ...hclwrite.BlockBuilder) *hclwrite.Block

GenerateFile is a helper for a "generate_file" block.

func GenerateHCL

func GenerateHCL(builders ...hclwrite.BlockBuilder) *hclwrite.Block

GenerateHCL is a helper for a "generate_hcl" block.

func Globals

func Globals(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Globals is a helper for a "globals" block.

func Import

func Import(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Import is a helper for an "import" block.

func Input added in v0.10.1

func Input(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Input is a helper for an "input" block.

func Labels

func Labels(labels ...string) hclwrite.BlockBuilder

Labels is a helper for adding labels to a block.

func Lets

func Lets(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Lets is a helper for a "lets" block.

func Locals

func Locals(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Locals is a helper for a "locals" block.

func Manifest

func Manifest(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Manifest is a helper for a "manifest" block.

func Map

func Map(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Map is a helper for a "map" block.

func Module

func Module(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Module is a helper for a "module" block.

func Number

func Number(name string, val int64) hclwrite.BlockBuilder

Number is a helper for a number attribute.

func Output added in v0.10.1

func Output(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Output is a helper for an "output" block.

func ProjectPaths added in v0.4.4

func ProjectPaths(paths ...string) hclwrite.BlockBuilder

ProjectPaths is a helper for adding a "project_paths" attribute.

func RepositoryPaths added in v0.4.4

func RepositoryPaths(paths ...string) hclwrite.BlockBuilder

RepositoryPaths is a helper for adding a "project_paths" attribute.

func Run

func Run(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Run is a helper for a "run" block.

func Script added in v0.9.0

func Script(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Script is a helper for a "script" block.

func Stack

func Stack(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Stack is a helper for a "stack" block.

func StackFilter added in v0.4.4

func StackFilter(builders ...hclwrite.BlockBuilder) *hclwrite.Block

StackFilter is a helper for a "stack_filter" block.

func Str

func Str(name string, val string) hclwrite.BlockBuilder

Str is a helper for a string attribute.

func Terraform

func Terraform(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Terraform is a helper for a "terraform" block.

func Terramate

func Terramate(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Terramate is a helper for a "terramate" block.

func TmDynamic

func TmDynamic(builders ...hclwrite.BlockBuilder) *hclwrite.Block

TmDynamic is a helper for a "generate_hcl" block.

func Trigger

func Trigger(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Trigger is a helper for a "trigger" block.

func Value

func Value(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Value is a helper for a "value" block.

func Variable

func Variable(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Variable is a helper for a "generate_hcl" block.

func Vendor

func Vendor(builders ...hclwrite.BlockBuilder) *hclwrite.Block

Vendor is a helper for a "vendor" block.

Types

This section is empty.

Jump to

Keyboard shortcuts

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