mount_unix.go 473 Bytes
Newer Older
Tonis Tiigi's avatar
Tonis Tiigi committed
1 2
// +build linux darwin freebsd
// +build !nofuse
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
3 4 5 6

package readonly

import (
7 8
	core "github.com/ipfs/go-ipfs/core"
	mount "github.com/ipfs/go-ipfs/fuse/mount"
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
9 10 11 12
)

// Mount mounts ipfs at a given location, and returns a mount.Mount instance.
func Mount(ipfs *core.IpfsNode, mountpoint string) (mount.Mount, error) {
Ho-Sheng Hsiao's avatar
Ho-Sheng Hsiao committed
13 14
	cfg := ipfs.Repo.Config()
	allow_other := cfg.Mounts.FuseAllowOther
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
15
	fsys := NewFileSystem(ipfs)
Ho-Sheng Hsiao's avatar
Ho-Sheng Hsiao committed
16
	return mount.NewMount(ipfs, fsys, mountpoint, allow_other)
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
17
}