A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/terramate-io/terramate@v0.14.4/generate/genhcl below:

genhcl package - github.com/terramate-io/terramate/generate/genhcl - Go Packages

Overview

Package genhcl implements generate_hcl code generation.

Index Constants View Source
const (
	// HeaderMagic is the current header magic string used by generate_hcl code generation.
	HeaderMagic = "TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT"

	// HeaderV0 is the deprecated header string used by generate_hcl code generation.
	HeaderV0 = "// GENERATED BY TERRAMATE: DO NOT EDIT"
)
View Source
const (
	// ErrParsing indicates the failure of parsing the generate_hcl block.
	ErrParsing errors.Kind = "parsing generate_hcl block"

	// ErrContentEval indicates the failure to evaluate the content block.
	ErrContentEval errors.Kind = "evaluating content"

	// ErrConditionEval indicates the failure to evaluate the condition attribute.
	ErrConditionEval errors.Kind = "evaluating condition attribute"

	// ErrInheritEval indicates the failure to evaluate the inherit attribute.
	ErrInheritEval errors.Kind = "evaluating inherit attribute"

	// ErrInvalidConditionType indicates the condition attribute
	// has an invalid type.
	ErrInvalidConditionType errors.Kind = "invalid condition type"

	// ErrInvalidInheritType indicates the inherit attribute has an invalid type.
	ErrInvalidInheritType errors.Kind = "invalid inherit type"

	// ErrInvalidDynamicIterator indicates that the iterator of a tm_dynamic block
	// is invalid.
	ErrInvalidDynamicIterator errors.Kind = "invalid tm_dynamic.iterator"

	// ErrInvalidDynamicLabels indicates that the labels of a tm_dynamic block is invalid.
	ErrInvalidDynamicLabels errors.Kind = "invalid tm_dynamic.labels"

	// ErrDynamicAttrsEval indicates that the attributes of a tm_dynamic cant be evaluated.
	ErrDynamicAttrsEval errors.Kind = "evaluating tm_dynamic.attributes"

	// ErrDynamicConditionEval indicates that the condition of a tm_dynamic cant be evaluated.
	ErrDynamicConditionEval errors.Kind = "evaluating tm_dynamic.condition"

	// ErrDynamicAttrsConflict indicates fields of tm_dynamic conflicts.
	ErrDynamicAttrsConflict errors.Kind = "tm_dynamic.attributes and tm_dynamic.content have conflicting fields"
)
Variables

This section is empty.

Functions func DefaultHeader added in v0.5.0

DefaultHeader returns the header for the default comment style.

func Header

Header returns the HCL header based on the comment style.

Types type CommentStyle added in v0.5.0

CommentStyle is the configured comment style that must be generated.

Comment styles supported.

func CommentStyleFromConfig added in v0.5.0

CommentStyleFromConfig returns the CommentStyle from the configuration or the default if not defined.

func (CommentStyle) String added in v0.5.0 type HCL
type HCL struct {
	// contains filtered or unexported fields
}

HCL represents generated HCL code from a single block. Is contains parsed and evaluated code on it and information about the origin of the generated code.

func Load

Load loads from the file system all generate_hcl for a given stack. It will navigate the file system from the stack dir until it reaches rootdir, loading generate_hcl and merging them appropriately.

All generate_file blocks must have unique labels, even ones at different directories. Any conflicts will be reported as an error.

Metadata and globals for the stack are used on the evaluation of the generate_hcl blocks.

The rootdir MUST be an absolute path.

func (HCL) Asserts

Asserts returns all (if any) of the evaluated assert configs of the generate_hcl block. If HCL.Condition returns false then assert configs will always be empty since they are not evaluated at all in that case.

func (HCL) Body

Body returns a string representation of the HCL code or an empty string if the config itself is empty.

func (HCL) Builtin added in v0.10.1

Builtin returns false for generate_hcl blocks.

func (HCL) Condition

Condition returns the evaluated condition attribute for the generated code.

func (HCL) Context

Context of the generate_hcl block.

func (HCL) Header

Header returns the header of the generated HCL file.

func (HCL) Label

Label of the original generate_hcl block.

func (HCL) Range

Range returns the range information of the generate_file block.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4