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(ctx 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.

func ArchiveFiles Uses

func ArchiveFiles(ctx context.Context, arch *archiver.Archiver, baseDir string, files []string, blacklist []string) ([]*archiver.PendingItem, error)

ArchiveFiles uploads given files using given archiver.

This is thin wrapper of Archive. Note that this function may have large number of concurrent RPCs to isolate server.

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 archiving 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 15 packages (graph) and is imported by 4 packages. Updated 2019-12-09. Refresh now. Tools for package owners.