archive

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package archive contains types related to zip handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZipData

type ZipData interface {
	Files() []*zip.File

	FileByName(name string) (file *zip.File, err error)
	FilesByName(substring string) (files []*zip.File, err error)
	// contains filtered or unexported methods
}

ZipData defines the common interface for different zip-handling types.

type ZipFile

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

ZipFile is an implementation of the ZipData interface for actual zip files.

func NewZipFile

func NewZipFile(path string) (*ZipFile, error)

NewZipFile creates a ZipFile for an actual zip file given by its path.

func NewZipFileFromUrl

func NewZipFileFromUrl(url string) (*ZipFile, error)

NewZipFileFromUrl creates a ZipFile from a URL

func (*ZipFile) FileByName

func (z *ZipFile) FileByName(name string) (file *zip.File, err error)

FileByName finds the file with the given name or returns an error.

func (*ZipFile) Files

func (z *ZipFile) Files() []*zip.File

Files returns the files inside the zip archive.

func (*ZipFile) FilesByName

func (z *ZipFile) FilesByName(substring string) (files []*zip.File, err error)

FilesByName finds all the files containing the given substring or return an error.

type ZipFileReader

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

func (*ZipFileReader) Close

func (r *ZipFileReader) Close() error

func (*ZipFileReader) Files

func (r *ZipFileReader) Files() []*zip.File

type ZipReader

type ZipReader interface {
	Files() []*zip.File
	Close() error
}

type ZipUrlReader

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

func (*ZipUrlReader) Close

func (r *ZipUrlReader) Close() error

func (*ZipUrlReader) Files

func (r *ZipUrlReader) Files() []*zip.File

Jump to

Keyboard shortcuts

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