A generic FUSE implementation.
sile-fystem
is a generic FUSE implementation built on top of the afero
API. Every filesystem supporting the afero
API can therefore be used as a backend for this FUSE implementation.
A comprehensive reference of FUSE functions can be found here.
First use go get
to install the latest version of the package.
$ go get github.com/JakWai01/sile-fystem
Next, include sile-fystem
in your application.
import "github.com/JakWai01/sile-fystem"
This code is a reference to the mount_memfs.go
command. It mounts the FUSE using Afero`s MemMapFs as a backend.
logger := logging.NewJSONLogger(5)
serve := filesystem.NewFileSystem(posix.CurrentUid(), posix.CurrentGid(), "/path/to/mountpoint", "", logger, afero.NewMemMapFs(), false)
cfg := &fuse.MountConfig{
ReadOnly: false,
DisableDefaultPermissions: false,
}
mfs, err := fuse.Mount("/path/to/mountpoint", serve, cfg)
if err != nil {
log.Fatalf("Mount: %v", err)
}
if err := mfs.Join(context.Background()); err != nil {
log.Fatalf("Join %v", err)
}
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am "feat: Add something"
) - Push to the branch (
git push origin my-new-feature
) - Create Pull Request
sile-fystem (c) 2022 Jakob Waibel and contributors
SPDX-License-Identifier: AGPL-3.0