zipscanner

package module
v0.0.0-...-9316831 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 8 Imported by: 0

README

zipscanner

A zip file library that scan the file sequentially and tries to extract its content

This library implements a bufio.Scanner like interface that operates on a zip file. It tries to parse the zip file sequentially in order to avoid seeks to the central directory (useful for streaming zip content from a network resource)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidFileHeader           = errors.New("invalid file header")
	InvalidDataDescriptorHeader = errors.New("invalid data descriptor header")
	UnsupportedCompression      = errors.New("unsupported compression mode")
	NoUncompressedSize          = errors.New("missing uncompressed size")
)

Functions

This section is empty.

Types

type ZipScanner

type ZipScanner interface {
	Scan() bool
	FileHeader() zip.FileHeader
	Reader() (io.Reader, error)
	Error() error
}

type ZipScannerImpl

type ZipScannerImpl struct {
	Debug bool
	// contains filtered or unexported fields
}

func NewZipScanner

func NewZipScanner(r io.Reader) *ZipScannerImpl

func (*ZipScannerImpl) Error

func (r *ZipScannerImpl) Error() error

func (*ZipScannerImpl) FileHeader

func (r *ZipScannerImpl) FileHeader() zip.FileHeader

func (*ZipScannerImpl) Reader

func (r *ZipScannerImpl) Reader() (io.Reader, error)

func (*ZipScannerImpl) Scan

func (r *ZipScannerImpl) Scan() bool

type ZipWrapper

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

ZipWrapper wraps a zip.Reader into a ZipScanner compatible interface

func NewZipWrapper

func NewZipWrapper(z *zip.Reader) *ZipWrapper

func (*ZipWrapper) Error

func (z *ZipWrapper) Error() error

func (*ZipWrapper) FileHeader

func (z *ZipWrapper) FileHeader() zip.FileHeader

func (*ZipWrapper) Reader

func (z *ZipWrapper) Reader() (io.Reader, error)

func (*ZipWrapper) Scan

func (z *ZipWrapper) Scan() bool

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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