mount

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrAlreadyMounted

func IsErrAlreadyMounted(err error) bool

func IsErrCrossFsRename

func IsErrCrossFsRename(err error) bool

func IsErrNotAFile

func IsErrNotAFile(err error) bool

func IsErrNotMounted

func IsErrNotMounted(err error) bool

func IsErrOsFs

func IsErrOsFs(err error) bool

func IsErrRecursiveMount

func IsErrRecursiveMount(err error) bool

func IsErrShortCopy

func IsErrShortCopy(err error) bool

func IsMountNode

func IsMountNode(info os.FileInfo) bool

Types

type MountableFs

type MountableFs struct {

	// If true, it is possible to mount an Fs over an existing file or directory.
	// If false, attempting to do so will result in an error.
	AllowMasking bool

	// If true, the same Fs can be mounted inside an existing mount of the same Fs,
	// for e.g:
	//	child := afero.NewMemMapFs()
	//	mfs.Mount("/yep", child)
	//	mfs.Mount("/yep/yep", child)
	AllowRecursiveMount bool
	// contains filtered or unexported fields
}

MountableFs allows different paths in a hierarchy to be served by different afero.Fs objects.

func NewMountableFs

func NewMountableFs(base Fs) *MountableFs

func (*MountableFs) Chmod

func (m *MountableFs) Chmod(name string, mode os.FileMode) error

func (*MountableFs) Chtimes

func (m *MountableFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*MountableFs) Create

func (m *MountableFs) Create(name string) (File, error)

func (*MountableFs) Mkdir

func (m *MountableFs) Mkdir(name string, perm os.FileMode) error

func (*MountableFs) MkdirAll

func (m *MountableFs) MkdirAll(path string, perm os.FileMode) error

func (*MountableFs) Mount

func (m *MountableFs) Mount(path string, fs Fs) error

Mount an afero.Fs at the specified path.

This will fail if there is already a Fs at the path, or any existing mounted Fs contains a file at that path.

You must wrap an afero.OsFs in an afero.BasePathFs to mount it, even if that's just to dispose of the Windows drive letter.

func (*MountableFs) Name

func (m *MountableFs) Name() string

func (*MountableFs) Open

func (m *MountableFs) Open(name string) (File, error)

func (*MountableFs) OpenFile

func (m *MountableFs) OpenFile(name string, flag int, perm os.FileMode) (File, error)

func (*MountableFs) Remount

func (m *MountableFs) Remount(path string, fs Fs) error

func (*MountableFs) Remove

func (m *MountableFs) Remove(name string) error

func (*MountableFs) RemoveAll

func (m *MountableFs) RemoveAll(path string) error

func (*MountableFs) Rename

func (m *MountableFs) Rename(oldname string, newname string) error

func (*MountableFs) Stat

func (m *MountableFs) Stat(name string) (os.FileInfo, error)

func (*MountableFs) Umount

func (m *MountableFs) Umount(path string) error

Jump to

Keyboard shortcuts

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