internal/pkg: expose response body

This uses the new measured reader provided by Cache. This should make httpArtifact zero-copy.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-25 16:07:07 +09:00
parent 334578fdde
commit 861801597d
5 changed files with 156 additions and 66 deletions

View File

@@ -2,7 +2,6 @@ package pkg
import (
"bytes"
"context"
"crypto/sha512"
"fmt"
"io"
@@ -54,6 +53,6 @@ func (a *fileArtifact) Checksum() Checksum {
}
// Cure returns the caller-supplied data.
func (a *fileArtifact) Cure(context.Context) (io.ReadCloser, error) {
func (a *fileArtifact) Cure(*RContext) (io.ReadCloser, error) {
return io.NopCloser(bytes.NewReader(*a)), nil
}