# Functions

ApplyFilters applies the filters in the options to whittle down the given rii.
BytesToMB converts a value from Bytes to MiB.
CheckOverlappingEdges checks to ensure that all the edges taken together as a whole are consistent.
EdgesToRegInvImage takes the destination endpoints of all edges and converts their information to a RegInvImage type.
ExcludeTags removes tags in rii that match excludedTags.
FilterByDigest removes all images in RegInvImage that do not match the filterDigest.
FilterByImage removes all images in RegInvImage that do not match the filterImage.
FilterByTag removes all images in RegInvImage that do not match the filterTag.
FindManifest finds the manifest to modify.
GetDeleteCmd generates the cloud command used to delete images (used for garbage collection).
GetSrcRegistry gets the source registry.
GetTokenKeyDomainRepoPath splits a string by '/'.
GetWriteCmd generates a gcloud command that is used to make modifications to a Docker Registry.
GrowManifest modifies a manifest by adding images into it.
IsSevereOccurrence checks if a vulnerability is a high enough severity to fail the ImageVulnCheck.
MakeSyncContext creates a SyncContext.
MBToBytes converts a value from MiB to Bytes.
MKImageVulnCheck returns an instance of ImageVulnCheck which checks against images that have known vulnerabilities.
MKPopulateRequestsForPromotionEdges takes in a map of PromotionEdges to promote and a PromotionContext and returns a PopulateRequests which can generate requests to be processed nolint[lll].
MkReadManifestListCmdReal creates a stream.Producer which makes a real call over the network to read ManifestList information.
MkReadRepositoryCmdReal creates a stream.Producer which makes a real call over the network.
MKRealImageRemovalCheck returns an instance of ImageRemovalCheck.
MKRealImageSizeCheck returns an instance of ImageSizeCheck which checks that all images to be promoted are under a max size.
MkRequestCapturer returns a function that simply records requests as they are captured (slurped out from the reqs channel).
ParseContainerParts splits up a registry name into its component pieces.
ParseImagesFromFile parses an Images type from a file.
ParseImagesYAML parses Images from a byteslice.
ParseManifestFromFile parses a Manifest from a filepath.
ParseManifestYAML parses a Manifest from a byteslice.
ParseThinManifestFromFile parses a ThinManifest from a filepath and generates a Manifest.
ParseThinManifestsFromDir parses all thin Manifest files within a directory.
ParseThinManifestYAML parses a ThinManifest from a byteslice.
ReadStagingRepo reads the StagingRepo, and applies whatever filters are available to the resulting RegInvImage.
SplitByKnownRegistries splits a registry name into a RegistryName and ImageName.
SplitRegistryImagePath takes an arbitrary image path, and splits it into its component parts, according to the knownRegistries field.
ToFQIN combines a RegistryName, ImageName, and Digest to form a fully-qualified image name (FQIN).
ToLQIN converts a RegistryName and ImangeName to form a loosely-qualified image name (LQIN).
ToPQIN converts a RegistryName, ImageName, and Tag to form a partially-qualified image name (PQIN).
ToPromotionEdges converts a list of manifests to a set of edges we want to try promoting.
Union inject b's contents into a.
ValidateDigest validates the digest.
ValidateRegistryImagePath validates the RegistryImagePath.
ValidateTag validates the tag.
ValidateThinManifestDirectoryStructure enforces a particular directory structure for thin manifests.
WriteImages writes images as YAML out to the expected path of the given (thin) manifest.

# Constants

Add represents those tags that are freely promotable, without fear of an overwrite (we are only adding tags).
Delete represents those tags that are not in the manifest and should thus be removed and deleted.
Move represents those tags that conflict with existing digests, and so should be moved to re-point to the digest that we want to promote as defined in the manifest.
ThinManifestDepth specifies the number of items in a path if we split the path into its parts, starting from the "topmost" folder given as an argument to -thin-manifest-dir.

# Structs

