Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface {
// Mount starts the FUSE filesystem. Blocks until unmount.
// onReady is called once the kernel mount is confirmed live.
Mount(ctx context.Context, onReady func()) error
// Unmount gracefully unmounts the filesystem.
Unmount() error
// ForceUnmount attempts platform-specific force unmount.
ForceUnmount() error
// Type returns the backend type.
Type() Type
}
Backend abstracts FUSE mount/unmount operations.
type Config ¶
type Config struct {
MountPoint string
NzbFs *nzbfilesystem.NzbFilesystem
FuseConfig config.FuseConfig
StreamTracker StreamTracker
UID uint32
GID uint32
}
Config holds parameters common to all backends.
type Refresher ¶
type Refresher interface {
RefreshDirectory(name string)
}
Refresher is optionally implemented by backends that support kernel cache invalidation (e.g. hanwen via NotifyContent/NotifyEntry).
type StreamTracker ¶
type StreamTracker interface {
AddStream(filePath, source, userName, clientIP, userAgent string, totalSize int64) *nzbfilesystem.ActiveStream
UpdateProgress(id string, bytesRead int64)
Remove(id string)
}
StreamTracker is the subset of stream tracking needed by FUSE backends.
type Type ¶
type Type string
Type identifies a FUSE backend implementation.
func DefaultType ¶
func DefaultType() Type
DefaultType returns the platform-default backend type. Linux uses hanwen (pure Go). macOS uses cgo (Fuse-T). Windows FUSE support via WinFsp requires a native Windows build; cross-compiled Windows binaries default to cgo but FUSE mounting is not supported without WinFsp. Override with ALTMOUNT_FUSE_BACKEND env var (checked by caller).