fsfuse

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package fsfuse exposes an fs.FS as a FUSE server.

Index

Constants

View Source
const DefaultCacheDur = 356 * 24 * time.Hour

Variables

This section is empty.

Functions

func NewServer added in v0.25.1

func NewServer(fsys fs.FS, opts ...Option) fuse.Server

NewServer returns a fuse.Server for the given fs.FS.

func Unmount added in v0.25.1

func Unmount(mountPath string) error

Unmount the mountPath.

Types

type FS

type FS struct {
	*fuseutil.NotImplementedFileSystem
	// contains filtered or unexported fields
}

func New added in v0.25.1

func New(fsys fs.FS, opts ...Option) *FS

New returns an *FS, with the given Options.

If cacheDur < 0 then the caching will be disabled; if cacheDur == 0 then the default 1 year will be used.

func (*FS) BatchForget

func (f *FS) BatchForget(ctx context.Context, op *fuseops.BatchForgetOp) error

func (*FS) FlushFile added in v0.25.1

func (f *FS) FlushFile(context.Context, *fuseops.FlushFileOp) error

func (*FS) ForgetInode

func (f *FS) ForgetInode(ctx context.Context, op *fuseops.ForgetInodeOp) error

func (*FS) GetInodeAttributes

func (f *FS) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) error

func (*FS) LookUpInode

func (f *FS) LookUpInode(ctx context.Context, op *fuseops.LookUpInodeOp) error

func (*FS) Mount added in v0.25.1

func (f *FS) Mount(ctx context.Context, mountPath string) (MountedFileSystem, error)

Mount the FS on mountPath, with the given Context.

func (*FS) OpenDir

func (f *FS) OpenDir(ctx context.Context, op *fuseops.OpenDirOp) error

func (*FS) OpenFile

func (f *FS) OpenFile(ctx context.Context, op *fuseops.OpenFileOp) error

func (*FS) ReadDir

func (f *FS) ReadDir(ctx context.Context, op *fuseops.ReadDirOp) error

func (*FS) ReadFile

func (f *FS) ReadFile(ctx context.Context, op *fuseops.ReadFileOp) error

func (*FS) ReleaseDirHandle

func (f *FS) ReleaseDirHandle(ctx context.Context, op *fuseops.ReleaseDirHandleOp) error

func (*FS) ReleaseFileHandle

func (f *FS) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseFileHandleOp) error

type MountedFileSystem added in v0.25.1

type MountedFileSystem struct {
	*fuse.MountedFileSystem
	Path string
}

MountedFileSystem wraps a *fuse.MountedFileSystem to store the mount path.

func Mount added in v0.25.1

func Mount(ctx context.Context, f fuse.Server, mountPath string) (MountedFileSystem, error)

Mount the fuse.Server at mountPath.

func (MountedFileSystem) Unmount added in v0.25.1

func (m MountedFileSystem) Unmount(ctx context.Context) error

Unmount the MountedFileSystem, waiting for finish till Context.Deadline.

type Option added in v0.25.1

type Option func(*options)

Option sets an option on options.

func WithCacheDur added in v0.25.1

func WithCacheDur(dur time.Duration) Option

WithCacheDur sets the cache duration for the mount.

func WithGid added in v0.25.1

func WithGid(uid uint32) Option

WithGid sets the gid for the mount.

func WithUid added in v0.25.1

func WithUid(uid uint32) Option

WithUid sets the uid for the mount.

Jump to

Keyboard shortcuts

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