in plugin/step/group/group.go [104:128]
func Loader(config map[string]interface{}) (go2chef.Step, error) {
// parse interior steps here
structure := struct {
Name string `mapstructure:"name"`
Steps []map[string]interface{} `mapstructure:"steps"`
}{
Steps: make([]map[string]interface{}, 0),
}
logger := go2chef.GetGlobalLogger()
if err := mapstructure.Decode(config, &structure); err != nil {
logger.Errorf("failed to parse configuration for %s: %s", TypeName, err)
return nil, err
}
steps, err := go2chef.GetSteps(config)
if err != nil {
return nil, err
}
g := StepGroup{
GroupName: structure.Name,
logger: go2chef.GetGlobalLogger(),
Steps: steps,
}
return &g, nil
}