(ctx context.Context, writable bool)
| 21 | } |
| 22 | |
| 23 | func 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. |
no test coverage detected