expandBody wraps another hcl.Body and expands any "dynamic" blocks found inside whenever Content or PartialContent is called.
| 13 | // expandBody wraps another hcl.Body and expands any "dynamic" blocks found |
| 14 | // inside whenever Content or PartialContent is called. |
| 15 | type expandBody struct { |
| 16 | original hcl.Body |
| 17 | forEachCtx *hcl.EvalContext |
| 18 | iteration *iteration // non-nil if we're nested inside another "dynamic" block |
| 19 | valueMarks cty.ValueMarks |
| 20 | |
| 21 | checkForEach []func(cty.Value, hcl.Expression, *hcl.EvalContext) hcl.Diagnostics |
| 22 | |
| 23 | // These are used with PartialContent to produce a "remaining items" |
| 24 | // body to return. They are nil on all bodies fresh out of the transformer. |
| 25 | // |
| 26 | // Note that this is re-implemented here rather than delegating to the |
| 27 | // existing support required by the underlying body because we need to |
| 28 | // retain access to the entire original body on subsequent decode operations |
| 29 | // so we can retain any "dynamic" blocks for types we didn't take consume |
| 30 | // on the first pass. |
| 31 | hiddenAttrs map[string]struct{} |
| 32 | hiddenBlocks map[string]hcl.BlockHeaderSchema |
| 33 | } |
| 34 | |
| 35 | func (b *expandBody) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { |
| 36 | extSchema := b.extendSchema(schema) |
nothing calls this directly
no outgoing calls
no test coverage detected