From b1ff1267be5f1dfa4f764648da68bbaec8366ecd Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 3 Oct 2023 12:57:03 +0300 Subject: refactor(tvix/nar-bridge): drop reader package Make the import function usable on any reader. Change-Id: I84d2004cb73cdd7a11fe8efb0f2efb6335d5e6b0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9527 Reviewed-by: Connor Brewster Tested-by: BuildkiteCI Autosubmit: flokli --- tvix/nar-bridge/pkg/writer/writer_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix/nar-bridge/pkg/writer/writer_test.go') diff --git a/tvix/nar-bridge/pkg/writer/writer_test.go b/tvix/nar-bridge/pkg/writer/writer_test.go index 83ac717aa3d6..1c63ba78355f 100644 --- a/tvix/nar-bridge/pkg/writer/writer_test.go +++ b/tvix/nar-bridge/pkg/writer/writer_test.go @@ -9,7 +9,7 @@ import ( "testing" castorev1pb "code.tvl.fyi/tvix/castore/protos" - "code.tvl.fyi/tvix/nar-bridge/pkg/reader" + "code.tvl.fyi/tvix/nar-bridge/pkg/importer" "code.tvl.fyi/tvix/nar-bridge/pkg/writer" storev1pb "code.tvl.fyi/tvix/store/protos" "github.com/stretchr/testify/require" @@ -159,9 +159,9 @@ func TestFull(t *testing.T) { filesMap := make(map[string][]byte, 0) directoriesMap := make(map[string]*castorev1pb.Directory) - r := reader.New(bytes.NewBuffer(narContents)) - pathInfo, err := r.Import( + pathInfo, err := importer.Import( context.Background(), + bytes.NewBuffer(narContents), func(fileReader io.Reader) error { fileContents, err := io.ReadAll(fileReader) require.NoError(t, err) -- cgit 1.4.1