Documentation
¶
Index ¶
- func Mount(f fs.Fs, mountpoint string) error
- type Dir
- func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) error
- func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fusefs.Node, fusefs.Handle, 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) (fusefs.Node, error)
- func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error)
- func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) error
- func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDir fusefs.Node) error
- type DirEntry
- type FS
- type File
- type ReadFileHandle
- type WriteFileHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir represents a directory entry
func (*Dir) Create ¶
func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fusefs.Node, fusefs.Handle, error)
Create makes a new file
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) ReadDirAll ¶
ReadDirAll reads the contents of the directory
type DirEntry ¶
type DirEntry struct {
// contains filtered or unexported fields
}
DirEntry describes the contents of a directory entry
It can be a file or a directory ¶
node may be nil, but o may not
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS represents the top level filing system
func (*FS) Statfs ¶
func (f *FS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error
Statfs is called to obtain file system metadata. It should write that data to resp.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents a file
type ReadFileHandle ¶
type ReadFileHandle struct {
// contains filtered or unexported fields
}
ReadFileHandle is an open for read file handle on a File
func (*ReadFileHandle) Flush ¶
func (fh *ReadFileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error
Flush is called each time the file or directory is closed. Because there can be multiple file descriptors referring to a single opened file, Flush can be called multiple times.
func (*ReadFileHandle) Read ¶
func (fh *ReadFileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error
Read from the file handle
func (*ReadFileHandle) Release ¶
func (fh *ReadFileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) 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
type WriteFileHandle ¶
type WriteFileHandle struct {
// contains filtered or unexported fields
}
WriteFileHandle is an open for write handle on a File
func (*WriteFileHandle) Flush ¶
func (fh *WriteFileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) 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 (*WriteFileHandle) Release ¶
func (fh *WriteFileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) 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 (*WriteFileHandle) Write ¶
func (fh *WriteFileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error
Write data to the file handle