gomodfs: implement synthetic .zip file serving via synthzip#27
Open
gomodfs: implement synthetic .zip file serving via synthzip#27
Conversation
Implement the $base/$module/@v/$version.zip endpoint from the goproxy protocol, using github.com/tomhjp/synthzip to synthesize zip files on-the-fly from individually-cached files without materializing the entire archive in memory upfront. synthzip requires Name and Size for each file at construction time (no I/O), then lazily reads file contents only when a byte range is actually accessed. Key changes: - store: Add ZipFileEntry type and GetZipFileEntries method to Store interface - gomodfs: Add getZipArchive (builds synthzip.Archive from metadata), getZipFileData (materializes full zip), getZipFileSize (metadata only) - path: Recognize ".zip" extension in parsePath - All frontends (NFS, FUSE, WebDAV, WinFsp): Serve .zip files. Stat calls use getZipFileSize to avoid materializing the full zip. Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
Member
Author
|
I implemented omitting CRC-32s in github.com/tomhjp/synthzip@v0.2.0 (the CRC-32s are zeroed in the zip file, which archive/zip handles fine; it just skips checksums), which strips away a lot of the complexity that #26 had to handle. I spun up a local CI runner with this version of gomodfs to test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement the $base/$module/@v/$version.zip endpoint from the goproxy protocol, using github.com/tomhjp/synthzip to synthesize zip files on-the-fly from individually-cached files without materializing the entire archive in memory upfront.
synthzip requires Name and Size for each file at construction time (no I/O), then lazily reads file contents only when a byte range is actually accessed.
Key changes: