Cross-platform FUSE library for Go
Cgofuse is a cross-platform FUSE library for Go. It is supported on multiple platforms and can be ported to any platform that has a FUSE implementation. It has cgo and !cgo ("nocgo") variants depending on the platform.
|
Windows
|
macOS
|
Linux
|
FreeBSD
|
NetBSD*
|
OpenBSD*
|
XGO
|
cgo |
✓ |
✓ |
✓ |
✓ |
✓ |
✓ |
✓ |
!cgo |
✓ |
|
|
|
|
|
|
* NetBSD and OpenBSD support is experimental. There are known issues that stem from the differences in the NetBSD librefuse and OpenBSD libfuse implementations from the reference libfuse implementation
How to build
Windows cgo
Windows !cgo
macOS
Linux
FreeBSD
NetBSD
OpenBSD
How to cross-compile your project using xgo
You can easily cross-compile your project using xgo and the billziss/xgo-cgofuse docker image.
- Prerequisites: docker, xgo
- Build:
$ docker pull billziss/xgo-cgofuse
$ go get -u github.com/karalabe/xgo
$ cd YOUR-PROJECT-THAT-USES-CGOFUSE
$ xgo --image=billziss/xgo-cgofuse \
--targets=darwin/386,darwin/amd64,linux/386,linux/amd64,windows/386,windows/amd64 .
Cross-compilation only works for Windows, macOS and Linux.
How to use
User mode file systems are expected to implement fuse.FileSystemInterface
. To make implementation simpler a file system can embed ("inherit") a fuse.FileSystemBase
which provides default implementations for all operations. To mount a file system one must instantiate a fuse.FileSystemHost
using fuse.NewFileSystemHost
.
The full documentation is available at GoDoc.org: package fuse
There are currently three example file systems:
- Hellofs is an extremely simple file system. Runs on all OS'es.
- Memfs is an in memory file system. Runs on all OS'es.
- Passthrough is a file system that passes all operations to the underlying file system. Runs on all OS'es except Windows.
How it is tested
Cgofuse is regularly built and tested on Travis CI, AppVeyor and DockerHub. The following software is being used to test cgofuse.
Windows (cgo and !cgo)
macOS
Linux
FreeBSD
Contributors
- Bill Zissimopoulos <billziss at navimatics.com>
- Nick Craig-Wood <nick at craig-wood.com>
- Fredrik Medley <fredrik.medley at veoneer.com>