hcl/hcldec
Martin Atkins bb724af7fd hcldec: BlockAttrsSpec spec type
This is the hcldec interface to Body.JustAttributes, producing a map whose
keys are the child attribute names and whose values are the results of
evaluating those expressions.

We can't just expose a JustAttributes-style spec directly here because
it's not really compatible with how hcldec thinks about things, but we
can expose a spec that decodes a specific child block because that can
then compose properly with other specs at the same level without
interfering with their operation.

The primary use for this is to allow the use of the block syntax to define
a map:

    dynamic_stuff {
      foo = "bar"
    }

JustAttributes is normally used in static analysis situations such as
enumerating the contents of a block to decide what to include in the
final EvalContext. That's not really possible with the hcldec model
because both structural decoding and expression evaluation happen
together. Therefore the use of this is pretty limited: it's useful if you
want to be compatible with an existing format based on legacy HCL where a
map was conventionally defined using block syntax, relying on the fact
that HCL did not make a strong distinction between attribute and block
syntax.
2018-08-09 16:53:16 -07:00
..
block_labels.go hcldec: BlockLabelSpec decoding 2017-10-03 15:59:20 -07:00
decode.go hcldec: ImpliedType function 2017-10-03 16:27:34 -07:00
doc.go Update doc comments and readmes for zcl -> HCL. 2017-09-11 16:56:31 -07:00
gob.go hcldec: BlockLabelSpec decoding 2017-10-03 15:59:20 -07:00
public_test.go hcldec: BlockAttrsSpec spec type 2018-08-09 16:53:16 -07:00
public.go hcldec: Fix DefaultSpec to allow attribute and block specs 2018-05-22 15:06:42 -07:00
schema.go hcldec: ImpliedSchema must visit deep specs 2017-10-03 12:17:47 -07:00
spec_test.go hcldec: BlockAttrsSpec spec type 2018-08-09 16:53:16 -07:00
spec.go hcldec: BlockAttrsSpec spec type 2018-08-09 16:53:16 -07:00
variables_test.go hcldec: BlockAttrsSpec spec type 2018-08-09 16:53:16 -07:00
variables.go hcldec: Variables must visit deeply-nested specifications 2018-05-24 12:11:53 -07:00