Documentation ¶
Index ¶
- func Serve(c *fuse.Conn, fs FS) error
- type FS
- type FSDestroyer
- type FSIniter
- type FSStatfser
- type Handle
- type HandleFlusher
- type HandleReadAller
- type HandleReadDirer
- type HandleReader
- type HandleReleaser
- type HandleWriteAller
- type HandleWriter
- type Intr
- type Node
- type NodeAccesser
- type NodeCreater
- type NodeForgetter
- type NodeFsyncer
- type NodeGetattrer
- type NodeLinker
- type NodeMkdirer
- type NodeMknoder
- type NodeOpener
- type NodeReadlinker
- type NodeRemover
- type NodeRenamer
- type NodeRequestLookuper
- type NodeSetattrer
- type NodeStringLookuper
- type NodeSymlinker
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FS ¶
type FS interface { // Root is called to obtain the Node for the file system root. Root() (Node, fuse.Error) }
An FS is the interface required of a file system.
Other FUSE requests can be handled by implementing methods from the FS* interfaces, for example FSIniter.
type FSDestroyer ¶
type FSDestroyer interface {
// Destroy is called when the file system is shutting down.
Destroy()
}
type FSIniter ¶
type FSIniter interface { // Init is called to initialize the FUSE connection. // It can inspect the request and adjust the response as desired. // The default response sets MaxReadahead to 0 and MaxWrite to 4096. // Init must return promptly. Init(*fuse.InitRequest, *fuse.InitResponse, Intr) fuse.Error }
type FSStatfser ¶
type FSStatfser interface { // Statfs is called to obtain file system metadata. // It should write that data to resp. Statfs(*fuse.StatfsRequest, *fuse.StatfsResponse, Intr) fuse.Error }
type Handle ¶
type Handle interface { }
A Handle is the interface required of an opened file or directory. See the documentation for type FS for general information pertaining to all methods.
Other FUSE requests can be handled by implementing methods from the Node* interfaces. The most common to implement are HandleReader, HandleReadDirer, and HandleWriter.
TODO implement methods: Getlk, Setlk, Setlkw
func DataHandle ¶
DataHandle returns a read-only Handle that satisfies reads using the given data.
type HandleFlusher ¶
type HandleFlusher interface { // 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. Flush(*fuse.FlushRequest, Intr) fuse.Error }
type HandleReader ¶
type HandleReader interface {
Read(*fuse.ReadRequest, *fuse.ReadResponse, Intr) fuse.Error
}
type HandleReleaser ¶
type HandleReleaser interface {
Release(*fuse.ReleaseRequest, Intr) fuse.Error
}
type HandleWriter ¶
type HandleWriter interface {
Write(*fuse.WriteRequest, *fuse.WriteResponse, Intr) fuse.Error
}
type Intr ¶
type Intr chan struct{}
An Intr is a channel that signals that a request has been interrupted. Being able to receive from the channel means the request has been interrupted.
type Node ¶
A Node is the interface required of a file or directory. See the documentation for type FS for general information pertaining to all methods.
Other FUSE requests can be handled by implementing methods from the Node* interfaces, for example NodeOpener.
TODO implement methods ¶
Getxattr obtains an extended attribute for the receiver. XXX
Listxattr lists the extended attributes recorded for the receiver.
Removexattr removes an extended attribute from the receiver.
Setxattr sets an extended attribute for the receiver.
type NodeAccesser ¶
type NodeAccesser interface { // Access checks whether the calling context has permission for // the given operations on the receiver. If so, Access should // return nil. If not, Access should return EPERM. // // Note that this call affects the result of the access(2) system // call but not the open(2) system call. If Access is not // implemented, the Node behaves as if it always returns nil // (permission granted), relying on checks in Open instead. Access(*fuse.AccessRequest, Intr) fuse.Error }
type NodeCreater ¶
type NodeCreater interface { // Create creates a new directory entry in the receiver, which // must be a directory. Create(*fuse.CreateRequest, *fuse.CreateResponse, Intr) (Node, Handle, fuse.Error) }
type NodeForgetter ¶
type NodeForgetter interface {
Forget()
}
type NodeFsyncer ¶
type NodeFsyncer interface {
Fsync(r *fuse.FsyncRequest, intr Intr) fuse.Error
}
TODO this should be on Handle not Node
type NodeGetattrer ¶
type NodeGetattrer interface { // Getattr obtains the standard metadata for the receiver. // It should store that metadata in resp. // // If this method is not implemented, the attributes will be // generated based on Attr(), with zero values filled in. Getattr(*fuse.GetattrRequest, *fuse.GetattrResponse, Intr) fuse.Error }
type NodeLinker ¶
type NodeMkdirer ¶
type NodeMknoder ¶
type NodeOpener ¶
type NodeOpener interface { // Open opens the receiver. // XXX note about access. XXX OpenFlags. // XXX note that the Node may be a file or directory. Open(*fuse.OpenRequest, *fuse.OpenResponse, Intr) (Handle, fuse.Error) }
type NodeReadlinker ¶
type NodeReadlinker interface { // Readlink reads a symbolic link. Readlink(*fuse.ReadlinkRequest, Intr) (string, fuse.Error) }
This optional request will be called only for symbolic link nodes.
type NodeRemover ¶
type NodeRemover interface { // 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). Remove(*fuse.RemoveRequest, Intr) fuse.Error }
type NodeRenamer ¶
type NodeRequestLookuper ¶
type NodeRequestLookuper interface { // Lookup looks up a specific entry in the receiver. // See NodeStringLookuper for more. Lookup(*fuse.LookupRequest, *fuse.LookupResponse, Intr) (Node, fuse.Error) }
type NodeSetattrer ¶
type NodeSetattrer interface { // Setattr sets the standard metadata for the receiver. Setattr(*fuse.SetattrRequest, *fuse.SetattrResponse, Intr) fuse.Error }
type NodeStringLookuper ¶
type NodeStringLookuper interface { // Lookup looks up a specific entry in the receiver, // which must be a directory. Lookup should return a Node // corresponding to the entry. If the name does not exist in // the directory, Lookup should return nil, err. // // Lookup need not to handle the names "." and "..". Lookup(string, Intr) (Node, fuse.Error) }
type NodeSymlinker ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
A Tree implements a basic read-only directory tree for FUSE. The Nodes contained in it may still be writable.