func (r *fileRepo) fetchJSON(addr hash.Hash, path string, v interface{}) error {
	fullPath := r.getPath(addr, path)
	logrus.Debugf("fetching file %s", fullPath)

	data, err := afero.ReadFile(r.fs, fullPath)
	if err != nil {
		logrus.Tracef("file: cannot read file: %s", fullPath)
		return err
	}
	err = json.Unmarshal(data, v)
	if err != nil {
		logrus.Tracef("file: cannot unmarshal file: %s", fullPath)
		return err
	}

	return nil
}
// Retrieves a data structure based on JSON
Retrieves a data structure based on JSON
// Retrieves a data structure based on JSON
func (r *fileRepo) fetchJSON(addr hash.Hash, path string, v interface{}) error {
	fullPath := r.getPath(addr, path)
	logrus.Debugf("fetching file %s", fullPath)
	data, err := afero.ReadFile(r.fs, fullPath)
	if err != nil {
		logrus.Tracef("file: cannot read file: %s", fullPath)
		return err
	}
	err = json.Unmarshal(data, v)
	if err != nil {
		logrus.Tracef("file: cannot unmarshal file: %s", fullPath)
		return err
	}
	return nil
}
func ( r * fileRepo ) fetchJSON ( addr hash . Hash , path string , v interface { } ) error { fullPath := r . getPath ( addr , path ) logrus . Debugf ( " " , fullPath ) data , err := afero . ReadFile ( r . fs , fullPath ) if err != nil { logrus . Tracef ( " " , fullPath ) return err } err = json . Unmarshal ( data , v ) if err != nil { logrus . Tracef ( " " , fullPath ) return err } return nil }
Retrieves a data structure based on JSON
Retrieves a data structure based on JSON