mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-23 09:52:08 +08:00

* refactor: remove goprocess The `goprocess` package is no longer needed. It can be replaces by modern `context` and `context.AfterFunc`. * mod tidy * log unmount errors on shutdown * Do not log non-mounted errors on shutdown * Use WaitGroup associated with IPFS node to wait for services to whutdown * Prefer explicit Close to context.ArterFunc * Do not use node-level WaitGroup * Unmount for non-supported platforms * fix return values * test: daemon shuts down gracefully make sure ongoing operations dont block shutdown * test(cli): add TestFUSE * test: smarter RequiresFUSE opportunistically run FUSE tests if env has fusermount and TEST_FUSE was not explicitly set * docs: changelog --------- Co-authored-by: gammazero <gammazero@users.noreply.github.com> Co-authored-by: Marcin Rataj <lidel@lidel.org>
22 lines
583 B
Go
22 lines
583 B
Go
//go:build (linux || darwin || freebsd || netbsd || openbsd) && !nofuse
|
|
// +build linux darwin freebsd netbsd openbsd
|
|
// +build !nofuse
|
|
|
|
package mfs
|
|
|
|
import (
|
|
core "github.com/ipfs/kubo/core"
|
|
mount "github.com/ipfs/kubo/fuse/mount"
|
|
)
|
|
|
|
// Mount mounts MFS 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
|
|
}
|
|
allowOther := cfg.Mounts.FuseAllowOther
|
|
fsys := NewFileSystem(ipfs)
|
|
return mount.NewMount(fsys, mountpoint, allowOther)
|
|
}
|