packager

package
v0.0.0-...-cf7397b Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoArtifactsDirectory indicates a missing artifacts/ directory
	ErrNoArtifactsDirectory = errors.New("No artifacts/ directory found")
)

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

func NewExporter

func NewExporter(source, dest, logsDir string, l loader.BundleLoader, c imagestore.Constructor) (*Exporter, error)

NewExporter returns an *Exporter given information about where a bundle

lives, where the compressed bundle should be exported to,
and what form a bundle should be exported in (thin or thick/full). It also
sets up a docker client to work with images.

func (*Exporter) Export

func (ex *Exporter) Export() error

Export prepares an artifacts directory containing all of the necessary

images, packages the bundle along with the artifacts in a gzipped tar
file, and saves that file to the file path specified as destination.
If the any part of the destination path doesn't, it will be created.
exist

func (*Exporter) Logs

func (ex *Exporter) Logs() string

type Importer

type Importer struct {
	Source      string
	Destination string
	Loader      loader.BundleLoader
	Verbose     bool
}

Importer is responsible for importing a file

func NewImporter

func NewImporter(source, destination string, load loader.BundleLoader, verbose bool) (*Importer, error)

NewImporter creates a new secure *Importer

source is the filesystem path to the archive. destination is the directory to unpack the contents. load is a loader.BundleLoader preconfigured for loading bundles.

func (*Importer) Import

func (im *Importer) Import() error

Import decompresses a bundle from Source (location of the compressed bundle) and properly places artifacts in the correct location(s)

func (*Importer) Unzip

func (im *Importer) Unzip() (string, *bundle.Bundle, error)

Unzip decompresses a bundle from Source (location of the compressed bundle) and returns the path of the bundle and the bundle itself.

Jump to

Keyboard shortcuts

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