fuse

package
v0.0.0-...-7f26a56 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	Type       fuse.DirentType
	Attributes fuse.Attr

	// TODO: we must be able to find something better than interface{}, either a proper interface or perhaps a generic type
	// TODO: we likely don't need this: we should always call `materialiseFolder()` because the source of truth is pCloud
	// TODO: contents is subject to changes at anytime, and we should allow the fuse driver to be the judge of whether to
	// TODO: ... refresh the folder or not via fuse.Attr.Validate
	Entries map[string]interface{}
	// contains filtered or unexported fields
}

Dir implements both Node and Handle for the root directory.

func (*Dir) Attr

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

func (*Dir) Lookup

func (d *Dir) Lookup(ctx context.Context, name string) (fs.Node, error)

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 ENOENT.

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

func (*Dir) ReadDirAll

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

type Drive

type Drive struct {
	// contains filtered or unexported fields
}

func NewDrive

func NewDrive(mountpoint string, pcClient *sdk.Client) (*Drive, error)

func (*Drive) Mount

func (d *Drive) Mount() error

func (*Drive) Unmount

func (d *Drive) Unmount() error

type FS

type FS struct {
	// contains filtered or unexported fields
}

FS implements the pCloud file system.

func (*FS) Root

func (fs *FS) Root() (fs.Node, error)

type File

type File struct {
	Type       fuse.DirentType
	Content    []byte
	Attributes fuse.Attr
	// contains filtered or unexported fields
}

File implements both Node and Handle for the hello file.

func (*File) Attr

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

func (*File) Flush

func (f *File) 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 (*File) Open

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

func (*File) Read

func (f *File) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error

func (*File) Release

func (f *File) Release(ctx context.Context, req *fuse.ReleaseRequest) error

A ReleaseRequest asks to release (close) an open file handle.

Jump to

Keyboard shortcuts

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