cgofuse

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Rendered for darwin/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend is the cgofuse FUSE backend (macOS via Fuse-T, Windows via WinFsp).

func New

func New(cfg backend.Config) *Backend

New creates a new cgofuse backend.

func (*Backend) ForceUnmount

func (b *Backend) ForceUnmount() error

ForceUnmount attempts platform-specific force unmount.

func (*Backend) Mount

func (b *Backend) Mount(ctx context.Context, onReady func()) error

Mount starts the FUSE filesystem. Blocks until unmount.

func (*Backend) Type

func (b *Backend) Type() backend.Type

Type returns the backend type.

func (*Backend) Unmount

func (b *Backend) Unmount() error

Unmount gracefully unmounts the filesystem.

type FS

type FS struct {
	cgofuse.FileSystemBase
	// contains filtered or unexported fields
}

FS implements cgofuse.FileSystemInterface using NzbFilesystem.

func NewFS

func NewFS(cfg backend.Config, logger *slog.Logger) *FS

NewFS creates a new cgofuse filesystem.

func (*FS) CreateEx

func (f *FS) CreateEx(path string, mode uint32, fi *cgofuse.FileInfo_t) int

CreateEx is a no-op (read-only filesystem). Required by cgofuse.FileSystemOpenEx.

func (*FS) Destroy

func (f *FS) Destroy()

Destroy is called when the filesystem is destroyed.

func (*FS) Flush

func (f *FS) Flush(path string, fh uint64) int

Flush is called on each close of an open file.

func (*FS) Fsync

func (f *FS) Fsync(path string, datasync bool, fh uint64) int

Fsync synchronizes file contents.

func (*FS) Getattr

func (f *FS) Getattr(path string, stat *cgofuse.Stat_t, fh uint64) int

Getattr retrieves file attributes.

func (*FS) Init

func (f *FS) Init()

Init is called when the filesystem is initialized.

func (*FS) Mkdir

func (f *FS) Mkdir(path string, mode uint32) int

Mkdir creates a directory.

func (*FS) Open

func (f *FS) Open(path string, flags int) (int, uint64)

Open opens a file (fallback if OpenEx not used by runtime).

func (*FS) OpenEx

func (f *FS) OpenEx(path string, fi *cgofuse.FileInfo_t) int

OpenEx opens a file with extended flags (cgofuse.FileSystemOpenEx).

func (*FS) Opendir

func (f *FS) Opendir(path string) (int, uint64)

Opendir opens a directory for reading.

func (*FS) Read

func (f *FS) Read(path string, buff []byte, ofst int64, fh uint64) int

Read reads data from an open file using offset-native ReadAtContext. No per-handle lock needed: ReadAtContext serializes internally via mvf.mu.

func (*FS) Readdir

func (f *FS) Readdir(path string, fill func(name string, stat *cgofuse.Stat_t, ofst int64) bool, ofst int64, fh uint64) int

Readdir reads directory entries.

func (*FS) Ready

func (f *FS) Ready() <-chan struct{}

Ready returns a channel that is closed when Init has been called.

func (*FS) Release

func (f *FS) Release(path string, fh uint64) int

Release closes an open file.

func (*FS) Releasedir

func (f *FS) Releasedir(path string, fh uint64) int

Releasedir releases a directory.

func (*FS) Rename

func (f *FS) Rename(oldpath string, newpath string) int

Rename renames a file or directory.

func (*FS) Rmdir

func (f *FS) Rmdir(path string) int

Rmdir removes an empty directory.

func (*FS) Statfs

func (f *FS) Statfs(path string, stat *cgofuse.Statfs_t) int

Statfs returns filesystem statistics.

func (f *FS) Unlink(path string) int

Unlink removes a file.

Jump to

Keyboard shortcuts

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