zip

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0, NCSA Imports: 9 Imported by: 0

Documentation

Overview

Package zip defines a VFS implementation that understands a zip archive as an isolated, read-only file system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct{ Archive *zip.Reader }

FS implements the vfs.Reader interface for zip archives.

func Open

func Open(r io.ReaderAt, size int64) (FS, error)

Open returns a read-only virtual file system (vfs.Reader), using the contents a zip archive read with r.

func (FS) Glob

func (z FS) Glob(_ context.Context, glob string) ([]string, error)

Glob implements part of vfs.Reader using filepath.Match to compare the glob pattern to each archive path.

func (FS) Open

func (z FS) Open(_ context.Context, path string) (vfs.FileReader, error)

Open implements part of vfs.Reader, returning a vfs.FileReader owned by the underlying zip archive. It is safe to open multiple files concurrently, as documented by the zip package.

func (FS) Stat

func (z FS) Stat(_ context.Context, path string) (os.FileInfo, error)

Stat implements part of vfs.Reader using the file metadata stored in the zip archive. The path must match one of the archive paths.

Jump to

Keyboard shortcuts

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