Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ACIProvider ¶
type ACIProvider interface { // Read the ACI contents stream given the key. Use ResolveKey to // convert an image ID to the relative provider's key. ReadStream(key string) (io.ReadCloser, error) // Converts an image ID to the, if existent, key under which the // ACI is known to the provider ResolveKey(key string) (string, error) // Converts a Hash to the provider's key HashToKey(h hash.Hash) string }
An ACIProvider provides functions to get an ACI contents, to convert an ACI hash to the key under which the ACI is known to the provider and to resolve an image ID to the key under which it's known to the provider.
type ACIRegistry ¶
type ACIRegistry interface { ACIProvider GetImageManifest(key string) (*schema.ImageManifest, error) GetACI(name types.ACIdentifier, labels types.Labels) (string, error) }
An ACIRegistry provides all functions of an ACIProvider plus functions to search for an aci and get its contents
type Image ¶
type Image struct { Im *schema.ImageManifest Key string Level uint16 }
An Image contains the ImageManifest, the ACIProvider's key and its Level in the dependency tree.
type Images ¶
type Images []Image
Images encapsulates an ordered slice of Image structs. It represents a flat dependency tree. The upper Image should be the first in the slice with a level of 0. For example if A is the upper image and has two deps (in order B and C). And C has one dep (D), the slice (reporting the app name and excluding im and Hash) should be: [{A, Level: 0}, {C, Level:1}, {D, Level: 2}, {B, Level: 1}]
func CreateDepListFromImageID ¶
func CreateDepListFromImageID(imageID types.Hash, ap ACIRegistry) (Images, error)
CreateDepListFromImageID returns the flat dependency tree of the image with the provided imageID
func CreateDepListFromNameLabels ¶
func CreateDepListFromNameLabels(name types.ACIdentifier, labels types.Labels, ap ACIRegistry) (Images, error)
CreateDepListFromNameLabels returns the flat dependency tree of the image with the provided app name and optional labels.
type RenderedACI ¶
type RenderedACI []*ACIFiles
RenderedACI is an (ordered) slice of ACIFiles
func GetRenderedACI ¶
func GetRenderedACI(name types.ACIdentifier, labels types.Labels, ap ACIRegistry) (RenderedACI, error)
GetRenderedACI, given an image app name and optional labels, starts with the best matching image available in the store, creates the dependencies list and returns the RenderedACI list.
func GetRenderedACIFromList ¶
func GetRenderedACIFromList(imgs Images, ap ACIProvider) (RenderedACI, error)
GetRenderedACIFromList returns the RenderedACI list. All file outside rootfs are excluded (at the moment only "manifest").
func GetRenderedACIWithImageID ¶
func GetRenderedACIWithImageID(imageID types.Hash, ap ACIRegistry) (RenderedACI, error)
GetRenderedACIWithImageID, given an imageID, starts with the matching image available in the store, creates the dependencies list and returns the RenderedACI list.