summaryrefslogtreecommitdiff
path: root/schema.go
diff options
context:
space:
mode:
authorMartin Atkins <mart@degeneration.co.uk>2019-09-09 16:08:19 -0700
committerMartin Atkins <mart@degeneration.co.uk>2019-09-09 16:08:19 -0700
commit6c4344623b6ac528a57f9b80e4622acfab2fde40 (patch)
tree83031084d3ab54abbe40e3fd749e439c8b28e9d1 /schema.go
parent0f5ab3bd563c111077917020c0cbc8c211e1bff3 (diff)
Unfold the "hcl" directory up into the root
The main HCL package is more visible this way, and so it's easier than having to pick it out from dozens of other package directories.
Diffstat (limited to 'schema.go')
-rw-r--r--schema.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/schema.go b/schema.go
new file mode 100644
index 0000000..891257a
--- /dev/null
+++ b/schema.go
@@ -0,0 +1,21 @@
+package hcl
+
+// BlockHeaderSchema represents the shape of a block header, and is
+// used for matching blocks within bodies.
+type BlockHeaderSchema struct {
+ Type string
+ LabelNames []string
+}
+
+// AttributeSchema represents the requirements for an attribute, and is used
+// for matching attributes within bodies.
+type AttributeSchema struct {
+ Name string
+ Required bool
+}
+
+// BodySchema represents the desired shallow structure of a body.
+type BodySchema struct {
+ Attributes []AttributeSchema
+ Blocks []BlockHeaderSchema
+}