1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2024-11-25 09:15:40 +00:00
tar-split/archive/tar
Miloslav Trmač 99c8914877 Add tar/asm.IterateHeaders
This allows reading the metadata contained in tar-split
without expensively recreating the whole tar stream
including full contents.

We have two use cases for this:
- In a situation where tar-split is distributed along with
  a separate metadata stream, ensuring that the two are
  exactly consistent
- Reading the tar headers allows making a ~cheap check
  of consistency of on-disk layers, just checking that the
  files exist in expected sizes, without reading the full
  contents.

This can be implemented outside of this repo, but it's
not ideal:
- The function necessarily hard-codes some assumptions
  about how tar-split determines the boundaries of
  SegmentType/FileType entries (or, indeed, whether it
  uses FileType entries at all). That's best maintained
  directly beside the code that creates this.
- The ExpectedPadding() value is not currently exported,
  so the consumer would have to heuristically guess where
  the padding ends.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-09-11 20:01:49 +02:00
..
testdata archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
common.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
example_test.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
format.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
reader.go Add tar/asm.IterateHeaders 2024-09-11 20:01:49 +02:00
reader_test.go chore: remove refs to deprecated io/ioutil 2023-07-20 23:00:46 +08:00
stat_actime1.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
stat_actime2.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
stat_unix.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
strconv.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
strconv_test.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
tar_test.go chore: remove refs to deprecated io/ioutil 2023-07-20 23:00:46 +08:00
writer.go archive/tar: replace with one from go-1.11 2018-09-05 14:04:10 -07:00
writer_test.go chore: remove refs to deprecated io/ioutil 2023-07-20 23:00:46 +08:00