mount

package
v0.0.0-...-fcec3d2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2017 License: MIT Imports: 16 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 {
	// contains filtered or unexported fields
}

Dir represents a directory entry

func (*Dir) Attr

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

Attr updates the attribes of a directory

func (*Dir) Create

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) Mkdir

func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fusefs.Node, 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) 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) error

Rename the file

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) Root

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

Root returns the root node

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

func (*File) Attr

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

Attr fills out the attributes for the file

func (*File) Open

func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fusefs.Handle, error)

Open the file for read or write

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

Write data to the file handle

Jump to

Keyboard shortcuts

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