mount

package
v1.51.0-mod-v1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(f fs.Fs, mountpoint string) error

Mount mounts the remote at mountpoint.

If noModTime is set then it

Types

type Dir

type Dir struct {
	*vfs.Dir
}

Dir represents a directory entry

func (*Dir) Attr

func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) (err error)

Attr updates the attributes of a directory

func (*Dir) Create

func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (node fusefs.Node, handle fusefs.Handle, err error)

Create makes a new file

func (*Dir) Fsync

func (d *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error)

Fsync the directory

func (d *Dir) Link(ctx context.Context, req *fuse.LinkRequest, old fusefs.Node) (newNode fusefs.Node, err error)

Link creates a new directory entry in the receiver based on an existing Node. Receiver must be a directory.

func (*Dir) Lookup

func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fusefs.Node, err error)

Lookup looks up a specific entry in the receiver.

Lookup should return a Node corresponding to the entry. If the name does not exist in the directory, Lookup should return ENOENT.

Lookup need not to handle the names "." and "..".

func (*Dir) Mkdir

func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (node fusefs.Node, err error)

Mkdir creates a new directory

func (*Dir) ReadDirAll

func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error)

ReadDirAll reads the contents of the directory

func (*Dir) Remove

func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error)

Remove removes the entry with the given name from the receiver, which must be a directory. The entry to be removed may correspond to a file (unlink) or to a directory (rmdir).

func (*Dir) Rename

func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDir fusefs.Node) (err error)

Rename the file

func (*Dir) Setattr

func (d *Dir) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error)

Setattr handles attribute changes from FUSE. Currently supports ModTime only.

type FS

type FS struct {
	*vfs.VFS
	// contains filtered or unexported fields
}

FS represents the top level filing system

func NewFS

func NewFS(f fs.Fs) *FS

NewFS makes a new FS

func (*FS) Root

func (f *FS) Root() (node fusefs.Node, err error)

Root returns the root node

func (*FS) Statfs

func (f *FS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) (err error)

Statfs is called to obtain file system metadata. It should write that data to resp.

type File

type File struct {
	*vfs.File
}

File represents a file

func (*File) Attr

func (f *File) Attr(ctx context.Context, a *fuse.Attr) (err error)

Attr fills out the attributes for the file

func (*File) Fsync

func (f *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error)

Fsync the file

Note that we don't do anything except return OK

func (*File) Getxattr

func (f *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp *fuse.GetxattrResponse) error

Getxattr gets an extended attribute by the given name from the node.

If there is no xattr by that name, returns fuse.ErrNoXattr.

func (*File) Listxattr

func (f *File) Listxattr(ctx context.