MCPcopy Create free account
hub / github.com/celer-pkg/celer / NewArtifactConfig

Function NewArtifactConfig

pkgcache/cache_artifact.go:23–34  ·  view source on GitHub ↗
(ctx context.Context, writable bool)

Source from the content-addressed store, hash-verified

21}
22
23func NewArtifactConfig(ctx context.Context, writable bool) *ArtifactConfig {
24 pkgCacheConfig := ctx.PkgCacheConfig()
25 if pkgCacheConfig == nil || pkgCacheConfig.GetDir(context.PkgCacheDirArtifacts) == "" {
26 return nil
27 }
28
29 return &ArtifactConfig{
30 ctx: ctx,
31 writable: writable,
32 chattrFS: fileio.NewChattrFS(pkgCacheConfig.GetDir(context.PkgCacheDirRoot)),
33 }
34}
35
36// Restore restores the cached package to package directory if cache hit, and return the archive path.
37// If cache miss, just return empty string without error.

Callers 1

RefreshMethod · 0.92

Calls 3

NewChattrFSFunction · 0.92
PkgCacheConfigMethod · 0.65
GetDirMethod · 0.65

Tested by

no test coverage detected