package asm

import "github.com/vbatts/tar-split/tar/asm"

Package asm provides the API for streaming assembly and disassembly of tar archives.

Using the `github.com/vbatts/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

Functions

func NewInputTarStream

func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io.Reader, error)

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.

Source Files

assemble.go disassemble.go doc.go

Version
v0.9.6
Published
Aug 13, 2015
Platform
js/wasm
Imports
7 packages
Last checked
6 days ago

Tools for package owners.