spec: github.com/appc/spec/pkg/acirenderer Index | Files

package acirenderer

import "github.com/appc/spec/pkg/acirenderer"

Index

Package Files

acirenderer.go resolve.go

func Walk Uses

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

type ACIFiles Uses

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

ACIFiles represents which files to extract for every ACI

type ACIProvider Uses

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 Uses

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 Uses

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 Uses

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 Uses

func CreateDepListFromImageID(imageID types.Hash, ap ACIRegistry) (Images, error)

CreateDepListFromImageID returns the flat dependency tree of the image with the provided imageID

func CreateDepListFromNameLabels Uses

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 Uses

type RenderedACI []*ACIFiles

RenderedACI is an (ordered) slice of ACIFiles

func GetRenderedACI Uses

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 Uses

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 Uses

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.

Package acirenderer imports 11 packages (graph) and is imported by 58 packages. Updated 2017-10-06. Refresh now. Tools for package owners.