kubo/fuse/ipns/mount_unix.go
Steven Allen 76b1546211 mount: switch over to the CoreAPI
1. Fix resolution of sharded directories.
2. Slowly kill off users of the IpfsNode object.
2020-03-02 09:22:58 -08:00

33 lines
745 B
Go

// +build linux darwin freebsd netbsd openbsd
// +build !nofuse
package ipns
import (
core "github.com/ipfs/go-ipfs/core"
coreapi "github.com/ipfs/go-ipfs/core/coreapi"
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) {
coreApi, err := coreapi.NewCoreAPI(ipfs)
if err != nil {
return nil, err
}
cfg, err := ipfs.Repo.Config()
if err != nil {
return nil, err
}
allow_other := cfg.Mounts.FuseAllowOther
fsys, err := NewFileSystem(ipfs.Context(), coreApi, ipfsmp, ipnsmp)
if err != nil {
return nil, err
}
return mount.NewMount(ipfs.Process, fsys, ipnsmp, allow_other)
}