This repository contains a minimal Go proof of concept that serves a stable virtual tar stream at /archive.tar from a fixed manifest snapshot. It precomputes ustar headers and offsets at startup, then serves archive bytes from planned metadata plus direct source streaming.
- Start
cmd/virtual-tar-pocfrom the repository root (or this worktree root).cmd/virtual-tar-poc/main.goresolves the shippedtestdata/manifest.jsonfrom the checked-out source tree. - The shipped
testdata/manifest.jsonproves the local-file path withsource_path: "files/alpha.txt", so the primary demo runs without a second upstream server. - Run
go run ./cmd/virtual-tar-poc, then fetchhttp://127.0.0.1:8080/archive.tarfrom another shell withcurl -fsS http://127.0.0.1:8080/archive.tar -o /tmp/virtual-tar-poc.tar,tar -tvf /tmp/virtual-tar-poc.tar, andtar -xOf /tmp/virtual-tar-poc.tar alpha.txt. HEAD /archive.tardoes not fetch source bytes. FullGET /archive.tarand data-covering single-range requests do.source_urlremains available for focused HTTP compatibility tests.
internal/poc/tar.goprecomputesustarheaders, entry offsets, and segment layout once at startup.internal/poc/handler.goplans the requested archive window and streams each segment directly into the HTTP response.internal/poc/file_source.gois the primary proof backend and copies exact byte windows from local files.internal/poc/source.goroutes each entry to either the local-file backend or the HTTP compatibility backend.
- Supports
HEAD, fullGET, and singleRange GET - Returns
416for invalid or unsatisfied ranges - Returns
501for multi-range requests - Emits regular-file
ustarentries only
PAXheaders- Directory or link entries
- Multi-range response bodies
- Live source mutation handling
- Prebuilt archive files or background cleanup
- Platform-specific zero-copy branches