// parseConfig takes a map representing the yaml config file content and delegates it to the methods extracting the variables which are then used to extract and populate the  plans
parseConfig takes a map representing the yaml config file content and delegates it to the methods extracting the variables which are then used to extract and populate the  plans
// parseConfig takes a map representing the yaml config file content and delegates it to the methods extracting the variables which are then used to extract and populate the plans
func parseConfig(configYaml map[string]interface{}, path string) (plans map[string]model.Plan, err error) {
	var variables map[string]string
	if variablesYaml, ok := configYaml["Variables"].(map[string]interface{}); ok {
		err = validateVariables(variablesYaml)
		if err != nil {
			return plans, err
		}
		variables, err = parseVariables(variablesYaml)
		if err != nil {
			return plans, err
		}
	}
	if plansYaml, ok := configYaml["Plans"].([]interface{}); ok {
		plans, err = parsePlans(plansYaml, variables)
		if err != nil {
			return plans, err
		}
	} else {
		return plans, fmt.Errorf("no plans defined in %s", path)
	}
	return plans, nil
}
func parseConfig ( configYaml map [ string ] interface { } , path string ) ( plans map [ string ] model . Plan , err error ) { var variables map [ string ] string if variablesYaml , ok := configYaml [ " " ] . ( map [ string ] interface { } ) ; ok { err = validateVariables ( variablesYaml ) if err != nil { return plans , err } variables , err = parseVariables ( variablesYaml ) if err != nil { return plans , err } } if plansYaml , ok := configYaml [ " " ] . ( [ ] interface { } ) ; ok { plans , err = parsePlans ( plansYaml , variables ) if err != nil { return plans , err } } else { return plans , fmt . Errorf ( " " , path ) } return plans , nil }
parseConfig takes a map representing the yaml config file content and delegates it to the methods extracting the variables which are then used to extract and populate the  plans
parseConfig takes a map representing the yaml config file content and delegates it to the methods extracting the variables which are then used to extract and populate the plans