A Spec is a description of how to decode a hcl.Body to a cty.Value. The various other types in this package whose names end in "Spec" are the spec implementations. The most common top-level spec is ObjectSpec, which decodes body content into a cty.Value of an object type.
| 21 | // the spec implementations. The most common top-level spec is ObjectSpec, |
| 22 | // which decodes body content into a cty.Value of an object type. |
| 23 | type Spec interface { |
| 24 | // Perform the decode operation on the given body, in the context of |
| 25 | // the given block (which might be null), using the given eval context. |
| 26 | // |
| 27 | // "block" is provided only by the nested calls performed by the spec |
| 28 | // types that work on block bodies. |
| 29 | decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) |
| 30 | |
| 31 | // Return the cty.Type that should be returned when decoding a body with |
| 32 | // this spec. |
| 33 | impliedType() cty.Type |
| 34 | |
| 35 | // Call the given callback once for each of the nested specs that would |
| 36 | // get decoded with the same body and block as the receiver. This should |
| 37 | // not descend into the nested specs used when decoding blocks. |
| 38 | visitSameBodyChildren(cb visitFunc) |
| 39 | |
| 40 | // Determine the source range of the value that would be returned for the |
| 41 | // spec in the given content, in the context of the given block |
| 42 | // (which might be null). If the corresponding item is missing, return |
| 43 | // a place where it might be inserted. |
| 44 | sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range |
| 45 | } |
| 46 | |
| 47 | type visitFunc func(spec Spec) |
| 48 |
no outgoing calls
no test coverage detected