remount

package module
v0.0.0-...-267dc0d Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 31 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Clone

func Clone(x fs.FS, dx fs.FS, y, dy string) error

func Dotify

func Dotify(p string) string

func FuseFS

func FuseFS(r p9.Attachment) fusefs.FS

func GetHackFlag

func GetHackFlag(x experimentalsys.Oflag) int

func GetSysFlag

func GetSysFlag(x int) experimentalsys.Oflag

func Ipfs

func Ipfs(x fs.FS, y string) (files.Node, error)

func L

func L(l Lookup) hackpadfs.FS

func Meld

func Meld(i I, x, y string) (string, error)

func Mount

func Mount(j fs.FS, p string) (func() error, error)

func MountIpfs

func MountIpfs(x I, i, p string) (func() error, error)

func NewCow

func NewCow(over fs.FS, layer fs.FS) fs.FS

func NewDir

func NewDir(i I, m map[string]string) (string, error)

func Patch

func Patch(i I, x string, f func(*mount.FS) error) (string, error)

func ServeFuse

func ServeFuse(c *fuse.Conn, r p9.Attachment) error

func WazAdapt

func WazAdapt(err error) experimentalsys.Errno

func WithHackpadFS

func WithHackpadFS(x wazero.FSConfig, d string, fs hackpadfs.FS) wazero.FSConfig

Types

type A

type A struct {
	afero.File
}

type AF

type AF struct {
	fs.FS
}

func (AF) Chmod

func (b AF) Chmod(name string, mode os.FileMode) error

Chmod changes the mode of the named file to mode.

func (AF) Chown

func (b AF) Chown(name string, uid, gid int) error

Chown changes the uid and gid of the named file.

func (AF) Chtimes

func (b AF) Chtimes(name string, atime time.Time, mtime time.Time) error

Chtimes changes the access and modification times of the named file

func (AF) Create

func (b AF) Create(filename string) (afero.File, error)

Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR.

func (AF) Join

func (b AF) Join(elem ...string) string

Join joins any number of path elements into a single path, adding a Separator if necessary. Join calls filepath.Clean on the result; in particular, all empty strings are ignored. On Windows, the result is a UNC path if and only if the first path element is a UNC path.

func (AF) Lstat

func (b AF) Lstat(filename string) (os.FileInfo, error)

Lstat returns a FileInfo describing the named file. If the file is a symbolic link, the returned FileInfo describes the symbolic link. Lstat makes no attempt to follow the link.

func (AF) Mkdir

func (b AF) Mkdir(filename string, perm os.FileMode) error

func (AF) MkdirAll

func (b AF) MkdirAll(filename string, perm os.FileMode) error

MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm are used for all directories that MkdirAll creates. If path is/ already a directory, MkdirAll does nothing and returns nil.

func (AF) Name

func (b AF) Name() string

func (AF) Open

func (b AF) Open(filename string) (afero.File, error)

Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.

func (AF) OpenFile

func (b AF) OpenFile(filename string, flag int, perm os.FileMode) (afero.File, error)

OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O.

func (AF) ReadDir

func (b AF) ReadDir(path string) ([]os.FileInfo, error)

ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.

func (b AF) Readlink(link string) (string, error)

Readlink returns the target path of link.

func (AF) Remove

func (b AF) Remove(filename string) error

Remove removes the named file or directory.

func (AF) RemoveAll

func (b AF) RemoveAll(filename string) error

func (AF) Rename

func (b AF) Rename(oldpath, newpath string) error

Rename renames (moves) oldpath to newpath. If newpath already exists and is not a directory, Rename replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories.

func (AF) Root

func (b AF) Root() string

Root returns the root path of the filesystem.

func (AF) Stat

func (b AF) Stat(filename string) (os.FileInfo, error)

Stat returns a FileInfo describing the named file.

func (b AF) Symlink(target, link string) error

Symlink creates a symbolic-link from link to target. target may be an absolute or relative path, and need not refer to an existing node. Parent directories of link are created as necessary.

func (AF) TempFile

func (b AF) TempFile(dir, prefix string) (billy.File, error)

type B

type B struct {
	fs.File
}

func (B) Lock

func (b B) Lock() error

func (B) Name

func (b B) Name() string

func (B) ReadAt

func (b B) ReadAt(p []byte, off int64) (n int, err error)

func (B) Readdir

func (b B) Readdir(count int) ([]os.FileInfo, error)

func (B) Readdirnames

func (b B) Readdirnames(count int) ([]string, error)

func (B) Seek

