Some documentation
This commit is contained in:
parent
f21db281c2
commit
12049e3d87
@ -13,6 +13,8 @@ type rawTemplate struct {
|
|||||||
Outputs []map[string]interface{}
|
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 {
|
type Template struct {
|
||||||
Name string
|
Name string
|
||||||
Builders map[string]rawBuilderConfig
|
Builders map[string]rawBuilderConfig
|
||||||
@ -27,6 +29,8 @@ type rawBuilderConfig struct {
|
|||||||
rawConfig interface{}
|
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) {
|
func ParseTemplate(data []byte) (t *Template, err error) {
|
||||||
var rawTpl rawTemplate
|
var rawTpl rawTemplate
|
||||||
err = json.Unmarshal(data, &rawTpl)
|
err = json.Unmarshal(data, &rawTpl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user