CollectedLogs holds all the Errors that are generated as the promoter runs.
DigestTagsContext holds information about the request that was used to fetch the list of digests and associated tags for a particular image.
Error contains slightly more verbosity than a standard "error".
GCRManifestListContext is used only for reading GCRManifestList information from GCR, in the function ReadGCRManifestLists.
GcrPayloadMatch holds booleans for matching a GCRPubSubPayload against a promoter manifest.
GCRPubSubPayload is the message payload sent to a Pub/Sub topic by a GCR.
GrowManifestOptions holds the parameters for modifying manifests.
Image holds information about an image.
ImageDigest is a combination of the ImageName and Digest.
ImageDigestTag is a flattened key used by RegInvFlat.
ImageRemovalCheck implements the PreCheck interface and checks against pull requests that attempt to remove any images from the promoter manifests.
ImageSizeCheck implements the PreCheck interface and checks against images that are larger than a size threshold (controlled by the max-image-size flag).
ImageSizeError contains ImageSizeCheck information on images that are either over the promoter's max image size or have an invalid size of 0 or less.
ImageTag is a combination of the ImageName and Tag.
ImageVulnCheck implements the PreCheck interface and checks against images that have known vulnerabilities.
ImageVulnError contains ImageVulnCheck information on images that contain a vulnerability with a severity level at or above the defined threshold.
ImageWithDigestSlice uses a slice of digests instead of a map, allowing its contents to be sorted.
Manifest stores the information in a manifest file (describing the desired state of a Docker Registry).
PromotionEdge represents a promotion "link" of an image repository between 2 registries.
PromotionRequest contains all the information required for any type of promotion (or demotion!) (involving any TagOp).
Registry is another way to look at a Docker Registry; it is used during Promotion.
RegistryContext holds information about a registry, to be written in a manifest file.
RequestResult contains information about the result of running a request (e.g., a "gcloud" command, or perhaps in the future, a REST call).
SyncContext is the main data structure for performing the promotion.
ThinManifest is a more secure Manifest because it does not define the Images[] directly, but moves it to a separate location.
VertexProperty describes the properties of an Edge, with respect to the state of the world.
YamlMarshalingOpts holds options for tweaking the YAML output.

# Interfaces

PreCheck represents a check function to run against a pull request that modifies the promoter manifests before oking promotion of the changes.

# Type aliases

CapturedRequests holds a map of all PromotionRequests that were generated.
Digest is a string that contains the SHA256 hash of a Docker container image.
DigestImageSize holds information about the size of an image in bytes.
DigestMediaType holds media information about a Digest.
DigestTags is a map where each digest is associated with a TagSlice.
Errors is a slice of Errors.
The ImageName can be just the bare name itself (e.g., "addon-builder" in "gcr.io/k8s-image-staging/addon-builder") or the prefix + name ("foo/bar/baz/quux" in "gcr.io/hello/foo/bar/baz/quux").
Images is a slice of Image types.
ImageVulnProducer is used by ImageVulnCheck to get the vulnerabilities for an image and allows for custom vulnerability producers for testing.
MasterInventory stores multiple RegInvImage elements, keyed by RegistryName.
ParentDigest holds a map of the digests of children to parent digests.
PopulateRequests is a function that can generate requests used to fetch information about a Docker Registry, or to promote images.
ProcessRequest is the counterpart to PopulateRequests.
PromotionContext holds all info required to create a stream that would produce a stream.Producer, as it relates to an intent to promote an image.
RegInvFlat is a flattened view of a Docker Registry, where the keys contain all 3 attributes --- the image name, digest, and tag.
A RegInvImage is a map containing all of the image names, and their associated digest-to-tags mappings.
RegInvImageDigest is a view of a Docker Reqistry, keyed by ImageDigest.
RegInvImageTag is keyed by a ImageTag.
RegistryImagePath is the registry name and image name, without the tag.
RegistryName is the leading part of an image name that includes the domain; it is everything that is not the actual image name itself.
RootRepo is the toplevel Docker repository (e.g., gcr.io/foo (GCR domain name + GCP project name).
Tag is a Docker tag.
TagOp is an enum that describes the various types of tag-modifying operations.
TagSet is a set of Tags.
TagSlice is a slice of Tags.