func (b B) Seek(offset int64, whence int) (int64, error)

func (B) Sync

func (b B) Sync() error

func (B) Truncate

func (b B) Truncate(size int64) error

func (B) Unlock

func (b B) Unlock() error

func (B) Write

func (b B) Write(x []byte) (int, error)

func (B) WriteAt

func (b B) WriteAt(p []byte, off int64) (n int, err error)

func (B) WriteString

func (b B) WriteString(s string) (ret int, err error)

type BF

type BF struct {
	fs.FS
}

func (BF) Chroot

func (b BF) Chroot(path string) (billy.Filesystem, error)

Chroot returns a new filesystem from the same type where the new root is the given path. Files outside of the designated directory tree cannot be accessed.

func (BF) Create

func (b BF) Create(filename string) (billy.File, error)

Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR.

func (BF) Join

func (b BF) Join(elem ...string) string

Join joins any number of path elements into a single path, adding a Separator if necessary. Join calls filepath.Clean on the result; in particular, all empty strings are ignored. On Windows, the result is a UNC path if and only if the first path element is a UNC path.

func (BF) Lstat

func (b BF) Lstat(filename string) (os.FileInfo, error)

Lstat returns a FileInfo describing the named file. If the file is a symbolic link, the returned FileInfo describes the symbolic link. Lstat makes no attempt to follow the link.

func (BF) MkdirAll

func (b BF) MkdirAll(filename string, perm os.FileMode) error

MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm are used for all directories that MkdirAll creates. If path is/ already a directory, MkdirAll does nothing and returns nil.

func (BF) Open

func (b BF) Open(filename string) (billy.File, error)

Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.

func (BF) OpenFile

func (b BF) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)

OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O.

func (BF) ReadDir

func (b BF) ReadDir(path string) ([]os.FileInfo, error)

ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.

func (b BF) Readlink(link string) (string, error)

Readlink returns the target path of link.

func (BF) Remove

func (b BF) Remove(filename string) error

Remove removes the named file or directory.

func (BF) Rename

func (b BF) Rename(oldpath, newpath string) error

Rename renames (moves) oldpath to newpath. If newpath already exists and is not a directory, Rename replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories.

func (BF) Root

func (b BF) Root() string

Root returns the root path of the filesystem.

func (BF) Stat

func (b BF) Stat(filename string) (os.FileInfo, error)

Stat returns a FileInfo describing the named file.

func (b BF) Symlink(target, link string) error

Symlink creates a symbolic-link from link to target. target may be an absolute or relative path, and need not refer to an existing node. Parent directories of link are created as necessary.

func (BF) TempFile

func (b BF) TempFile(dir, prefix string) (billy.File, error)

type Dav

type Dav struct {
	hackpadfs.FS
}

func (Dav) Mkdir

func (d Dav) Mkdir(ctx context.Context, name string, perm fs.FileMode) error

Mkdir implements webdav.FileSystem.

func (Dav) OpenFile

func (d Dav) OpenFile(ctx context.Context, name string, flag int, perm fs.FileMode) (webdav.File, error)

OpenFile implements webdav.FileSystem.

func (Dav) RemoveAll

func (d Dav) RemoveAll(ctx context.Context, name string) error

RemoveAll implements webdav.FileSystem.

func (Dav) Rename

func (d Dav) Rename(ctx context.Context, oldName string, newName string) error

Rename implements webdav.FileSystem.

func (Dav) Stat

func (d Dav) Stat(ctx context.Context, name string) (fs.FileInfo, error)

Stat implements webdav.FileSystem.

type Dir

type Dir struct {
	hackpadfs.FS
}

Dir is an implementation of FileSystem that serves from the local filesystem. It accepts attachments of either "" or "/", but rejects all others.

Note that Dir does not support authentication, simply returning an error for any attempt to do so. If authentication is necessary, wrap a Dir in an AuthFS instance.

func (Dir) Attach

func (d Dir) Attach(afile p9.File, user, aname string) (p9.Attachment, error)

Attach implements FileSystem.Attach.

func (Dir) Auth

func (d Dir) Auth(user, aname string) (p9.File, error)

Auth implements FileSystem.Auth.

func (Dir) Create

func (d Dir) Create(p string, perm p9.FileMode, mode uint8) (p9.File, error)

Create implements Attachment.Create.

func (Dir) Open

func (d Dir) Open(p string, mode uint8) (p9.File, error)

Open implements Attachment.Open.

func (Dir) Remove

func (d Dir) Remove(p string) error

Remove implements Attachment.Remove.

func (Dir) Stat

