func DataFromFile(path string) (Data, error) {
	raw, err := ioutil.ReadFile(path)
	if err != nil {
		return nil, configError("failed to read file %q: %v", path, err)
	}
	data := make(Data)
	if err := yaml.Unmarshal(raw, &data); err != nil {
		return nil, configError("failed to load configuration from file %q: %v", path, err)
	}
	return data, nil
}
DataFromFile unmarshals the content of the given file into configuration data.
package config
import (
	"fmt"
	"io/ioutil"
	"sigs.k8s.io/yaml"
	"strings"
)
type Data map[string]interface{}
func DataFromObject(obj interface{}) (Data, error) {
	raw, err := yaml.Marshal(obj)
	if err != nil {
		return nil, configError("failed to marshal object %T to data: %v", obj, err)
	}
	data := make(Data)
	if err = yaml.Unmarshal(raw, &data); err != nil {
		return nil, configError("failed to unmarshal object %T to data: %v", obj, err)
	}
	return data, nil
}
func DataFromStringMap(smap map[string]string) (Data, error) {
	data := make(Data)
	for key, val := range smap {
		var obj interface{}
		if err := yaml.Unmarshal([]byte(val), &obj); err != nil {
			return nil, configError("failed to unmarshal data from map: %v", err)
		}
		data[key] = obj
	}
	return data, nil
}