Documentation
¶
Index ¶
- Constants
- Variables
- func GenArtifact(ctx context.Context, dir string, a ArtifactWithProducer, compress bool, ...) error
- func SanitizeTargetName(s string) string
- func UncompressedPathFromArtifact(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact, ...) (string, error)
- type ActualFileCollector
- type ActualFileCollectorDir
- type ActualOutNamedPaths
- type ArtifactGenContext
- type ArtifactManifest
- type ArtifactProducer
- type ArtifactWithProducer
- type LocalCacheState
- func (e *LocalCacheState) ArtifactExists(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (bool, error)
- func (e *LocalCacheState) ArtifactManifest(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (ArtifactManifest, bool, error)
- func (e *LocalCacheState) CleanTarget(target specs.Specer, async bool) error
- func (e *LocalCacheState) Expand(ctx context.Context, ttarget graph.Targeter, outputs []string) (xfs.Path, error)
- func (e *LocalCacheState) GC(ctx context.Context, flog func(string, ...interface{}), dryrun bool) error
- func (e *LocalCacheState) GCTargets(targets []*graph.Target, flog func(string, ...interface{}), dryrun bool) error
- func (e *LocalCacheState) GenArtifacts(ctx context.Context, gtarget graph.Targeter, arts []ArtifactWithProducer, ...) errordeprecated
- func (e *LocalCacheState) GetLocalCache(ctx context.Context, target *graph.Target, outputs []string, ...) (bool, error)
- func (e *LocalCacheState) HasArtifact(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact, ...) (bool, error)
- func (e *LocalCacheState) HashInput(target graph.Targeter) (string, error)
- func (e *LocalCacheState) HashOutput(target graph.Targeter, output string) (string, error)
- func (e *LocalCacheState) IsCodegenLink(path string) bool
- func (e *LocalCacheState) LatestArtifactManifest(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (ArtifactManifest, bool)
- func (e *LocalCacheState) LatestCacheDirExists(target specs.Specer) bool
- func (e *LocalCacheState) LatestUncompressedPathFromArtifact(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (string, ArtifactManifest, error)
- func (e *LocalCacheState) LinkLatestCache(target specs.Specer, hash string) error
- func (e *LocalCacheState) LockAllArtifacts(ctx context.Context, target graph.Targeter) (func(), error)
- func (e *LocalCacheState) LockArtifact(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (func(), error)
- func (e *LocalCacheState) LockArtifacts(ctx context.Context, target graph.Targeter, artifacts []artifacts.Artifact) (func(), error)
- func (e *LocalCacheState) LockPath(target graph.Targeter, resource string) string
- func (e *LocalCacheState) PopulateActualFiles(ctx context.Context, target *Target, outputs []string) error
- func (e *LocalCacheState) Post(ctx context.Context, target *graph.Target, outputs []string) error
- func (e *LocalCacheState) RegisterRemove(target graph.Targeter)
- func (e *LocalCacheState) ResetCacheHashInput(spec specs.Specer)
- func (e *LocalCacheState) ScheduleGenArtifacts(ctx context.Context, gtarget graph.Targeter, arts []ArtifactWithProducer, ...) (*worker2.Group, error)
- func (e *LocalCacheState) StoreCache(ctx context.Context, ttarget graph.Targeter, arts []ArtifactWithProducer, ...) (rerr error)
- func (e *LocalCacheState) Target(ctx context.Context, target graph.Targeter, o TargetOpts) (*Target, error)
- func (e *LocalCacheState) UncompressedPathFromArtifact(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (string, ArtifactManifest, error)
- func (e *LocalCacheState) UncompressedReaderFromArtifact(ctx context.Context, artifact artifacts.Artifact, target graph.Targeter) (io.ReadCloser, ArtifactManifest, error)
- func (e *LocalCacheState) VFSLocation(target graph.Targeter) (vfs.Location, error)
- func (e *LocalCacheState) VerifyHashInput(target graph.Targeter) (string, error)
- type OutDirMeta
- type Target
- func (t *Target) ActualOutFiles() *ActualOutNamedPaths
- func (t *Target) ActualRestoreCacheFiles() xfs.RelPaths
- func (t *Target) ActualSupportFiles() xfs.RelPaths
- func (t *Target) HasActualOutFiles() bool
- func (t *Target) OutExpansionRoot() xfs.Path
- func (t *Target) SharedStageRoot() xfs.Path
- func (t *Target) String() string
- type TargetMetas
- type TargetOpts
Constants ¶
View Source
const LatestDir = "latest"
Variables ¶
View Source
var ArtifactSkip = errors.New("skip artifact")
View Source
var ErrFileModifiedSinceHashing = errors.New("modified since hashing")
View Source
var ErrFileModifiedWhileHashing = errors.New("modified while hashing")
Functions ¶
func GenArtifact ¶
func SanitizeTargetName ¶
Types ¶
type ActualFileCollector ¶
type ActualFileCollectorDir ¶
type ActualFileCollectorDir struct {
Dir string
}
func (ActualFileCollectorDir) PopulateActualFiles ¶
type ActualOutNamedPaths ¶
type ArtifactGenContext ¶
type ArtifactGenContext struct {
// contains filtered or unexported fields
}
func (*ArtifactGenContext) EstimatedWriteSize ¶
func (g *ArtifactGenContext) EstimatedWriteSize(size int64)
func (*ArtifactGenContext) Writer ¶
func (g *ArtifactGenContext) Writer() io.Writer
type ArtifactManifest ¶
type ArtifactManifest struct {
Size int64
}
type ArtifactProducer ¶
type ArtifactProducer interface {
Gen(ctx context.Context, gctx *ArtifactGenContext) error
}
type ArtifactWithProducer ¶
type ArtifactWithProducer interface { artifacts.Artifact ArtifactProducer }
type LocalCacheState ¶
type LocalCacheState struct { Location *vfsos.Location Path xfs.Path Targets *graph.Targets Metas *TargetMetas[*Target] Root *hroot.State Observability *observability.Observability Finalizers *finalizers.Finalizers EnableGC bool ParallelCaching bool Pool *worker2.Engine CacheRW bool }
func NewState ¶
func NewState(root *hroot.State, pool *worker2.Engine, targets *graph.Targets, obs *observability.Observability, finalizers *finalizers.Finalizers, gc, parallelCaching, cacheRw bool) (*LocalCacheState, error)
func (*LocalCacheState) ArtifactExists ¶
func (*LocalCacheState) ArtifactManifest ¶
func (e *LocalCacheState) ArtifactManifest(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (ArtifactManifest, bool, error)
func (*LocalCacheState) CleanTarget ¶
func (e *LocalCacheState) CleanTarget(target specs.Specer, async bool) error
func (*LocalCacheState) GenArtifacts
deprecated
func (e *LocalCacheState) GenArtifacts(ctx context.Context, gtarget graph.Targeter, arts []ArtifactWithProducer, compress bool) error
Deprecated: use ScheduleGenArtifacts instead
func (*LocalCacheState) GetLocalCache ¶
func (*LocalCacheState) HasArtifact ¶
func (*LocalCacheState) HashInput ¶
func (e *LocalCacheState) HashInput(target graph.Targeter) (string, error)
func (*LocalCacheState) HashOutput ¶
func (*LocalCacheState) IsCodegenLink ¶
func (e *LocalCacheState) IsCodegenLink(path string) bool
func (*LocalCacheState) LatestArtifactManifest ¶
func (e *LocalCacheState) LatestArtifactManifest(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (ArtifactManifest, bool)
func (*LocalCacheState) LatestCacheDirExists ¶
func (e *LocalCacheState) LatestCacheDirExists(target specs.Specer) bool
func (*LocalCacheState) LatestUncompressedPathFromArtifact ¶
func (e *LocalCacheState) LatestUncompressedPathFromArtifact(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (string, ArtifactManifest, error)
func (*LocalCacheState) LinkLatestCache ¶
func (e *LocalCacheState) LinkLatestCache(target specs.Specer, hash string) error
func (*LocalCacheState) LockAllArtifacts ¶
func (*LocalCacheState) LockArtifact ¶
func (*LocalCacheState) LockArtifacts ¶
func (*LocalCacheState) LockPath ¶
func (e *LocalCacheState) LockPath(target graph.Targeter, resource string) string
func (*LocalCacheState) PopulateActualFiles ¶
func (*LocalCacheState) RegisterRemove ¶
func (e *LocalCacheState) RegisterRemove(target graph.Targeter)
func (*LocalCacheState) ResetCacheHashInput ¶
func (e *LocalCacheState) ResetCacheHashInput(spec specs.Specer)
func (*LocalCacheState) ScheduleGenArtifacts ¶
func (e *LocalCacheState) ScheduleGenArtifacts(ctx context.Context, gtarget graph.Targeter, arts []ArtifactWithProducer, compress bool) (*worker2.Group, error)
func (*LocalCacheState) StoreCache ¶
func (e *LocalCacheState) StoreCache(ctx context.Context, ttarget graph.Targeter, arts []ArtifactWithProducer, compress bool) (rerr error)
func (*LocalCacheState) Target ¶
func (e *LocalCacheState) Target(ctx context.Context, target graph.Targeter, o TargetOpts) (*Target, error)
func (*LocalCacheState) UncompressedPathFromArtifact ¶
func (e *LocalCacheState) UncompressedPathFromArtifact(ctx context.Context, target graph.Targeter, artifact artifacts.Artifact) (string, ArtifactManifest, error)
func (*LocalCacheState) UncompressedReaderFromArtifact ¶
func (e *LocalCacheState) UncompressedReaderFromArtifact(ctx context.Context, artifact artifacts.Artifact, target graph.Targeter) (io.ReadCloser, ArtifactManifest, error)
func (*LocalCacheState) VFSLocation ¶
func (e *LocalCacheState) VFSLocation(target graph.Targeter) (vfs.Location, error)
func (*LocalCacheState) VerifyHashInput ¶
func (e *LocalCacheState) VerifyHashInput(target graph.Targeter) (string, error)
VerifyHashInput will make sure files haven't been changed since last hashing
type OutDirMeta ¶
type Target ¶
func (*Target) ActualOutFiles ¶
func (t *Target) ActualOutFiles() *ActualOutNamedPaths
func (*Target) ActualRestoreCacheFiles ¶
func (*Target) ActualSupportFiles ¶
func (*Target) HasActualOutFiles ¶
func (*Target) OutExpansionRoot ¶
func (*Target) SharedStageRoot ¶
type TargetMetas ¶
type TargetMetas[T any] struct { // contains filtered or unexported fields }
func NewTargetMetas ¶
func NewTargetMetas[T any](factory func(k targetMetaKey) T) *TargetMetas[T]
func (*TargetMetas[T]) Delete ¶
func (m *TargetMetas[T]) Delete(spec specs.Specer)
func (*TargetMetas[T]) Find ¶
func (m *TargetMetas[T]) Find(gtarget graph.Targeter) T
func (*TargetMetas[T]) Len ¶
func (m *TargetMetas[T]) Len() int
func (*TargetMetas[T]) Reset ¶
func (m *TargetMetas[T]) Reset()
type TargetOpts ¶
type TargetOpts struct { ActualFilesCollector ActualFileCollector ActualFilesCollectorOutputs []string }
Click to show internal directories.
Click to hide internal directories.