image

package
v0.0.0-...-2814f49 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package image defines methods for validating, unpacking OCI images and creating OCI runtime bundle.

Index

Constants

View Source
const (
	TypeImageLayout = "imageLayout"
	TypeImage       = "image"
	TypeImageZip    = "imageZip"
	TypeManifest    = "manifest"
	TypeImageIndex  = "imageIndex"
	TypeConfig      = "config"
)

supported autodetection types

Variables

View Source
var IssuesURL = "https://github.com/opencontainers/image-tools/issues"

IssuesURL is the URL for the issues of image-tools

View Source
var SpecURL = "https://github.com/opencontainers/image-spec"

SpecURL is the URL for the image-spec repository

Functions

func Autodetect

func Autodetect(path string) (string, error)

Autodetect detects the validation type for the given path or an error if the validation type could not be resolved.

func CreateRuntimeBundle

func CreateRuntimeBundle(r io.ReadSeeker, dest, root, platform string, refs []string) error

CreateRuntimeBundle walks through the given tar stream and creates an OCI runtime bundle in the given destination dest or returns an error if the unpacking failed.

func CreateRuntimeBundleFile

func CreateRuntimeBundleFile(tarFile, dest, root, platform string, refs []string) error

CreateRuntimeBundleFile opens the file pointed by tarFile and calls CreateRuntimeBundle.

func CreateRuntimeBundleLayout

func CreateRuntimeBundleLayout(src, dest, root, platform string, refs []string) error

CreateRuntimeBundleLayout walks through the file tree given by src and creates an OCI runtime bundle in the given destination dest or returns an error if the unpacking failed.

func CreateRuntimeBundleZip

func CreateRuntimeBundleZip(src, dest, root, platform string, refs []string) error

CreateRuntimeBundleZip opens and walks through the zip file given by src and creates an OCI runtime bundle in the given destination dest or returns an error if the unpacking failed.

func DetectCompression

func DetectCompression(r *bufio.Reader) (string, error)

DetectCompression detects the compression algorithm of the source.

func Unpack

func Unpack(r io.ReadSeeker, dest, platform string, refs []string) error

Unpack walks through the tar stream and, using the layers specified in the manifest pointed to by the given ref, unpacks all layers in the given destination directory or returns an error if the unpacking failed. The destination will be created if it does not exist.

func UnpackFile

func UnpackFile(tarFileName, dest, platform string, refs []string) error

UnpackFile opens the file pointed by tarFileName and calls Unpack on it.

func UnpackLayout

func UnpackLayout(src, dest, platform string, refs []string) error

UnpackLayout walks through the file tree given by src and, using the layers specified in the manifest pointed to by the given ref, unpacks all layers in the given destination directory or returns an error if the unpacking failed.

func UnpackZip

func UnpackZip(src, dest, platform string, refs []string) error

UnpackZip opens and walks through the zip file given by src and, using the layers specified in the manifest pointed to by the given ref, unpacks all layers in the given destination directory or returns an error if the unpacking failed.

func Validate

func Validate(r io.ReadSeeker, refs []string, out *log.Logger) error

Validate walks through a tar stream and validates the manifest. * Check that all refs point to extant blobs * Checks that all referred blobs are valid * Checks that mime-types are correct returns error on validation failure

func ValidateFile

func ValidateFile(tarFile string, refs []string, out *log.Logger) error

ValidateFile opens the tar file given by the filename, then calls ValidateReader

func ValidateLayout

func ValidateLayout(src string, refs []string, out *log.Logger) error

ValidateLayout walks through the given file tree and validates the manifest pointed to by the given refs or returns an error if the validation failed.

func ValidateZip

func ValidateZip(src string, refs []string, out *log.Logger) error

ValidateZip walks through the given file tree and validates the manifest pointed to by the given refs or returns an error if the validation failed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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