isolated

package
v0.0.0-...-d60a78d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Archive

Archive uses the given archiver and options to constructed an isolated file, and uploads it and its dependencies.

Archive returns the digest of the composite isolated file.

Types

type ArchiveOptions

type ArchiveOptions struct {
	// Files is a map of working directories to files relative to that working
	// directory.
	//
	// The working directories may be relative to CWD.
	Files ScatterGather

	// Dirs is a map of working directories to directories relative to that
	// working directory.
	//
	// The working directories may be relative to CWD.
	Dirs ScatterGather

	// Blacklist is a list of filename regexes describing which files to
	// ignore when crawling the directories in Dirs.
	//
	// Note that this Blacklist will not filter files in Files.
	Blacklist []string

	// Isolated is the display name of the isolated to upload.
	Isolated string

	// LeakIsolated is handle to a place where Archive will write
	// the encoded bytes of the isolated file.
	LeakIsolated io.Writer
}

ArchiveOptions for achiving trees.

type ScatterGather

type ScatterGather map[string]string

ScatterGather represents a mapping of working directories to relative paths.

The purpose is to represent some notion of "local" vs. "archived" paths. All relative paths are relative to both their corresponding working directories as well as the root of an archive.

filepath.Join(working dir, relative path) == location of file or directory on the system.

relative path == location of file or directory in an archive.

Notably, in such a design, we may not have more than one copy of a relative path in the archive, because there is a conflict. In order to efficiently check this case at the expense of extra memory, ScatterGather actually stores a mapping of relative paths to working directories.

func (ScatterGather) Add

func (sc ScatterGather) Add(wd string, rel string) error

Add adds a (working directory, relative path) pair to the ScatterGather.

Add returns an error if the relative path was already added.

func (*ScatterGather) Set

func (sc *ScatterGather) Set(value string) error

Set implements the flags.Var interface.

func (*ScatterGather) String

func (sc *ScatterGather) String() string

String implements the Stringer interface.

Jump to

Keyboard shortcuts

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