"Attributes" type for map[string]*Attribute

This is primarily for symmetry with "Blocks", but perhaps it will also
get some useful methods later.
This commit is contained in:
Martin Atkins 2017-05-21 09:05:06 -07:00
parent 5b8d54380b
commit a291478c78
1 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,9 @@ type Block struct {
// Blocks is a sequence of Block.
type Blocks []*Block
// Attributes is a set of attributes keyed by their names.
type Attributes map[string]*Attribute
// Body is a container for attributes and blocks. It serves as the primary
// unit of heirarchical structure within configuration.
//
@ -65,7 +68,7 @@ type Body interface {
// BodyContent is the result of applying a BodySchema to a Body.
type BodyContent struct {
Attributes map[string]*Attribute
Attributes Attributes
Blocks Blocks
}