Some documentation

This commit is contained in:
Mitchell Hashimoto 2013-04-20 18:33:27 -06:00
parent f21db281c2
commit 12049e3d87
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,8 @@ type rawTemplate struct {
Outputs []map[string]interface{}
}
// The Template struct represents a parsed template, parsed into the most
// completed form it can be without additional processing by the caller.
type Template struct {
Name string
Builders map[string]rawBuilderConfig
@ -27,6 +29,8 @@ type rawBuilderConfig struct {
rawConfig interface{}
}
// ParseTemplate takes a byte slice and parses a Template from it, returning
// the template and possibly errors while loading the template.
func ParseTemplate(data []byte) (t *Template, err error) {
var rawTpl rawTemplate
err = json.Unmarshal(data, &rawTpl)