rcache

package
v0.0.0-...-016edcc Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyWithProgress

func CopyWithProgress(from, to vfs.File, progress func(percent float64)) error

func SpanEndIgnoreNotExist

func SpanEndIgnoreNotExist(span observability.SpanError, err error)

Types

type CacheConfig

type CacheConfig struct {
	Name string
	config.Cache
	Location vfs.Location `yaml:"-"`
}

type Config

type Config struct {
	*config.Config
	Caches []CacheConfig
}

type Hint

type Hint interface {
	Skip() bool
}

type HintNone

type HintNone struct{}

func (HintNone) Skip

func (h HintNone) Skip() bool

type HintSkip

type HintSkip struct{}

func (HintSkip) Skip

func (h HintSkip) Skip() bool

type HintStore

type HintStore struct {
	// contains filtered or unexported fields
}

func (*HintStore) Get

func (s *HintStore) Get(addr, cache string) Hint

func (*HintStore) Reset

func (s *HintStore) Reset()

func (*HintStore) Set

func (s *HintStore) Set(addr, cache string, hint Hint)

type RemoteCache

type RemoteCache struct {
	Root          *hroot.State
	Config        *Config
	LocalCache    *lcache.LocalCacheState
	Observability *observability.Observability
	Hints         *HintStore
	// contains filtered or unexported fields
}

func New

func New(root *hroot.State, cconfig *config.Config, localCache *lcache.LocalCacheState, observability *observability.Observability) (*RemoteCache, error)

func (*RemoteCache) ArtifactExists

func (e *RemoteCache) ArtifactExists(ctx context.Context, cache CacheConfig, target graph.Targeter, artifact artifacts.Artifact) (bool, error)

func (*RemoteCache) DownloadArtifact

func (e *RemoteCache) DownloadArtifact(ctx context.Context, target graph.Targeter, cache CacheConfig, artifact artifacts.Artifact) (rerr error)

func (*RemoteCache) OrderedCaches

func (e *RemoteCache) OrderedCaches(ctx context.Context) ([]CacheConfig, error)

func (*RemoteCache) StoreArtifact

func (e *RemoteCache) StoreArtifact(ctx context.Context, ttarget graph.Targeter, cache CacheConfig, artifact artifacts.Artifact) (rerr error)

func (*RemoteCache) WriteableCaches

func (e *RemoteCache) WriteableCaches(ctx context.Context, starget specs.Specer) ([]CacheConfig, error)

Jump to

Keyboard shortcuts

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