aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg')
-rw-r--r--internal/pkg/pkg.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go
index 54ac571d..5f6f15d2 100644
--- a/internal/pkg/pkg.go
+++ b/internal/pkg/pkg.go
@@ -196,14 +196,7 @@ func (f *FContext) GetArtifact(a Artifact) (
//
// Methods of RContext are safe for concurrent use. RContext is valid
// until [FileArtifact.Cure] returns.
-type RContext struct {
- // Address of underlying [Cache], should be zeroed or made unusable after
- // [FileArtifact.Cure] returns and must not be exposed directly.
- cache *Cache
-}
-
-// Unwrap returns the underlying [context.Context].
-func (r *RContext) Unwrap() context.Context { return r.cache.ctx }
+type RContext struct{ common }
// An Artifact is a read-only reference to a piece of data that may be created
// deterministically but might not currently be available in memory or on the
@@ -959,7 +952,7 @@ func (c *Cache) openFile(f FileArtifact) (r io.ReadCloser, err error) {
}
}()
}
- return f.Cure(&RContext{c})
+ return f.Cure(&RContext{common{c}})
}
return
}
@@ -1455,7 +1448,7 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
if err = c.enterCure(a, curesExempt); err != nil {
return
}
- r, err = f.Cure(&RContext{c})
+ r, err = f.Cure(&RContext{common{c}})
if err == nil {
if checksumPathname == nil || c.IsStrict() {
h := sha512.New384()