fuse

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server manages the FUSE mount, delegating to a pluggable backend.

func NewServer

func NewServer(
	mountPoint string,
	nzbfs *nzbfilesystem.NzbFilesystem,
	logger *slog.Logger,
	cfg config.FuseConfig,
	st StreamTracker,
) *Server

NewServer creates a new FUSE server instance.

func (*Server) BackendType

func (s *Server) BackendType() backend.Type

BackendType returns the active backend type.

func (*Server) CleanupMount

func (s *Server) CleanupMount()

CleanupMount checks for and cleans up stale mounts at the mountpoint.

func (*Server) ForceUnmount

func (s *Server) ForceUnmount() error

ForceUnmount attempts to lazy/force unmount the mountpoint using platform-specific commands.

func (*Server) Mount

func (s *Server) Mount(onReady func()) error

Mount mounts the filesystem and starts serving. The onReady callback is called after the kernel mount is confirmed live. This method blocks until the filesystem is unmounted.

func (*Server) RefreshDirectory

func (s *Server) RefreshDirectory(name string)

RefreshDirectory invalidates the kernel cache for a named directory entry. Only works with backends that implement backend.Refresher (e.g. hanwen).

func (*Server) Unmount

func (s *Server) Unmount() error

Unmount gracefully unmounts the filesystem, falling back to force unmount.

func (*Server) ValidateMount

func (s *Server) ValidateMount() (bool, error)

ValidateMount checks if the mount point is responsive by stat-ing the directory with a timeout. Uses an atomic guard to prevent multiple concurrent os.Stat goroutines (which leak when the mount is stuck). If a validation is already in-flight, returns the last cached result.

type StreamTracker

type StreamTracker = backend.StreamTracker

StreamTracker is the subset of stream tracking needed by the FUSE layer. *api.StreamTracker satisfies this interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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