fsmount

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: MIT Imports: 9 Imported by: 1

README

Simple FUSE bindings for Go fs.FS

This library is just a wrapper to easily mount fs.FS as a filesystem.

Dependencies:

Usage

Setup FUSE

Windows:

winget install dokan-dev.Dokany

Linux(Ubuntu)

apt install fuse
examples/simple/simple.go
package main

import (
	"os"
	"github.com/binzume/fsmount"
)

func main() {
	mount, _ := fsmount.MountFS("X:", os.DirFS("."), nil)
	defer mount.Close()

	// Block forever
	select {}
}
How to create a writable FS?

See examples/writable/writable.go

go run ./examples/writable testdir R:
type WritableFS interface {
	fs.FS
	OpenWriter(name string, flag int) (io.WriteCloser, error)
	Truncate(name string, size int64) error
}

Other interfaces such as RemoveFS, MkdirFS, RenameFS... are also available.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountFS

func MountFS(mountPoint string, fsys fs.FS, opt *MountOptions) (io.Closer, error)

Types

type MountOptions

type MountOptions struct {
	FuseOption interface{}
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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