mount_unix.go 456 Bytes
Newer Older
1
// +build (linux darwin freebsd) and !nofuse
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
2

Jeromy's avatar
Jeromy committed
3 4 5
package ipns

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

Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
10 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) {
	fsys, err := NewFileSystem(ipfs, ipfs.PrivateKey, ipfsmp)
13
	if err != nil {
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
14
		return nil, err
15
	}
Jeromy's avatar
Jeromy committed
16

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