func (im Image) ToJSONV1() ImageV1 {
	return ImageV1{
		Name:      im.Name,
		Reference: im.Reference,
		Remote:    "",
	}
}
ToJSONV1 converts an internal Image into ImageV1.
package torcx
import (
	"encoding/json"
	"fmt"
)
const (
	SealUpperProfile = "TORCX_UPPER_PROFILE"
	SealLowerProfiles = "TORCX_LOWER_PROFILES"
	SealRunProfilePath = "TORCX_PROFILE_PATH"
	SealBindir = "TORCX_BINDIR"
	SealUnpackdir = "TORCX_UNPACKDIR"
	ImageManifestV0K = "image-manifest-v0"
	CommonConfigV0K = "torcx-config-v0"
)
type ConfigV0 struct {
	Kind  string       `json:"kind"`
	Value CommonConfig `json:"value"`
}
type CommonConfig struct {
	BaseDir    string   `json:"base_dir,omitempty"`
	RunDir     string   `json:"run_dir,omitempty"`
	UsrDir     string   `json:"usr_dir,omitempty"`
	ConfDir    string   `json:"conf_dir,omitempty"`
	StorePaths []string `json:"store_paths,omitempty"`
}
type ApplyConfig struct {
	CommonConfig
	LowerProfiles []string
	UpperProfile  string
}
type ProfileConfig struct {
	CommonConfig
	LowerProfileNames  []string
	UserProfileName    string
	CurrentProfilePath string
	NextProfile        string
}
type Archive struct {
	Image
	Filepath string        `json:"filepath"`
	Format   ArchiveFormat `json:"format"`
}
type Image struct {
	Name      string `json:"name"`
	Reference string `json:"reference"`
	Remote    string `json:"remote"`
}
type ArchiveFormat string
const (
	ArchiveFormatUnknown ArchiveFormat = ""
	ArchiveFormatTgz = "tgz"
	ArchiveFormatSquashfs = "squashfs"
)
func (arf *ArchiveFormat) UnmarshalJSON(b []byte) error {
	s := ""
	if err := json.Unmarshal(b, &s); err != nil {
		return err
	}
	switch s {
	case ArchiveFormatTgz:
		*arf = ArchiveFormatTgz
	case ArchiveFormatSquashfs:
		*arf = ArchiveFormatSquashfs
	default:
		return fmt.Errorf("could not unmarshal into ArchiveFormat: must be one of %q, %q", ArchiveFormatTgz, ArchiveFormatSquashfs)
	}
	return nil
}
func (ar *Archive) UnmarshalJSON(b []byte) error {
	type archiveAlias Archive
	var arAlias archiveAlias
	if err := json.Unmarshal(b, &arAlias); err != nil {
		return err
	}
	if arAlias.Format == ArchiveFormatUnknown {
		arAlias.Format = ArchiveFormatTgz
	}
	*ar = Archive(arAlias)
	return nil
}
func (arf ArchiveFormat) FileSuffix() string {
	return fmt.Sprintf(".torcx.%s", arf)
}
func (im Image) ToJSONV0() ImageV0 {
	return ImageV0{
		Name:      im.Name,
		Reference: im.Reference,
	}
}
func ImageFromJSONV0(j ImageV0) Image {
	return Image{
		Name:      j.Name,
		Reference: j.Reference,
		Remote:    "",
	}
}