archive

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 7 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 MakeZipFile

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

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

func MakeZipFileFromUrl added in v1.0.4

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

MakeZipFileFromUrl 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.

Jump to

Keyboard shortcuts

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