index

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index map[string]*stage.Stage

An Index holds an exhaustive set of Stages for a repository. Not threadsafe.

func FromFile

func FromFile(path string) (Index, error)

FromFile reads and returns an Index from the specified file path. See ToFile docs for more context. TODO no tests

func (*Index) AddStage added in v0.1.0

func (idx *Index) AddStage(stg stage.Stage, path string) error

AddStage adds the given Stage to the Index, with the given path as the key.

func (Index) Checkout

func (idx Index) Checkout(
	stagePath string,
	ch cache.Cache,
	rootDir string,
	strat strategy.CheckoutStrategy,
	recursive bool,
	checkedOut map[string]bool,
	inProgress map[string]bool,
	logger *agglog.AggLogger,
) error

Checkout checks out a Stage and all upstream Stages.

func (Index) Commit

func (idx Index) Commit(
	stagePath string,
	ch cache.Cache,
	rootDir string,
	strat strategy.CheckoutStrategy,
	committed map[string]bool,
	inProgress map[string]bool,
	logger *agglog.AggLogger,
) error

Commit commits the given Stage's Outputs and recursively acts on all upstream Stages.

func (Index) Fetch

func (idx Index) Fetch(
	stagePath string,
	ch cache.Cache,
	rootDir string,
	recursive bool,
	remote string,
	fetched map[string]bool,
	inProgress map[string]bool,
	logger *agglog.AggLogger,
) error

Fetch downloads a Stage's Outputs and the Outputs of any upstream Stages.

func (Index) Graph

func (idx Index) Graph(
	stagePath string,
	inProgress map[string]bool,
	graph *gographviz.Escape,
	onlyStages bool,
) error

Graph creates a dependency graph starting from the given Stage.

func (Index) Push

func (idx Index) Push(
	stagePath string,
	ch cache.Cache,
	rootDir string,
	recursive bool,
	remote string,
	pushed map[string]bool,
	inProgress map[string]bool,
	logger *agglog.AggLogger,
) error

Push uploads a Stage's Outputs and the Outputs of any upstream Stages.

func (*Index) RemoveStage added in v0.4.0

func (idx *Index) RemoveStage(path string) error

func (Index) Run

func (idx Index) Run(
	stagePath string,
	ch cache.Cache,
	rootDir string,
	recursive bool,
	ran map[string]bool,
	inProgress map[string]bool,
	logger *agglog.AggLogger,
) error

Run runs a Stage and all upstream Stages.

func (Index) SortStagePaths added in v0.3.0

func (idx Index) SortStagePaths() []string

SortStagePaths returns a sorted slice of Stage paths stored in the Index.

func (Index) Status

func (idx Index) Status(
	stagePath string,
	ch cache.Cache,
	rootDir string,
	out Status,
	inProgress map[string]bool,
) error

Status returns the status for the given Stage and all upstream Stages.

func (Index) ToFile

func (idx Index) ToFile(indexPath string) error

ToFile writes the Index to the specified file path. To prevent the Index from going stale, Stages themselves aren't written to the Index file; the Index only tracks their paths. TODO no tests

type Status

type Status map[string]stage.Status

Status is a map of Stage paths to Stage Statuses

Jump to

Keyboard shortcuts

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