prefixfs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	vfs.Filesystem

	// Prefix is used to prefix the path in each vfs.Filesystem operation.
	Prefix string
}

A FS that prefixes the path in each vfs.Filesystem operation.

func Create

func Create(root vfs.Filesystem, prefix string) *FS

Create returns a file system that prefixes all paths and forwards to root.

func (*FS) Lstat

func (fs *FS) Lstat(name string) (os.FileInfo, error)

Lstat implements vfs.Filesystem.

func (*FS) Mkdir

func (fs *FS) Mkdir(name string, perm os.FileMode) error

Mkdir implements vfs.Filesystem.

func (*FS) OpenFile

func (fs *FS) OpenFile(name string, flag int, perm os.FileMode) (vfs.File, error)

OpenFile implements vfs.Filesystem.

func (*FS) PathSeparator

func (fs *FS) PathSeparator() uint8

PathSeparator implements vfs.Filesystem.

func (*FS) PrefixPath

func (fs *FS) PrefixPath(path string) string

PrefixPath returns path with the prefix prefixed.

func (*FS) ReadDir

func (fs *FS) ReadDir(path string) ([]os.FileInfo, error)

ReadDir implements vfs.Filesystem.

func (*FS) Remove

func (fs *FS) Remove(name string) error

Remove implements vfs.Filesystem.

func (*FS) Rename

func (fs *FS) Rename(oldpath, newpath string) error

Rename implements vfs.Filesystem.

func (*FS) Stat

func (fs *FS) Stat(name string) (os.FileInfo, error)

Stat implements vfs.Filesystem.

Jump to

Keyboard shortcuts

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