hcl/schema.go

30 lines
732 B
Go
Raw Permalink Normal View History

package hcl
2017-05-14 00:44:11 +00:00
2017-05-19 15:42:11 +00:00
// BlockHeaderSchema represents the shape of a block header, and is
// used for matching blocks within bodies.
type BlockHeaderSchema struct {
Type string
2017-05-14 00:44:11 +00:00
LabelNames []string
2017-05-19 15:42:11 +00:00
}
// AttributeSchema represents the requirements for an attribute, and is used
// for matching attributes within bodies.
type AttributeSchema struct {
Name string
Required bool
2017-05-14 00:44:11 +00:00
}
// NestedBlockSchemas represent the requirements for a list of nested
// attributes or block
type NestedBlockSchemas struct {
Name string
Required bool
}
2017-05-14 00:44:11 +00:00
// BodySchema represents the desired shallow structure of a body.
type BodySchema struct {
2017-05-19 15:42:11 +00:00
Attributes []AttributeSchema
Blocks []BlockHeaderSchema
Nested []NestedBlockSchemas
2017-05-14 00:44:11 +00:00
}