func MetadataFile(path string) (models.SecretsFileMetadata, Error) {
	utils.LogDebug(fmt.Sprintf("Using metadata file %s", path))
	if _, err := os.Stat(path); err != nil {
		var e Error
		e.Err = err
		if os.IsNotExist(err) {
			e.Message = "Metadata file does not exist"
		} else {
			e.Message = "Unable to read metadata file"
		}
		return models.SecretsFileMetadata{}, e
	}
	utils.LogDebug(fmt.Sprintf("Reading metadata file %s", path))
	response, err := ioutil.ReadFile(path)  
	if err != nil {
		return models.SecretsFileMetadata{}, Error{Err: err, Message: "Unable to read metadata file"}
	}
	var metadata models.SecretsFileMetadata
	if err := yaml.Unmarshal(response, &metadata); err != nil {
		return models.SecretsFileMetadata{}, Error{Err: err, Message: "Unable to parse metadata file"}
	}
	return metadata, Error{}
}
MetadataFile reads the contents of the metadata file
package controllers
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"github.com/DopplerHQ/cli/pkg/crypto"
	"github.com/DopplerHQ/cli/pkg/models"
	"github.com/DopplerHQ/cli/pkg/utils"
	"gopkg.in/yaml.v3"
)
var DefaultMetadataDir string
func MetadataFilePath(token string, project string, config string) string {
	var name string
	if project == "" && config == "" {
		name = fmt.Sprintf("%s", token)
	} else {
		name = fmt.Sprintf("%s:%s:%s", token, project, config)
	}
	fileName := fmt.Sprintf(".metadata-%s.json", crypto.Hash(name))
	path := filepath.Join(DefaultMetadataDir, fileName)
	if absPath, err := filepath.Abs(path); err == nil {
		return absPath
	}
	return path
}