func ParseConfig(config []byte) (*Configuration, error) {
	var c *Configuration
	var ok bool
	c, ok = isYaml(config)
	if !ok {
		c, ok = isJSON(config)
		if !ok {
			return c, fmt.Errorf("Configuration file is not in valid JSON or YAML format")
		}
	}
	return c, nil
}
ParseConfig parses a configuration file
package config
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	yaml "gopkg.in/yaml.v2"
)
var Registry *Configuration
type Configuration struct {
	TempDir string `json:"tmp_dir" yaml:"tmp_dir"`
}
func init() {
	Registry = &Configuration{}
}
func NewFromFile(f string) error {
	configFile, err := ioutil.ReadFile(f)
	if err != nil {
		return fmt.Errorf("Error while loading config from file %s", err)
	}
	c, err := ParseConfig(configFile)
	if err != nil {
		return err
	}
	Registry = c
	return nil
}