Documentation ¶
Index ¶
- type Context
- type Digest
- type DigestTags
- type Image
- type ImageWithDigestSlice
- type Images
- type RegInvImage
- func (a RegInvImage) Minus(b RegInvImage) RegInvImage
- func (a *RegInvImage) ToCSV() string
- func (a RegInvImage) ToSet() container.Set
- func (a *RegInvImage) ToSorted() []ImageWithDigestSlice
- func (a *RegInvImage) ToYAML(o YamlMarshalingOpts) string
- func (a RegInvImage) Union(b RegInvImage) RegInvImage
- type TagSet
- type TagSlice
- type YamlMarshalingOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Name image.Registry `yaml:"name,omitempty"` ServiceAccount string `yaml:"service-account,omitempty"` Token gcloud.Token `yaml:"-"` Src bool `yaml:"src,omitempty"` }
Context holds information about a registry, to be written in a manifest file.
func GetSrcRegistry ¶
GetSrcRegistry gets the source registry.
type DigestTags ¶
DigestTags is a map where each digest is associated with a TagSlice. It is associated with a TagSlice because an image digest can have more than 1 tag pointing to it, even within the same image name's namespace (tags are namespaced by the image name).
type Image ¶
type Image struct { Name image.Name `yaml:"name"` Dmap DigestTags `yaml:"dmap,omitempty"` }
Image holds information about an image. It's like an "Object" in the OOP sense, and holds all the information relating to a particular image that we care about.
type ImageWithDigestSlice ¶
ImageWithDigestSlice uses a slice of digests instead of a map, allowing its contents to be sorted.
type RegInvImage ¶
type RegInvImage map[image.Name]DigestTags
A RegInvImage is a map containing all of the image names, and their associated digest-to-tags mappings. It is the simplest view of a Docker Registry, because the keys are just the image.Names (where each image.Name does *not* include the registry name, because we already key this by the RegistryName in MasterInventory).
The image.Name is actually a path name, because it can be "foo/bar/baz", where the image name is the string after the last slash (in this case, "baz").
func (RegInvImage) Minus ¶
func (a RegInvImage) Minus(b RegInvImage) RegInvImage
Minus is a set operation. TODO: ST1016: methods on the same type should have the same receiver name
func (*RegInvImage) ToCSV ¶
func (a *RegInvImage) ToCSV() string
ToCSV is like ToYAML, but instead of printing things in an indented format, it prints one image on each line as a CSV. If there is a tag pointing to the image, then it is printed next to the image on the same line.
Example: a@sha256:0000000000000000000000000000000000000000000000000000000000000000,a:1.0 a@sha256:0000000000000000000000000000000000000000000000000000000000000000,a:latest b@sha256:1111111111111111111111111111111111111111111111111111111111111111,-
func (RegInvImage) ToSet ¶
func (a RegInvImage) ToSet() container.Set
ToSet converts a RegInvImage to a Set.
func (*RegInvImage) ToSorted ¶
func (a *RegInvImage) ToSorted() []ImageWithDigestSlice
ToSorted converts a RegInvImage type to a sorted structure.
func (*RegInvImage) ToYAML ¶
func (a *RegInvImage) ToYAML(o YamlMarshalingOpts) string
ToYAML displays a RegInvImage as YAML, but with the map items sorted alphabetically.
func (RegInvImage) Union ¶
func (a RegInvImage) Union(b RegInvImage) RegInvImage
Union is a set operation.
type TagSet ¶
TagSet is a set of Tags.
func (TagSet) Intersection ¶
Intersection is a set operation.
type TagSlice ¶
TagSlice is a slice of Tags.
func (TagSlice) Intersection ¶
Intersection is a set operation.
type YamlMarshalingOpts ¶
type YamlMarshalingOpts struct { // Render multiple tags on separate lines. I.e., // prefer // // sha256:abc...: // - one // - two // // over // // sha256:abc...: ["one", "two"] // // If there is only 1 tag, it will be on one line in brackets (e.g., // '["one"]'). SplitTagsOverMultipleLines bool // Do not quote the digest. I.e., prefer // // sha256:...: // // over // // "sha256:...": // BareDigest bool }
YamlMarshalingOpts holds options for tweaking the YAML output.