go/src/archive/tar/format.go

type Format

const _

const FormatUnknown

const formatV7

const FormatUSTAR

const FormatPAX

const FormatGNU

const formatSTAR

const formatMax

func (f Format) has(f2 Format) bool   {}

func (f *Format) mayBe(f2 Format)     {}

func (f *Format) mayOnlyBe(f2 Format) {}

func (f *Format) mustNotBe(f2 Format) {}

var formatNames

func (f Format) String() string {}

const (
	magicGNU
	versionGNU
)

const (
	magicUSTAR
	versionUSTAR
)

const trailerSTAR

const blockSize

const nameSize

const prefixSize

const maxSpecialFileSize

// blockPadding computes the number of bytes needed to pad offset up to the
// nearest block edge where 0 <= n < blockSize.
func blockPadding(offset int64) (n int64) {}

var zeroBlock

type block

// Convert block to any number of formats.
func (b *block) toV7() *headerV7       {}

func (b *block) toGNU() *headerGNU     {}

func (b *block) toSTAR() *headerSTAR   {}

func (b *block) toUSTAR() *headerUSTAR {}

func (b *block) toSparse() sparseArray {}

// getFormat checks that the block is a valid tar header based on the checksum.
// It then attempts to guess the specific format based on magic values.
// If the checksum fails, then FormatUnknown is returned.
func (b *block) getFormat() Format {}

// setFormat writes the magic values necessary for specified format
// and then updates the checksum accordingly.
func (b *block) setFormat(format Format) {}

// computeChecksum computes the checksum for the header block.
// POSIX specifies a sum of the unsigned byte values, but the Sun tar used
// signed byte values.
// We compute and return both.
func (b *block) computeChecksum() (unsigned, signed int64) {}

// reset clears the block with all zeros.
func (b *block) reset() {}

type headerV7

func (h *headerV7) name() []byte     {}

func (h *headerV7) mode() []byte     {}

func (h *headerV7) uid() []byte      {}

func (h *headerV7) gid() []byte      {}

func (h *headerV7) size() []byte     {}

func (h *headerV7) modTime() []byte  {}

func (h *headerV7) chksum() []byte   {}

func (h *headerV7) typeFlag() []byte {}

func (h *headerV7) linkName() []byte {}

type headerGNU

func (h *headerGNU) v7() *headerV7       {}

func (h *headerGNU) magic() []byte       {}

func (h *headerGNU) version() []byte     {}

func (h *headerGNU) userName() []byte    {}

func (h *headerGNU) groupName() []byte   {}

func (h *headerGNU) devMajor() []byte    {}

func (h *headerGNU) devMinor() []byte    {}

func (h *headerGNU) accessTime() []byte  {}

func (h *headerGNU) changeTime() []byte  {}

func (h *headerGNU) sparse() sparseArray {}

func (h *headerGNU) realSize() []byte    {}

type headerSTAR

func (h *headerSTAR) v7() *headerV7      {}

func (h *headerSTAR) magic() []byte      {}

func (h *headerSTAR) version() []byte    {}

func (h *headerSTAR) userName() []byte   {}

func (h *headerSTAR) groupName() []byte  {}

func (h *headerSTAR) devMajor() []byte   {}

func (h *headerSTAR) devMinor() []byte   {}

func (h *headerSTAR) prefix() []byte     {}

func (h *headerSTAR) accessTime() []byte {}

func (h *headerSTAR) changeTime() []byte {}

func (h *headerSTAR) trailer() []byte    {}

type headerUSTAR

func (h *headerUSTAR) v7() *headerV7     {}

func (h *headerUSTAR) magic() []byte     {}

func (h *headerUSTAR) version() []byte   {}

func (h *headerUSTAR) userName() []byte  {}

func (h *headerUSTAR) groupName() []byte {}

func (h *headerUSTAR) devMajor() []byte  {}

func (h *headerUSTAR) devMinor() []byte  {}

func (h *headerUSTAR) prefix() []byte    {}

type sparseArray

func (s sparseArray) entry(i int) sparseElem {}

func (s sparseArray) isExtended() []byte     {}

func (s sparseArray) maxEntries() int        {}

type sparseElem

func (s sparseElem) offset() []byte {}

func (s sparseElem) length() []byte {}