sile-fystem

module
v0.1.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: AGPL-3.0

README

sile-fystem

A generic FUSE implementation.

Go Reference

Overview

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.

Installation

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"

Usage

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(helpers.CurrentUid(), helpers.CurrentGid(), $YOUR_MOUNTPOINT$, "", logger, afero.NewMemMapFs())

cfg := &fuse.MountConfig{
  ReadOnly:                  false,
  DisableDefaultPermissions: false,
}

mfs, err := fuse.Mount($YOUR_MOUNTPOINT$, serve, cfg)
if err != nil {
  log.Fatalf("Mount: %v", err)
}

if err := mfs.Join(context.Background()); err != nil {
  log.Fatalf("Join %v", err)
}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am "feat: Add something")
  4. Push to the branch (git push origin my-new-feature)
  5. Create Pull Request

License

sile-fystem (c) 2022 Jakob Waibel and contributors

SPDX-License-Identifier: AGPL-3.0

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

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