forked from hashicorp/hcl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hcldec: New function ChildBlockTypes
This function returns a map describing all of the child block types declared inside a spec. This can be used for recursive decoding of bodies using the low-level HCL API, though in most cases callers should just use Decode which does recursive decoding of an entire nested structure in a single call.
- Loading branch information
1 parent
45c6cc8
commit 130b3c5
Showing
3 changed files
with
64 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
package hcldec | ||
|
||
// Verify that all of our spec types implement the necessary interfaces | ||
var objectSpecAsSpec Spec = ObjectSpec(nil) | ||
var tupleSpecAsSpec Spec = TupleSpec(nil) | ||
var attrSpecAsSpec Spec = (*AttrSpec)(nil) | ||
var literalSpecAsSpec Spec = (*LiteralSpec)(nil) | ||
var exprSpecAsSpec Spec = (*ExprSpec)(nil) | ||
var blockSpecAsSpec Spec = (*BlockSpec)(nil) | ||
var blockListSpecAsSpec Spec = (*BlockListSpec)(nil) | ||
var blockSetSpecAsSpec Spec = (*BlockSetSpec)(nil) | ||
var blockMapSpecAsSpec Spec = (*BlockMapSpec)(nil) | ||
var blockLabelSpecAsSpec Spec = (*BlockLabelSpec)(nil) | ||
var defaultSpecAsSpec Spec = (*DefaultSpec)(nil) | ||
var _ Spec = ObjectSpec(nil) | ||
var _ Spec = TupleSpec(nil) | ||
var _ Spec = (*AttrSpec)(nil) | ||
var _ Spec = (*LiteralSpec)(nil) | ||
var _ Spec = (*ExprSpec)(nil) | ||
var _ Spec = (*BlockSpec)(nil) | ||
var _ Spec = (*BlockListSpec)(nil) | ||
var _ Spec = (*BlockSetSpec)(nil) | ||
var _ Spec = (*BlockMapSpec)(nil) | ||
var _ Spec = (*BlockLabelSpec)(nil) | ||
var _ Spec = (*DefaultSpec)(nil) | ||
|
||
var _ attrSpec = (*AttrSpec)(nil) | ||
|
||
var _ blockSpec = (*BlockSpec)(nil) | ||
var _ blockSpec = (*BlockListSpec)(nil) | ||
var _ blockSpec = (*BlockSetSpec)(nil) | ||
var _ blockSpec = (*BlockMapSpec)(nil) |