func (d Dir) Stat(p string) (p9.DirEntry, error)

Stat implements Attachment.Stat.

func (Dir) WriteStat

func (d Dir) WriteStat(p string, changes p9.StatChanges) error

WriteStat implements Attachment.WriteStat.

type F

type F struct {
	billy.File
}

func (F) Stat

func (f F) Stat() (fs.FileInfo, error)

type FA

type FA struct {
	afero.Afero
}

func NewAferoShim

func NewAferoShim(x afero.Fs) FA

func (FA) Create

func (b FA) Create(filename string) (fs.File, error)

Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR.

func (FA) Open

func (b FA) Open(filename string) (fs.File, error)

Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.

func (FA) OpenFile

func (b FA) OpenFile(filename string, flag int, perm os.FileMode) (fs.File, error)

OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O.

func (FA) ReadDir

func (b FA) ReadDir(path string) ([]os.DirEntry, error)

type FB

type FB struct {
	billy.Filesystem
}

func (FB) Create

func (b FB) Create(filename string) (fs.File, error)

Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR.

func (FB) Open

func (b FB) Open(filename string) (fs.File, error)

Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.

func (FB) OpenFile

func (b FB) OpenFile(filename string, flag int, perm os.FileMode) (fs.File, error)

OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O.

func (FB) ReadDir

func (b FB) ReadDir(path string) ([]os.DirEntry, error)

type FSF

type FSF struct {
	p9.File
	Path   PathF
	Offset *int64
}

func (FSF) Read

func (f FSF) Read(p []byte) (int, error)

func (FSF) ReadDir

func (f FSF) ReadDir(n int) ([]hackpadfs.DirEntry, error)

func (FSF) Seek

func (f FSF) Seek(offset int64, whence int) (int64, error)

func (FSF) Stat

func (f FSF) Stat() (hackpadfs.FileInfo, error)

func (FSF) Write

func (f FSF) Write(p []byte) (int, error)

type FSP

type FSP struct {
	*p9.Remote
}

func (FSP) Create

func (f FSP) Create(a string, b p9.FileMode, c uint8) (p9.File, error)

func (FSP) Open

func (f FSP) Open(a string, b uint8) (p9.File, error)

func (FSP) WriteStat

func (f FSP) WriteStat(path string, changes p9.StatChanges) error

type FSS

type FSS struct {
	p9.DirEntry
}

type FSW

type FSW struct {
	p9.Attachment
}

func (FSW) Open

func (f FSW) Open(x string) (hackpadfs.File, error)

func (FSW) OpenFile

func (f FSW) OpenFile(x string, flag int, perm hackpadfs.FileMode) (hackpadfs.File, error)

type I

type I struct {
	iface.CoreAPI
	Ctx context.Context
}

func (I) Open

func (i I) Open(x string) (fs.File, error)

func (I) Push

func (i I) Push(x fs.FS, y string) (string, error)

type IF

type IF struct {
	files.Node
	Name string
	Rec  func() IF
}

func (IF) Read

func (i IF) Read(x []byte) (int, error)

func (IF) ReadAt

func (i IF) ReadAt(b []byte, off int64) (n int, err error)

func (IF) ReadDir

func (i IF) ReadDir(n int) ([]fs.DirEntry, error)

func (IF) Stat

func (i IF) Stat() (os.FileInfo, error)

type IN

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

func (IN) IsDir

func (i IN) IsDir() bool

func (IN) ModTime

func (i IN) ModTime() time.Time

func (IN) Mode

func (i IN) Mode() fs.FileMode

func (IN) Name

func (i IN) Name() string

func (IN) Size

func (i IN) Size() int64

func (IN) Sys

func (i IN) Sys() any

type Lookup

type Lookup interface {
	LookupFS(string) (string, hackpadfs.FS, error)
}

type N

type N struct {
	fs.File
	FS   fs.FS
	Name string
}

func (N) Size

func (n N) Size() (int64, error)

type PathF

type PathF struct {
	p9.Attachment
	Path string
}

type Pusher

type Pusher interface {
	Push(x fs.FS, y string) (string, error)
}

type Sftp

type Sftp struct {
	*sftp.Client
}

func (Sftp) Open

func (s Sftp) Open(filename string) (fs.File, error)

func (Sftp) OpenFile

func (s Sftp) OpenFile(filename string, flag int, perm os.FileMode) (fs.File, error)

func (Sftp) ReadDir

func (s Sftp) ReadDir(path string) ([]hackpadfs.DirEntry, error)

func (Sftp) Stat

