Documentation
¶
Overview ¶
Command backup-streams backs up multiple streams of data — virtual files that exist nowhere on disk — in one gopbs.Backup call. The streams are placed under a virtual root directory named after the archive, and the snapshot gets a catalog, so everything browses and restores like a real directory tree.
A stream's size must be declared up front (the archive layout commits to it), which leads to three practical patterns, all shown here:
- generate into a buffer first, then declare the buffer's length — for content whose size is unknown until produced;
- an open file with the size from fstat — streams file content without buffering it;
- a pure reader whose size is known a priori — nothing is buffered at all, the content is produced as the backup consumes it.
The flag defaults match the test stack in tests/compose.yml:
cd tests && docker compose up -d garage pmoxs3 go run ./examples/backup-streams
Click to show internal directories.
Click to hide internal directories.