mount_unix.go 456 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 13
// Mount mounts ipns at a given location, and returns a mount.Mount instance.
func Mount(ipfs *core.IpfsNode, ipnsmp, ipfsmp string) (mount.Mount, error) {
	fsys, err := NewFileSystem(ipfs, ipfs.PrivateKey, ipfsmp)
14
	if err != nil {
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
15
		return nil, err
16
	}
Jeromy's avatar
Jeromy committed
17

Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
18
	return mount.NewMount(ipfs, fsys, ipnsmp)
Jeromy's avatar
Jeromy committed
19
}