imagefmt

package
v0.0.0-...-41c8d9c Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package imagefmt exposes functions to dynamically register methods to detect different types of container image formats.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCouldNotFindLayer is returned when we could not download or open the layer file.
	ErrCouldNotFindLayer = commonerr.NewBadRequestError("could not find layer from given path")
)

Functions

func Extract

func Extract(format string, blobReader io.ReadCloser, filePaths []string) (tarutil.FilesMap, error)

Extract a set of files as FilesMap from a layer blob.

func Extractors

func Extractors() map[string]Extractor

Extractors returns the list of the registered extractors.

func IsSupported

func IsSupported(format string) bool

IsSupported checks if a format is supported

func RegisterExtractor

func RegisterExtractor(name string, d Extractor)

RegisterExtractor makes an extractor available by the provided name.

If called twice with the same name, the name is blank, or if the provided Extractor is nil, this function panics.

func UnregisterExtractor

func UnregisterExtractor(name string)

UnregisterExtractor removes a Extractor with a particular name from the list.

Types

type Extractor

type Extractor interface {
	// ExtractFiles produces a tarutil.FilesMap from a image layer.
	ExtractFiles(layer io.ReadCloser, filenames []string) (tarutil.FilesMap, error)
}

Extractor represents an ability to extract files from a particular container image format.

Directories

Path Synopsis
Package aci implements an imagefmt.Extractor for appc formatted container image layers.
Package aci implements an imagefmt.Extractor for appc formatted container image layers.
Package docker implements an imagefmt.Extractor for docker formatted container image layers.
Package docker implements an imagefmt.Extractor for docker formatted container image layers.

Jump to

Keyboard shortcuts

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