hcl/hclpack/doc.go
Martin Atkins 5e07d8e1f9 hclpack: New package for wire representations of hcl bodies
In most applications it's possible to fully evaluate configuration at the
beginning and work only with resolved values after that, but in some
unusual cases it's necessary to split parsing and decoding between two
separate processes connected by a pipe or network connection.

hclpack is intended to provide compact wire formats for sending bodies
over the network such that they can be decoded and evaluated and get the
same results. This is not something that can happen fully automatically
because a hcl.Body is an abstract node rather than a physical construct,
and so access to the original source code is required to construct such
a representation, and to interpret any source ranges that emerged from
the final evaluation.
2018-11-10 09:36:26 -08:00

15 lines
848 B
Go

// Package hclpack provides a straightforward representation of HCL block/body
// structure that can be easily serialized and deserialized for compact
// transmission (e.g. over a network) without transmitting the full source code.
//
// Expressions are retained in native syntax source form so that their
// evaluation can be delayed until a package structure is decoded by some
// other system that has enough information to populate the evaluation context.
//
// Packed structures retain source location information but do not retain
// actual source code. To make sense of source locations returned in diagnostics
// and via other APIs the caller must somehow gain access to the original source
// code that the packed representation was built from, which is a problem that
// must be solved somehow by the calling application.
package hclpack