acirenderer

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(tarReader *tar.Reader, walkFunc func(hdr *tar.Header) error) error

Types

type ACIFiles

type ACIFiles struct {
	Key     string
	FileMap map[string]struct{}
}

ACIFiles represents which files to extract for every ACI

type ACIProvider

type ACIProvider interface {
	// Read the ACI contents stream given the key. Use ResolveKey to
	// convert an ImageID to the relative provider's key.
	ReadStream(key string) (io.ReadCloser, error)
	// Converts an ImageID 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 ImageID 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.ACName, 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.ACName, 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.ACName, 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.

Jump to

Keyboard shortcuts

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