aci

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2014 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeGzip    = FileType("gz")
	TypeBzip2   = FileType("bz2")
	TypeXz      = FileType("xz")
	TypeTar     = FileType("tar")
	TypeText    = FileType("text")
	TypeUnknown = FileType("unknown")
)

Variables

View Source
var (
	ErrNoRootFS   = errors.New("no rootfs found in layout")
	ErrNoManifest = errors.New("no app or fileset manifest found in layout")
)

Functions

func LoadSignedData

func LoadSignedData(signed io.Reader, kr openpgp.EntityList) ([]byte, error)

LoadSignedData reads PGP encrypted data from the given Reader, using the provided keyring (EntityList). The entire decrypted bytestream is returned, and/or any error encountered. TODO(jonboulle): support symmetric decryption

func ValidateArchive

func ValidateArchive(tr *tar.Reader) error

ValidateLayout 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 ValidateTar

func ValidateTar(tr *tar.Reader) error

ValidateTar checks that a given tar.Reader contains a directory layout which matches the ACI spec

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(path string, hdr *tar.Header, r io.Reader) error
	Close() error
}

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

func NewAppWriter

func NewAppWriter(am schema.AppManifest, w *tar.Writer) ArchiveWriter

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

func NewFilesetWriter

func NewFilesetWriter(name string, w *tar.Writer) (ArchiveWriter, error)

NewFilesetWriter creates a new ArchiveWriter which will generate a Fileset ACI by the given name 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)

Jump to

Keyboard shortcuts

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