tarstream

package module
v0.0.0-...-54cc173 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2016 License: MIT Imports: 6 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

tarstream

godoc build

golang library for streaming files from filesystem as a tar format

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenVec

func GenVec(files []string) (TarVec, []PositionInfo, error)

GenVec generates the tarvec and positioninfo from a list of files

func Validate

func Validate(r io.Reader) (*tar.Header, error)

Validate gets and validates the next header within the tarfile

Types

type Datavec

type Datavec interface {
	GetSize() int64
	Open() error
	Close()
	ReadAt(b []byte, off int64) (int, error)
}

Datavec is an interface for all vector types

type PositionInfo

type PositionInfo struct {
	Name   string
	Offset int64
	Size   int64
}

PositionInfo stores information on where files get placed in the tarball

type TarVec

type TarVec struct {
	Dvecs []Datavec
	Pos   int64
	Size  int64
}

TarVec is an array of datavecs representing a tarball

func (TarVec) GetSize

func (tv TarVec) GetSize() int64

GetSize gets the size of the tarball represented by the tarvec

func (*TarVec) Read

func (tv *TarVec) Read(b []byte) (int, error)

Read the data represented by the tarvec

func (*TarVec) Seek

func (tv *TarVec) Seek(offset int64, whence int) (int64, error)

Seek the virtual offset of the tarvec

Jump to

Keyboard shortcuts

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