Documentation
¶
Index ¶
- func AddFlags(opts *Opts, flags *pflag.FlagSet)
- type LogReplayer
- type NoOpOutputWatcher
- type Opts
- type OutputWatcher
- type RunCache
- type TaskCache
- func (tc TaskCache) OutputWriter(prefix string) (io.WriteCloser, error)
- func (tc TaskCache) RestoreOutputs(ctx context.Context, prefixedUI *cli.PrefixedUi, progressLogger hclog.Logger) (bool, error)
- func (tc TaskCache) SaveOutputs(ctx context.Context, logger hclog.Logger, terminal cli.Ui, duration int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogReplayer ¶
type LogReplayer = func(logger hclog.Logger, output *cli.PrefixedUi, logFile titanpath.AbsoluteSystemPath)
LogReplayer is a function that is responsible for replaying the contents of a given log file
type NoOpOutputWatcher ¶
type NoOpOutputWatcher struct{}
NoOpOutputWatcher implements OutputWatcher, but always considers every glob to have changed
func (NoOpOutputWatcher) GetChangedOutputs ¶
func (NoOpOutputWatcher) GetChangedOutputs(ctx context.Context, hash string, repoRelativeOutputGlobs []string) ([]string, error)
GetChangedOutputs implements OutputWatcher.GetChangedOutputs. Since this is a no-op watcher, no tracking is done.
func (NoOpOutputWatcher) NotifyOutputsWritten ¶
func (NoOpOutputWatcher) NotifyOutputsWritten(ctx context.Context, hash string, repoRelativeOutputGlobs fs.TaskOutputs) error
NotifyOutputsWritten implements OutputWatcher.NotifyOutputsWritten. Since this is a no-op watcher, consider all globs to have changed
type Opts ¶
type Opts struct {
SkipReads bool
SkipWrites bool
TaskOutputModeOverride *util.TaskOutputMode
LogReplayer LogReplayer
OutputWatcher OutputWatcher
}
Opts holds the configurable options for a RunCache instance
type OutputWatcher ¶
type OutputWatcher interface {
// GetChangedOutputs returns which of the given globs have changed since the specified hash was last run
GetChangedOutputs(ctx context.Context, hash string, repoRelativeOutputGlobs []string) ([]string, error)
// NotifyOutputsWritten tells the watcher that the given globs have been cached with the specified hash
NotifyOutputsWritten(ctx context.Context, hash string, repoRelativeOutputGlobs fs.TaskOutputs) error
}
OutputWatcher instances are responsible for tracking changes to task outputs
type RunCache ¶
type RunCache struct {
// contains filtered or unexported fields
}
RunCache represents the interface to the cache for a single `titan run`
func New ¶
func New(cache cache.Cache, repoRoot titanpath.AbsoluteSystemPath, opts Opts, colorCache *colorcache.ColorCache) *RunCache
New returns a new instance of RunCache, wrapping the given cache
type TaskCache ¶
type TaskCache struct {
LogFileName titanpath.AbsoluteSystemPath
// contains filtered or unexported fields
}
TaskCache represents a single task's (package-task?) interface to the RunCache and controls access to the task's outputs
func (TaskCache) OutputWriter ¶
func (tc TaskCache) OutputWriter(prefix string) (io.WriteCloser, error)
OutputWriter creates a sink suitable for handling the output of the command associated with this task.