code: func LoadFile(path string) (cfg *DBConfig, err error) {
  	log.Debugf("loading db configuration file from %s", path)
  	if path == "" {
  		return nil, cferr.Wrap(cferr.PolicyError, cferr.InvalidPolicy, errors.New("invalid path"))
  	}
  
  	var body []byte
  	body, err = ioutil.ReadFile(path)
  	if err != nil {
  		return nil, cferr.Wrap(cferr.PolicyError, cferr.InvalidPolicy, errors.New("could not read configuration file"))
  	}
  
  	cfg = &DBConfig{}
  	err = json.Unmarshal(body, &cfg)
  	if err != nil {
  		return nil, cferr.Wrap(cferr.PolicyError, cferr.InvalidPolicy,
  			errors.New("failed to unmarshal configuration: "+err.Error()))
  	}
  
  	if cfg.DataSourceName == "" || cfg.DriverName == "" {
  		return nil, cferr.Wrap(cferr.PolicyError, cferr.InvalidPolicy, errors.New("invalid db configuration"))
  	}
  
  	return
  }
docs: // LoadFile attempts to load the db configuration file stored at the path
  // and returns the configuration. On error, it returns nil.