package
0.0.0-20191002203319-fb75b3253c80
Repository: https://github.com/hashicorp/hcl2.git
Documentation: pkg.go.dev

# Functions

ChildBlockTypes returns a map of all of the child block types declared by the given spec, with block type names as keys and the associated nested body specs as values.
Decode interprets the given body using the given specification and returns the resulting value.
ImpliedSchema returns the *hcl.BodySchema implied by the given specification.
ImpliedType returns the value type that should result from decoding the given spec.
PartialDecode is like Decode except that it permits "leftover" items in the top-level body, which are returned as a new body to allow for further processing.
SourceRange interprets the given body using the given specification and then returns the source range of the value that would be used to fulfill the spec.
Variables processes the given body with the given spec and returns a list of the variable traversals that would be required to decode the same pairing of body and spec.

# Structs

An AttrSpec is a Spec that evaluates a particular attribute expression in the body and returns its resulting value converted to the requested type, or produces a diagnostic if the type is incorrect.
A BlockAttrsSpec is a Spec that interprets a single block as if it were a map of some element type.
A BlockLabelSpec is a Spec that returns a cty.String representing the label of the block its given body belongs to, if indeed its given body belongs to a block.
A BlockListSpec is a Spec that produces a cty list of the results of decoding all of the nested blocks of a given type, using a nested spec.
A BlockMapSpec is a Spec that produces a cty map of the results of decoding all of the nested blocks of a given type, using a nested spec.
A BlockObjectSpec is a Spec that produces a cty object of the results of decoding all of the nested blocks of a given type, using a nested spec.
A BlockSetSpec is a Spec that produces a cty set of the results of decoding all of the nested blocks of a given type, using a nested spec.
A BlockSpec is a Spec that produces a cty.Value by decoding the contents of a single nested block of a given type, using a nested spec.
A BlockTupleSpec is a Spec that produces a cty tuple of the results of decoding all of the nested blocks of a given type, using a nested spec.
DefaultSpec is a spec that wraps two specs, evaluating the primary first and then evaluating the default if the primary returns a null value.
An ExprSpec is a Spec that evaluates the given expression, ignoring the given body.
A LiteralSpec is a Spec that produces the given literal value, ignoring the given body.
TransformExprSpec is a spec that wraps another and then evaluates a given hcl.Expression on the result.
TransformFuncSpec is a spec that wraps another and then evaluates a given cty function with the result.

# Interfaces

A Spec is a description of how to decode a hcl.Body to a cty.Value.

# Type aliases

An ObjectSpec is a Spec that produces a cty.Value of an object type whose attributes correspond to the keys of the spec map.
A TupleSpec is a Spec that produces a cty.Value of a tuple type whose elements correspond to the elements of the spec slice.