func (s Sftp) Stat(name string) (hackpadfs.FileInfo, error)

type WackFS

type WackFS func(string) (string, hackpadfs.FS, error)

func (WackFS) Open

func (f WackFS) Open(path string) (hackpadfs.File, error)

func (WackFS) OpenFile

func (f WackFS) OpenFile(path string, flag int, perm hackpadfs.FileMode) (hackpadfs.File, error)

type WazFS

type WazFS struct {
	hackpadfs.FS
}

func (WazFS) Chmod

func (WazFS) Chmod(path string, perm fs.FileMode) experimentalsys.Errno

Chmod implements sys.FS.

func (WazFS) Link(oldPath string, newPath string) experimentalsys.Errno

Link implements sys.FS.

func (WazFS) Lstat

func (w WazFS) Lstat(path string) (sys.Stat_t, experimentalsys.Errno)

Lstat implements sys.FS.

func (WazFS) Mkdir

func (WazFS) Mkdir(path string, perm fs.FileMode) experimentalsys.Errno

Mkdir implements sys.FS.

func (*WazFS) OpenFile

OpenFile implements sys.FS.

func (WazFS) Readlink(path string) (string, experimentalsys.Errno)

Readlink implements sys.FS.

func (WazFS) Rename

func (WazFS) Rename(from string, to string) experimentalsys.Errno

Rename implements sys.FS.

func (WazFS) Rmdir

func (WazFS) Rmdir(path string) experimentalsys.Errno

Rmdir implements sys.FS.

func (WazFS) Stat

func (w WazFS) Stat(path string) (sys.Stat_t, experimentalsys.Errno)

Stat implements sys.FS.

func (WazFS) Symlink(oldPath string, linkName string) experimentalsys.Errno

Symlink implements sys.FS.

func (WazFS) Unlink(path string) experimentalsys.Errno

Unlink implements sys.FS.

func (WazFS) Utimens

func (WazFS) Utimens(path string, atim int64, mtim int64) experimentalsys.Errno

Utimens implements sys.FS.

type WazFile

type WazFile struct {
	B     B
	Flags experimentalsys.Oflag
	In    struct {
		FS   *WazFS
		Path string
	}
}

func (WazFile) Close

func (w WazFile) Close() experimentalsys.Errno

Close implements sys.File.

func (WazFile) Datasync

func (w WazFile) Datasync() experimentalsys.Errno

Datasync implements sys.File.

func (WazFile) Dev

func (w WazFile) Dev() (uint64, experimentalsys.Errno)

Dev implements sys.File.

func (WazFile) Ino

Ino implements sys.File.

func (WazFile) IsAppend

func (w WazFile) IsAppend() bool

IsAppend implements sys.File.

func (WazFile) IsDir

func (w WazFile) IsDir() (bool, experimentalsys.Errno)

IsDir implements sys.File.

func (WazFile) Pread

func (w WazFile) Pread(buf []byte, off int64) (n int, errno experimentalsys.Errno)

Pread implements sys.File.

func (WazFile) Pwrite

func (w WazFile) Pwrite(buf []byte, off int64) (n int, errno experimentalsys.Errno)

Pwrite implements sys.File.

func (WazFile) Read

func (w WazFile) Read(buf []byte) (n int, errno experimentalsys.Errno)

Read implements sys.File.

func (WazFile) Readdir

func (w WazFile) Readdir(n int) (dirents []experimentalsys.Dirent, errno experimentalsys.Errno)

Readdir implements sys.File.

func (*WazFile) Reopen

func (w *WazFile) Reopen() error

func (WazFile) Seek

func (w WazFile) Seek(offset int64, whence int) (newOffset int64, errno experimentalsys.Errno)

Seek implements sys.File.

func (*WazFile) SetAppend

func (w *WazFile) SetAppend(enable bool) experimentalsys.Errno

SetAppend implements sys.File.

func (WazFile) Stat

func (w WazFile) Stat() (sys.Stat_t, experimentalsys.Errno)

Stat implements sys.File.

func (WazFile) Sync

func (w WazFile) Sync() experimentalsys.Errno

Sync implements sys.File.

func (WazFile) Truncate

func (w WazFile) Truncate(size int64) experimentalsys.Errno

Truncate implements sys.File.

func (WazFile) Utimens

func (WazFile) Utimens(atim int64, mtim int64) experimentalsys.Errno

Utimens implements sys.File.

func (WazFile) Write

func (w WazFile) Write(buf []byte) (n int, errno experimentalsys.Errno)

Write implements sys.File.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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