tartrans

package
v0.0.0-...-7c31ad9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

The tar transmat packs filesystems into the widely-recognized "tar" format, and can use any k/v-styled warehouse for storage.

Index

Constants

View Source
const PackType = api.PackType("tar")

Variables

View Source
var (
	Mirror rio.MirrorFunc = util.CreateMirror(unpackTar)
	Scan   rio.ScanFunc   = util.CreateScanner(PackType, unpackTar)
	Unpack rio.UnpackFunc = util.CreateUnpack(PackType, unpackTar)
)

Functions

func Decompress

func Decompress(stream io.Reader) (io.Reader, error)

func MetadataToTarHdr

func MetadataToTarHdr(fmeta *fs.Metadata, hdr *tar.Header)

Mutate tar.Header fields to match the given fmeta.

func Pack

func Pack(
	ctx context.Context,
	packType api.PackType,
	pathStr string,
	filt api.FilesetPackFilter,
	warehouseAddr api.WarehouseLocation,
	mon rio.Monitor,
) (_ api.WareID, err error)

func TarHdrToMetadata

func TarHdrToMetadata(hdr *tar.Header, fmeta *fs.Metadata) (skipMe error, haltMe error)

Mutate fs.Metadata fields to match the given tar header. Does not check for names that go above '.'; caller may want to do that.

Types

type Compression

type Compression int
const (
	Uncompressed Compression = iota
	Bzip2
	Gzip
	Xz
)

func DetectCompression

func DetectCompression(source []byte) Compression

func (*Compression) Extension

func (compression *Compression) Extension() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL