Files
cgofuse/fuse/package.go
Matheus Sampaio Queiroga 9a774478a2
All checks were successful
Fuse test / go-test (push) Successful in 32s
Merge winfsp to fuse and update fs
Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
2025-08-18 19:07:05 -03:00

40 lines
1.7 KiB
Go

// Package fuse allows the creation of user mode file systems in Go.
//
// This packages supports both FUSE2 and FUSE3 on Linux and FreeBSD FUSE2 MacOS, NetBSD and OpenBSD.
// By default, cgofuse will link with FUSE2. To link with FUSE3, simply add '-tags=fuse3'
// to your 'go build' flags.
//
// A user mode file system is a user mode process that receives file system operations
// from the OS FUSE layer and satisfies them in user mode. A user mode file system
// implements the interface FileSystemInterface either directly or by embedding a
// FileSystemBase struct which provides a default (empty) implementation of all methods
// in FileSystemInterface.
//
// In order to expose the user mode file system to the OS, the file system must be hosted
// (mounted) by a FileSystemHost. The FileSystemHost Mount() method is used for this
// purpose.
//
// A note on thread-safety: In general FUSE file systems are expected to protect their
// own data structures. Many FUSE implementations provide a -s command line option that
// when used, it instructs the FUSE implementation to serialize requests. This option
// can be passed to the FileSystemHost Mount() method, when the file system is mounted.
//
// package fuse is the native binding API for WinFSP if build is windows.
//
// It's API definition conforms to the descriptions in
// https://github.com/winfsp/winfsp/wiki/WinFsp-API-winfsp.h,
// while we invoke the API in a DLLProc+NonCGO manner.
//
// The API interfaces are only usable on windows, since
// they refers to the native API on winfsp.dll.
package fuse
type FuseDriver uint8 // Fuse driver used in build stage
const (
None FuseDriver = iota
Winfsp
Fuse2
Fuse3
)