func (riit RegInvImageTag) ToRegInvImageDigest() RegInvImageDigest {
	riid := make(RegInvImageDigest)
	for imageTag, digest := range riit {
		id := ImageDigest{}
		id.ImageName = imageTag.ImageName
		id.Digest = digest
		if tagSlice, ok := riid[id]; ok {
			riid[id] = append(tagSlice, imageTag.Tag)
		} else {
			riid[id] = TagSlice{imageTag.Tag}
		}
	}
	return riid
}
ToRegInvImageDigest converts a RegInvImageTag to a RegInvImageDigest.
package inventory
import (
	"sync"
	cr "github.com/google/go-containerregistry/pkg/v1/types"
	grafeaspb "google.golang.org/genproto/googleapis/grafeas/v1"
	"gopkg.in/src-d/go-git.v4/plumbing"
	"sigs.k8s.io/promo-tools/v3/legacy/gcloud"
	"sigs.k8s.io/promo-tools/v3/legacy/stream"
)
type RequestResult struct {
	Context stream.ExternalRequest
	Errors  Errors
}
type Errors []Error
type Error struct {
	Context string
	Error   error
}
type ImageSizeError struct {
	MaxImageSize    int
	OversizedImages map[string]int
	InvalidImages   map[string]int
}
type ImageVulnError struct {
	ImageName      ImageName
	Digest         Digest
	OccurrenceName string
	Vulnerability  *grafeaspb.VulnerabilityOccurrence
}
type ImageVulnProducer func(
	edge PromotionEdge,
) ([]*grafeaspb.Occurrence, error)
type CapturedRequests map[PromotionRequest]int
type CollectedLogs struct {
	Errors Errors
}
type SyncContext struct {
	Threads           int
	Confirm           bool
	UseServiceAccount bool
	Inv               MasterInventory
	InvIgnore         []ImageName
	RegistryContexts  []RegistryContext
	SrcRegistry       *RegistryContext
	Tokens            map[RootRepo]gcloud.Token
	DigestMediaType   DigestMediaType
	DigestImageSize   DigestImageSize
	ParentDigest      ParentDigest
	Logs              CollectedLogs
}
type PreCheck interface {
	Run() error
}
type ImageVulnCheck struct {
	SyncContext       SyncContext
	PullEdges         map[PromotionEdge]interface{}
	SeverityThreshold int
	FakeVulnProducer  ImageVulnProducer
}
type ImageSizeCheck struct {
	MaxImageSize    int
	DigestImageSize DigestImageSize
	PullEdges       map[PromotionEdge]interface{}
}
type ImageRemovalCheck struct {
	GitRepoPath    string
	MasterSHA      plumbing.Hash
	PullRequestSHA plumbing.Hash
	PullEdges      map[PromotionEdge]interface{}
}
type PromotionEdge struct {
	SrcRegistry RegistryContext
	SrcImageTag ImageTag
	Digest Digest
	DstRegistry RegistryContext
	DstImageTag ImageTag
}
type VertexProperty struct {
	PqinExists      bool
	DigestExists    bool
	PqinDigestMatch bool
	BadDigest       Digest
	OtherTags       TagSlice
}
type RootRepo string
type MasterInventory map[RegistryName]RegInvImage
type RegInvImage map[ImageName]DigestTags
type Registry struct {
	RegistryName      string
	RegistryNameLong  RegistryName
	RegInvImageDigest RegInvImageDigest
}
type RegInvFlat map[ImageDigestTag]interface{}
type ImageDigestTag struct {
	ImageName ImageName
	Digest    Digest
	Tag       Tag
}
type RegInvImageTag map[ImageTag]Digest
type ImageTag struct {
	ImageName ImageName
	Tag       Tag
}
type RegInvImageDigest map[ImageDigest]TagSlice
type ImageDigest struct {
	ImageName ImageName
	Digest    Digest
}
type TagOp int
const (
	Add TagOp = iota
	Move = iota
	Delete = iota
)
const (
	ThinManifestDepth = 4
)
type PromotionRequest struct {
	TagOp          TagOp
	RegistrySrc    RegistryName
	RegistryDest   RegistryName
	ServiceAccount string
	ImageNameSrc   ImageName
	ImageNameDest  ImageName
	Digest         Digest
	DigestOld      Digest  
	Tag            Tag
}
type Manifest struct {
	Registries []RegistryContext `yaml:"registries,omitempty"`
	Images     []Image           `yaml:"images,omitempty"`
	SrcRegistry *RegistryContext
	Filepath    string
}
type ThinManifest struct {
	Registries []RegistryContext `yaml:"registries,omitempty"`
	ImagesPath string `yaml:"imagesPath,omitempty"`
}
type Image struct {
	ImageName ImageName  `yaml:"name"`
	Dmap      DigestTags `yaml:"dmap,omitempty"`
}
type Images []Image
type RegistryImagePath string
type DigestTags map[Digest]TagSlice
type RegistryContext struct {
	Name           RegistryName `yaml:"name,omitempty"`
	ServiceAccount string       `yaml:"service-account,omitempty"`
	Token          gcloud.Token `yaml:"-"`
	Src            bool         `yaml:"src,omitempty"`
}
type GCRManifestListContext struct {
	RegistryContext RegistryContext
	ImageName       ImageName
	Tag             Tag
	Digest          Digest
}
type RegistryName string
type ImageName string
type DigestMediaType map[Digest]cr.MediaType
type DigestImageSize map[Digest]int
type ParentDigest map[Digest]Digest
type Digest string
type Tag string
type TagSlice []Tag
type TagSet map[Tag]interface{}
type DigestTagsContext struct {
	ImageName    ImageName
	RegistryName RegistryName
}
type PopulateRequests func(
	*SyncContext,
	chan<- stream.ExternalRequest,
	*sync.WaitGroup)
