mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 05:52:20 +08:00
23 lines
539 B
Go
23 lines
539 B
Go
// +build linux darwin freebsd
|
|
// +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 := ipfs.Repo.Config()
|
|
allow_other := cfg.Mounts.FuseAllowOther
|
|
|
|
fsys, err := NewFileSystem(ipfs, ipfs.PrivateKey, ipfsmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return mount.NewMount(ipfs, fsys, ipnsmp, allow_other)
|
|
}
|