package aci

import "k8s.io/kubernetes/Godeps/_workspace/src/github.com/appc/spec/aci"

Package aci contains various functions for working with App Container Images.

Index

Constants

const (
	TypeGzip    = FileType("gz")
	TypeBzip2   = FileType("bz2")
	TypeXz      = FileType("xz")
	TypeTar     = FileType("tar")
	TypeText    = FileType("text")
	TypeUnknown = FileType("unknown")
)
const (
	// Path to manifest file inside the layout
	ManifestFile = "manifest"
	// Path to rootfs directory inside the layout
	RootfsDir = "rootfs"
)

Variables

var (
	ErrNoRootFS   = errors.New("no rootfs found in layout")
	ErrNoManifest = errors.New("no image manifest found in layout")
)

Functions

func BuildWalker

func BuildWalker(root string, aw ArchiveWriter) filepath.WalkFunc

BuildWalker creates a filepath.WalkFunc that walks over the given root (which should represent an ACI layout on disk) and adds the files in the rootfs/ subdirectory to the given ArchiveWriter

func ManifestFromImage

func ManifestFromImage(rs io.ReadSeeker) (*schema.ImageManifest, error)

ManifestFromImage extracts a new schema.ImageManifest from the given ACI image.

func NewCompressedReader

func NewCompressedReader(rs io.ReadSeeker) (io.Reader, error)

NewCompressedReader creates a new io.Reader from the given ACI image.

func NewCompressedTarReader

func NewCompressedTarReader(rs io.ReadSeeker) (*tar.Reader, error)

NewCompressedTarReader creates a new tar.Reader reading from the given ACI image.

func ValidateArchive

func ValidateArchive(tr *tar.Reader) error

ValidateArchive takes a *tar.Reader and validates that the layout of the filesystem the reader encapsulates matches that expected by the Application Container Image format. If any errors are encountered during the validation, it will abort and return the first one.

func ValidateLayout

func ValidateLayout(dir string) error

ValidateLayout takes a directory and validates that the layout of the directory matches that expected by the Application Container Image format. If any errors are encountered during the validation, it will abort and return the first one.

func XzReader

func XzReader(r io.Reader) io.ReadCloser

XzReader shells out to a command line xz executable (if available) to decompress the given io.Reader using the xz compression format

Types

type ArchiveWriter

type ArchiveWriter interface {
	AddFile(hdr *tar.Header, r io.Reader) error
	Close() error
}

ArchiveWriter writes App Container Images. Users wanting to create an ACI or should create an ArchiveWriter and add files to it; the ACI will be written to the underlying tar.Writer

func NewImageWriter

func NewImageWriter(am schema.ImageManifest, w *tar.Writer) ArchiveWriter

NewImageWriter creates a new ArchiveWriter which will generate an App Container Image based on the given manifest and write it to the given tar.Writer

type FileType

type FileType string

func DetectFileType

func DetectFileType(r io.Reader) (FileType, error)

DetectFileType attempts to detect the type of file that the given reader represents by comparing it against known file signatures (magic numbers)

Source Files

build.go doc.go file.go layout.go writer.go

Version
v0.16.2
Published
May 4, 2015
Platform
js/wasm
Imports
19 packages
Last checked
24 seconds ago

Tools for package owners.