file

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = 1 << (10 * iota)
	MB
	GB
)

Variables

This section is empty.

Functions

func ContentsFromZip

func ContentsFromZip(archivePath string, paths ...string) (map[string]string, error)

func ExtractFromZipToUniqueTempFile

func ExtractFromZipToUniqueTempFile(archivePath, dir string, paths ...string) (map[string]Opener, error)

func GlobMatch

func GlobMatch(pattern, name string) bool

Source: https://research.swtch.com/glob.go

func TraverseFilesInZip

func TraverseFilesInZip(archivePath string, visitor func(*zip.File) error, paths ...string) error

func UnzipToDir

func UnzipToDir(archivePath, targetDir string) error

Types

type Opener added in v0.4.0

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

func (Opener) Open added in v0.4.0

func (o Opener) Open() (io.ReadCloser, error)

type ZipFileManifest

type ZipFileManifest map[string]os.FileInfo

func NewZipFileManifest

func NewZipFileManifest(archivePath string) (ZipFileManifest, error)

func (ZipFileManifest) Add

func (z ZipFileManifest) Add(entry string, info os.FileInfo)

func (ZipFileManifest) GlobMatch

func (z ZipFileManifest) GlobMatch(patterns ...string) []string

Jump to

Keyboard shortcuts

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