Documentation ¶
Index ¶
- func Mount(source string, mountpoint string, fstype *string, options *string) error
- func MountFn(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (<-chan error, func() error, error)
- func UmountByDevice(device string) error
- func UmountByMountPoint(mountpoint string) error
- type Dir
- func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) (err error)
- func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (node fusefs.Node, handle fusefs.Handle, err error)
- func (d *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error)
- func (d *Dir) Link(ctx context.Context, req *fuse.LinkRequest, old fusefs.Node) (newNode fusefs.Node, err error)
- func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fusefs.Node, err error)
- func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (node fusefs.Node, err error)
- func (d *Dir) Mknod(ctx context.Context, req *fuse.MknodRequest) (node fusefs.Node, err error)
- func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error)
- func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error)
- func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDir fusefs.Node) (err error)
- func (d *Dir) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error)
- type FS
- type File
- func (f *File) Attr(ctx context.Context, a *fuse.Attr) (err error)
- func (f *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error)
- func (f *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp *fuse.GetxattrResponse) error
- func (f *File) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse) error
- func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fh fusefs.Handle, err error)
- func (f *File) Removexattr(ctx context.Context, req *fuse.RemovexattrRequest) error
- func (f *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error)
- func (f *File) Setxattr(ctx context.Context, req *fuse.SetxattrRequest) error
- type FileHandle
- func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) (err error)
- func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) (err error)
- func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error)
- func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UmountByDevice ¶
func UmountByMountPoint ¶
Types ¶
type Dir ¶
Dir represents a directory entry
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) Link ¶
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) Mknod ¶
Mknod is called to create a file. Since we define create this will be called in preference, however NFS likes to call it for some reason. We don't actually create a file here just the Node.
func (*Dir) ReadDirAll ¶
ReadDirAll reads the contents of the directory
func (*Dir) Remove ¶
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) 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 File ¶
File represents a file
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.Context, req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse) error
Listxattr lists the extended attributes recorded for the node.
func (*File) Open ¶
func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fh fusefs.Handle, err error)
Open the file for read or write
func (*File) Removexattr ¶
Removexattr removes an extended attribute for the name.
If there is no xattr by that name, returns fuse.ErrNoXattr.
func (*File) Setattr ¶
func (f *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error)
Setattr handles attribute changes from FUSE. Currently supports ModTime and Size only
type FileHandle ¶
FileHandle is an open for read file handle on a File
func (*FileHandle) Flush ¶
func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) (err error)
Flush is called on each close() of a file descriptor. So if a filesystem wants to return write errors in close() and the file has cached dirty data, this is a good place to write back data and return any errors. Since many applications ignore close() errors this is not always useful.
NOTE: The flush() method may be called more than once for each open(). This happens if more than one file descriptor refers to an opened file due to dup(), dup2() or fork() calls. It is not possible to determine if a flush is final, so each flush should be treated equally. Multiple write-flush sequences are relatively rare, so this shouldn't be a problem.
Filesystems shouldn't assume that flush will always be called after some writes, or that if will be called at all.
func (*FileHandle) Read ¶
func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) (err error)
Read from the file handle
func (*FileHandle) Release ¶
func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error)
Release is called when we are finished with the file handle
It isn't called directly from userspace so the error is ignored by the kernel
func (*FileHandle) Write ¶
func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) (err error)
Write data to the file handle