luci: go.chromium.org/luci/client/isolated Index | Files

package isolated

import "go.chromium.org/luci/client/isolated"

Index

Package Files

archive.go scattergather.go

func Archive Uses

func Archive(c context.Context, arch *archiver.Archiver, opts *ArchiveOptions) *archiver.PendingItem

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.

type ArchiveOptions Uses

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 Uses

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 Uses

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 Uses

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

Set implements the flags.Var interface.

func (*ScatterGather) String Uses

func (sc *ScatterGather) String() string

String implements the Stringer interface.

Package isolated imports 14 packages (graph) and is imported by 2 packages. Updated 2018-12-18. Refresh now. Tools for package owners.