mount_unix.go 557 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

Jeromy's avatar
Jeromy committed
4 5 6
package ipns

import (
7 8
	core "github.com/ipfs/go-ipfs/core"
	mount "github.com/ipfs/go-ipfs/fuse/mount"
Jeromy's avatar
Jeromy committed
9 10
)

Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
11 12
// Mount mounts ipns at a given location, and returns a mount.Mount instance.
func Mount(ipfs *core.IpfsNode, ipnsmp, ipfsmp string) (mount.Mount, error) {
Ho-Sheng Hsiao's avatar
Ho-Sheng Hsiao committed
13 14 15
	cfg := ipfs.Repo.Config()
	allow_other := cfg.Mounts.FuseAllowOther

16
	fsys, err := NewFileSystem(ipfs, ipfs.PrivateKey, ipfsmp, ipnsmp)
17
	if err != nil {
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
18
		return nil, err
19
	}
Jeromy's avatar
Jeromy committed
20

21
	return mount.NewMount(ipfs.Process(), fsys, ipnsmp, allow_other)
Jeromy's avatar
Jeromy committed
22
}