1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00
Files
kubo/fuse/readonly/mount_unix.go
Jeromy ab0c668ab8 fix panic caused by accessing config after repo closed
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-03 09:28:36 -07:00

21 lines
526 B
Go

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