kubo/fuse/readonly/mount_unix.go
2022-10-06 10:18:40 -04:00

22 lines
567 B
Go

//go:build (linux || darwin || freebsd) && !nofuse
// +build linux darwin freebsd
// +build !nofuse
package readonly
import (
core "github.com/ipfs/kubo/core"
mount "github.com/ipfs/kubo/fuse/mount"
)
// Mount mounts IPFS at a given location, and returns a mount.Mount instance.
func Mount(ipfs *core.IpfsNode, mountpoint string) (mount.Mount, error) {
cfg, err := ipfs.Repo.Config()
if err != nil {
return nil, err
}
allowOther := cfg.Mounts.FuseAllowOther
fsys := NewFileSystem(ipfs)
return mount.NewMount(ipfs.Process, fsys, mountpoint, allowOther)
}