// ExtractPlans takes the location of the yaml file and delegats it's content to the method reading the content and extracting the plans.
ExtractPlans takes the location of the yaml file and delegats it's content to the method reading the content and extracting the plans.
// ExtractPlans takes the location of the yaml file and delegats it ' s content to the method reading the content and extracting the plans .
func ExtractPlans(filePath string) (plans map[string]model.Plan, err error) {
	log.Printf("read config from %s", filePath)
	configYaml, err := ioutil.ReadFile(filePath)
	if err != nil {
		log.Panic(err)
	}
	var configMap map[string]interface{}
	if err := yaml.Unmarshal(configYaml, &configMap); err != nil {
		log.Panicf("Unable to read plan definition: %s", err)
	}
	plans, err = parseConfig(configMap, filePath)
	if err != nil {
		return plans, err
	}
	return plans, nil
}
func ExtractPlans ( filePath string ) ( plans map [ string ] model . Plan , err error ) { log . Printf ( " " , filePath ) configYaml , err := ioutil . ReadFile ( filePath ) if err != nil { log . Panic ( err ) } var configMap map [ string ] interface { } if err := yaml . Unmarshal ( configYaml , & configMap ) ; err != nil { log . Panicf ( " " , err ) } plans , err = parseConfig ( configMap , filePath ) if err != nil { return plans , err } return plans , nil }
ExtractPlans takes the location of the yaml file and delegats it's content to the method reading the content and extracting the plans.
ExtractPlans takes the location of the yaml file and delegats it ' s content to the method reading the content and extracting the plans .