Documentation ¶
Overview ¶
Package asm provides the API for streaming assembly and disassembly of tar archives.
Using the `github.com/griffindvs/tar-split/tar/storage` for Packing/Unpacking the metadata for a stream, as well as an implementation of Getting/Putting the file entries' payload.
Index ¶
- func IterateHeaders(unpacker storage.Unpacker, handler func(hdr *tar.Header) error) error
- func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io.Reader, error)
- func NewOutputTarStream(fg storage.FileGetter, up storage.Unpacker) io.ReadCloser
- func WriteOutputTarStream(fg storage.FileGetter, up storage.Unpacker, w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IterateHeaders ¶
IterateHeaders calls handler for each tar header provided by Unpacker
func NewInputTarStream ¶
NewInputTarStream wraps the Reader stream of a tar archive and provides a Reader stream of the same.
In the middle it will pack the segments and file metadata to storage.Packer `p`.
The the storage.FilePutter is where payload of files in the stream are stashed. If this stashing is not needed, you can provide a nil storage.FilePutter. Since the checksumming is still needed, then a default of NewDiscardFilePutter will be used internally
func NewOutputTarStream ¶
func NewOutputTarStream(fg storage.FileGetter, up storage.Unpacker) io.ReadCloser
NewOutputTarStream returns an io.ReadCloser that is an assembled tar archive stream.
It takes a storage.FileGetter, for mapping the file payloads that are to be read in, and a storage.Unpacker, which has access to the rawbytes and file order metadata. With the combination of these two items, a precise assembled Tar archive is possible.
func WriteOutputTarStream ¶
WriteOutputTarStream writes assembled tar archive to a writer.
Types ¶
This section is empty.