vfs

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package vfs implements a layered filesystem for use with billy.Filesystem

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error

Walk walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by walkFn. The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient. Walk does not follow symbolic links.

This is a straight copy of filepath.Walk using a billy.Filesystem

Types

type LayeredFS

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

LayeredFS implements the billy.Filesystem interface

func NewLayeredFS

func NewLayeredFS(filesystems ...billy.Filesystem) *LayeredFS

NewLayeredFile creates a layered file-system from a array of billy.Filesystem instances

func (*LayeredFS) Chmod

func (l *LayeredFS) Chmod(name string, mode os.FileMode) error

func (*LayeredFS) Chown

func (l *LayeredFS) Chown(name string, uid, gid int) error

func (*LayeredFS) Chroot

func (l *LayeredFS) Chroot(path string) (billy.Filesystem, error)

func (*LayeredFS) Chtimes

func (l *LayeredFS) Chtimes(name string, atime, mtime time.Time) error

func (*LayeredFS) Create

func (l *LayeredFS) Create(path string) (billy.File, error)

func (*LayeredFS) Join

func (l *LayeredFS) Join(elem ...string) string

func (*LayeredFS) Lchown

func (l *LayeredFS) Lchown(name string, uid, gid int) error

func (*LayeredFS) Lstat

func (l *LayeredFS) Lstat(path string) (os.FileInfo, error)

func (*LayeredFS) MkdirAll

func (l *LayeredFS) MkdirAll(dir string, perm os.FileMode) error

func (*LayeredFS) Open

func (l *LayeredFS) Open(path string) (billy.File, error)

func (*LayeredFS) OpenFile

func (l *LayeredFS) OpenFile(path string, flag int, perm os.FileMode) (billy.File, error)

func (*LayeredFS) ReadDir

func (l *LayeredFS) ReadDir(dir string) ([]os.FileInfo, error)

ReadDir will read a directory across all available filesystems, and deduplicate

func (l *LayeredFS) Readlink(path string) (string, error)

func (*LayeredFS) Remove

func (l *LayeredFS) Remove(path string) error

func (*LayeredFS) Rename

func (l *LayeredFS) Rename(oldPath, newPath string) error

func (*LayeredFS) Root

func (l *LayeredFS) Root() string

func (*LayeredFS) Stat

func (l *LayeredFS) Stat(path string) (os.FileInfo, error)
func (l *LayeredFS) Symlink(target, link string) error

func (*LayeredFS) TempFile

func (l *LayeredFS) TempFile(dir, prefix string) (billy.File, error)

Jump to

Keyboard shortcuts

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