Commit Graph

2 Commits

Author SHA1 Message Date
Martin Atkins 3327dee567 Change module path to github.com/hashicorp/hcl/v2
This is in preparation for the first v2 release from the main HCL
repository.
2019-09-09 15:46:40 -07:00
Martin Atkins 1b9738a196 gohcl: EncodeIntoBody and EncodeAsBlock functions
These are wrappers around the lower-level hclwrite package that are able
to reverse a subset of the behavior of the Decode functions to populate
an hclwrite DOM.

They are not fully symmetrical with DecodeBody because that function can
leave certain parts of the configuration in its opaque form for later
decoding, and these encode functions don't have enough information to
repack that abstract/opaque form into new source code.

In practice we expect that callers using complex techniques like partial
decoding will also use more complex techniques with the hclwrite API
directly, since they will need to coordinate partial _encoding_ of data
that has been portioned off into separate structures, which gohcl is not
equipped to do itself.
2018-11-04 01:16:51 +00:00