kubo/fuse/ipns/mount_unix.go
Vasily Kolobkov 9f14624026 Build on OpenBSD
License: MIT
Signed-off-by: Vasily Kolobkov <polezaivsani@openmailbox.org>
2016-07-12 13:11:57 +02:00

27 lines
616 B
Go

// +build linux darwin freebsd netbsd openbsd
// +build !nofuse
package ipns
import (
core "github.com/ipfs/go-ipfs/core"
mount "github.com/ipfs/go-ipfs/fuse/mount"
)
// Mount mounts ipns at a given location, and returns a mount.Mount instance.
func Mount(ipfs *core.IpfsNode, ipnsmp, ipfsmp string) (mount.Mount, error) {
cfg, err := ipfs.Repo.Config()
if err != nil {
return nil, err
}
allow_other := cfg.Mounts.FuseAllowOther
fsys, err := NewFileSystem(ipfs, ipfs.PrivateKey, ipfsmp, ipnsmp)
if err != nil {
return nil, err
}
return mount.NewMount(ipfs.Process(), fsys, ipnsmp, allow_other)
}