zipopenfs

package
v0.0.0-...-76e9ac6 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFakeDirFileInfo

func MakeFakeDirFileInfo(name string) os.FileInfo

func ReadSeekerToReaderAt

func ReadSeekerToReaderAt(rs io.ReadSeeker) io.ReaderAt

ReadSeekerToReaderAt takes a io.ReadSeeker and returns a new io.ReaderAt that will be a proxy for the ReadSeeker. Note that this new ReaderAt is not as powerful, because it does not allow ReadAt calls to be run in parallel (they lock while waiting)

func WrapReaderWithCloser

func WrapReaderWithCloser(rsc vfs.ReadSeekCloser, closer io.Closer) vfs.ReadSeekCloser

Types

type FSCloser

type FSCloser interface {
	vfs.FileSystem
	io.Closer
}

func NewZipOpeningFS

func NewZipOpeningFS(fs vfs.FileSystem) FSCloser

func WrapFSCloserWithCloser

func WrapFSCloserWithCloser(fs FSCloser, closer io.Closer) FSCloser

Takes an FSCloser and returns a new FSCloser with an additional Close method

type FakeDirFileInfo

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

FakeDirFileInfo is just a os.FileInfo that has nothing but a name and says it's a directory

func (FakeDirFileInfo) IsDir

func (i FakeDirFileInfo) IsDir() bool

func (FakeDirFileInfo) ModTime

func (i FakeDirFileInfo) ModTime() time.Time

func (FakeDirFileInfo) Mode

func (i FakeDirFileInfo) Mode() os.FileMode

func (FakeDirFileInfo) Name

func (i FakeDirFileInfo) Name() string

func (FakeDirFileInfo) Size

func (i FakeDirFileInfo) Size() int64

func (FakeDirFileInfo) Sys

func (i FakeDirFileInfo) Sys() interface{}

type ReadSeekerAt

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

ReadSeekerAt is a simple wrapper around a ReadSeeker to make it a ReaderAt. Note that using this canibalizes the seeking behavior of the underlying io.ReadSeeker, so it should not be used again

func (*ReadSeekerAt) ReadAt

func (f *ReadSeekerAt) ReadAt(p []byte, off int64) (n int, err error)

type ZipOpenFS

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

A ZipOpenFS is a vfs.FileSystem that treats zip files as directores instead of as regular files

func (*ZipOpenFS) Close

func (fs *ZipOpenFS) Close() error

func (*ZipOpenFS) Lstat

func (fs *ZipOpenFS) Lstat(p string) (os.FileInfo, error)

func (*ZipOpenFS) Open

func (fs *ZipOpenFS) Open(p string) (vfs.ReadSeekCloser, error)

func (*ZipOpenFS) ReadDir

func (fs *ZipOpenFS) ReadDir(p string) ([]os.FileInfo, error)

func (*ZipOpenFS) Stat

func (fs *ZipOpenFS) Stat(p string) (os.FileInfo, error)

func (*ZipOpenFS) String

func (fs *ZipOpenFS) String() string

Jump to

Keyboard shortcuts

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