type ProcessRequest func(
	*SyncContext,
	chan stream.ExternalRequest,
	chan<- RequestResult,
	*sync.WaitGroup,
	*sync.Mutex)
type PromotionContext func(
	RegistryName,  
	ImageName,  
	RegistryContext,  
	ImageName,  
	Digest,
	Tag,
	TagOp) stream.Producer
type ImageWithDigestSlice struct {
	name    string
	digests []digest
}
type digest struct {
	hash string
	tags []string
}
type GCRPubSubPayload struct {
	Action string `json:"action"`
	FQIN string `json:"digest,omitempty"`
	PQIN string `json:"tag,omitempty"`
	Path string
	Digest Digest
	Tag Tag
}
type YamlMarshalingOpts struct {
	SplitTagsOverMultipleLines bool
	BareDigest bool
}
func (m Manifest) ToRegInvImageDigest() RegInvImageDigest {
	riid := make(RegInvImageDigest)
	for _, image := range m.Images {
		for digest, tagArray := range image.Dmap {
			id := ImageDigest{}
			id.ImageName = image.ImageName
			id.Digest = digest
			riid[id] = tagArray
		}
	}
	return riid
}
func (m Manifest) ToRegInvImageTag() RegInvImageTag {
	riit := make(RegInvImageTag)
	for _, image := range m.Images {
		for digest, tagArray := range image.Dmap {
			for _, tag := range tagArray {
				it := ImageTag{}
				it.ImageName = image.ImageName
				it.Tag = tag
				riit[it] = digest
			}
		}
	}
	return riit
}
func (ri RegInvImage) ToRegInvImageDigest() RegInvImageDigest {
	riid := make(RegInvImageDigest)
	for imageName, digestTags := range ri {
		for digest, tagArray := range digestTags {
			id := ImageDigest{}
			id.ImageName = imageName
			id.Digest = digest
			riid[id] = tagArray
		}
	}
	return riid
}
func (ri RegInvImage) ToRegInvImageTag() RegInvImageTag {
	riit := make(RegInvImageTag)
	for imageName, digestTags := range ri {
		for digest, tagArray := range digestTags {
			for _, tag := range tagArray {
				it := ImageTag{}
				it.ImageName = imageName
				it.Tag = tag
				riit[it] = digest
			}
		}
	}
	return riit
}
func (riid RegInvImageDigest) ToRegInvImageTag() RegInvImageTag {
	riit := make(RegInvImageTag)
	for imageDigest, tagArray := range riid {
		for _, tag := range tagArray {
			it := ImageTag{}
			it.ImageName = imageDigest.ImageName
			it.Tag = tag
			riit[it] = imageDigest.Digest
		}
	}
	return riit
}