archive_stream

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Extra header IDs.
	// See http://mdfs.net/Docs/Comp/Archiving/Zip/ExtraField
	Zip64ExtraID       = 0x0001 // Zip64 extended information
	NtFsExtraID        = 0x000a // NTFS
	UnixExtraID        = 0x000d // UNIX
	ExtTimeExtraID     = 0x5455 // Extended timestamp
	InfoZipUnixExtraID = 0x5855 // Info-ZIP Unix extension

)
View Source
const (
	CompressMethodStored   = 0
	CompressMethodDeflated = 8
)

Variables

View Source
var SUPPORTED_FORMATS map[ft.FileType]bool = map[ft.FileType]bool{
	ft.GZIP: false,
	ft.ZIP:  true,
}

Functions

func MSDosTimeToTime

func MSDosTimeToTime(dosDate, dosTime uint16) time.Time

Types

type ArchiveEntry

type ArchiveEntry interface {
	IsDir() bool
	Open() (io.ReadCloser, error)

	GetName() string
	// contains filtered or unexported methods
}

type ArchiveEntryState

type ArchiveEntryState struct {
	// contains filtered or unexported fields
}

type ArchiveStreamReader

type ArchiveStreamReader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(reader io.Reader) *ArchiveStreamReader

func (*ArchiveStreamReader) GetNextEntry

func (reader *ArchiveStreamReader) GetNextEntry() (ArchiveEntry, error)

type GzipEntry

type GzipEntry struct {
	gzip.Header // Entry Header
	ArchiveEntryState
}

func (*GzipEntry) GetName

func (entry *GzipEntry) GetName() string

GetName implements ArchiveEntry.

func (*GzipEntry) IsDir

func (entry *GzipEntry) IsDir() bool

IsDir implements ArchiveEntry.

func (*GzipEntry) Open

func (entry *GzipEntry) Open() (io.ReadCloser, error)

Open implements ArchiveEntry.

type GzipEntryCloser

type GzipEntryCloser struct {
	io.Reader
	// contains filtered or unexported fields
}

func (GzipEntryCloser) Close

func (gzipEntryCloser GzipEntryCloser) Close() error

type ReadBuf

type ReadBuf []byte

func (*ReadBuf) Sub

func (buff *ReadBuf) Sub(n int) ReadBuf

func (*ReadBuf) Uint16

func (buff *ReadBuf) Uint16() uint16

func (*ReadBuf) Uint32

func (buff *ReadBuf) Uint32() uint32

func (*ReadBuf) Uint64

func (buff *ReadBuf) Uint64() uint64

func (*ReadBuf) Uint8

func (buff *ReadBuf) Uint8() uint8

type TarEntry

type TarEntry struct {
	tar.Header // Entry Header
	ArchiveEntryState
}

type ZipEntry

type ZipEntry struct {
	zip.FileHeader // Entry header
	ArchiveEntryState
	// contains filtered or unexported fields
}

func (*ZipEntry) GetName

func (entry *ZipEntry) GetName() string

GetName implements ArchiveEntry.

func (*ZipEntry) IsDir

func (entry *ZipEntry) IsDir() bool

IsDir implements ArchiveEntry. Just simply check whether the entry name ends with "/"

func (*ZipEntry) Open

func (entry *ZipEntry) Open() (io.ReadCloser, error)

Open implements ArchiveEntry.

Jump to

Keyboard shortcuts

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