container

package
v0.0.0-...-7ba690f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: MIT Imports: 7 Imported by: 0

README

Container

This package provides functionality specifically for prefetching container image contents.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(components *ComponentList, dest string) error

Generate generates and saves the container image prefetch script to disk based on the specified component list and destination path.

Types

type ComponentList

type ComponentList struct {
	Images []Image `json:"ContainerImages,omitempty"`
}

List represents a component list (e.g. vhdbuilder/packer/components.json).

func ParseComponents

func ParseComponents(name string) (*ComponentList, error)

ParseComponents parses the named component list JSON and returns its content as a ComponentList.

type Image

type Image struct {
	DownloadURL           string   `json:"downloadURL,omitempty"`
	AMD64OnlyVersions     []string `json:"amd64OnlyVersions,omitempty"`
	MultiArchVersions     []string `json:"multiArchVersions,omitempty"`
	PrefetchOptimizations []struct {
		Tag      string   `json:"version,omitempty"`
		Binaries []string `json:"binaries,omitempty"`
	} `json:"prefetchOptimizations,omitempty"`
}

Image represents a container image within a component list.

func (*Image) IsKnownVersion

func (i *Image) IsKnownVersion(version string) bool

IsImageVersion returns true iff the specified version is contained within the image's multi-arch or amd64-only versions, false otherwise.

type TemplateArgs

type TemplateArgs struct {
	Images []TemplateImage
}

PrefetchTemplateArgs represents the arguments required by the prefetch script template.

type TemplateImage

type TemplateImage struct {
	FullyQualifiedTag string
	Binaries          []string
}

TemplateImage represents a container image in terms of its fully-qualified tag, as well as the list of binaries within it that are in-scope for prefetch optimization. This is used to execute the prefetch template for script generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL