How realkaiviljoen/streamx works
streamx is a command-line tool that probes a remote archive, then streams it directly into extracted files without staging the compressed archive. Its main workflow selects a RAR5 checkpointing engine or a general streaming engine, reconnects at verified byte offsets, and persists progress for resume. The RAR5 path parses archive blocks and can checkpoint stored entries; other formats are network-resumable but not crash-resumable. The README documents major behavior beyond the sampled excerpts; unsampled implementation details are represented only where paths are present in the tree.
Main entry points: cmds.go Probe and run · rar5.go RAR5 extraction · main.go Command router · httpx.go HTTP probe
Components 17
CLI commands
- Command router
cmd/streamx/main.go - Probe and run
cmd/streamx/cmds.go - Status inspection
cmd/streamx/cmds.go - Progress display
internal/ui/progress.go
Remote transfer
- HTTP probe
internal/httpx/httpx.go - Resumable reader
internal/httpx/reader.go
Extraction
- Engine selection
cmd/streamx/cmds.go - Pipe extraction
internal/extract/pipe.go - RAR5 extraction
internal/extract/rar5.go - RAR5 block parser
internal/rar5/rar5.go
Safety and recovery
- Path protection
internal/safe/path.go - Free-space checks
internal/diskx/diskx.go - Resume checkpoint
internal/state/state.go
Other components
- User
- Archive server
- libarchive bsdtar
- Extracted files
Connections 20
- User → Command router: invokes
README.md - Command router → Probe and run: routes commands
cmd/streamx/main.go - Probe and run → HTTP probe: probes object
README.md - HTTP probe → Archive server: requests metadata
README.md - Probe and run → Engine selection: starts get or resume
cmd/streamx/cmds.go - Engine selection → Resumable reader: opens byte stream
README.md - Resumable reader → Archive server: ranges and reconnects
README.md - Engine selection → Pipe extraction: streams other formats
README.md - Engine selection → RAR5 extraction: selects RAR5 mode
README.md - RAR5 extraction → RAR5 block parser: parses block chain
internal/extract/rar5.go - RAR5 extraction → libarchive bsdtar: feeds synthesized archive
internal/extract/rar5.go - Pipe extraction → libarchive bsdtar: streams archive
README.md - RAR5 extraction → Extracted files: writes extracted entries
README.md - libarchive bsdtar → Extracted files: extracts files
README.md - RAR5 extraction → Path protection: sanitizes entry paths
internal/extract/rar5.go - Probe and run → Free-space checks: checks free space
cmd/streamx/cmds.go - RAR5 extraction → Resume checkpoint: saves resume progress
internal/extract/rar5.go - Probe and run → Resume checkpoint: loads resume state
README.md - Probe and run → Status inspection: shows checkpoint
README.md - Probe and run → Progress display: reports transfer progress
README.md