swarm/api: improve FUSE build constraints, logging and APIs (#3818)
* swarm/api: fix build/tests on unsupported platforms Skip FUSE tests if FUSE is unavailable and change build constraints so the 'lesser' platforms aren't mentioned explicitly. The test are compiled on all platforms to prevent regressions in _fallback.go Also gofmt -w -s because why not. * internal/web3ext: fix swarmfs wrappers Remove inputFormatter specifications so users get an error when passing the wrong number of arguments. * swarm/api: improve FUSE-related logging and APIs The API now returns JSON objects instead of strings. Log messages for invalid arguments are removed.
This commit is contained in:
@@ -17,25 +17,22 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"time"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
Swarmfs_Version = "0.1"
|
||||
mountTimeout = time.Second * 5
|
||||
maxFuseMounts = 5
|
||||
mountTimeout = time.Second * 5
|
||||
maxFuseMounts = 5
|
||||
)
|
||||
|
||||
|
||||
type SwarmFS struct {
|
||||
swarmApi *Api
|
||||
activeMounts map[string]*MountInfo
|
||||
activeLock *sync.RWMutex
|
||||
}
|
||||
|
||||
|
||||
|
||||
func NewSwarmFS(api *Api) *SwarmFS {
|
||||
swarmfs := &SwarmFS{
|
||||
swarmApi: api,
|
||||
@@ -44,5 +41,3 @@ func NewSwarmFS(api *Api) *SwarmFS {
|
||||
}
|
||||
return swarmfs
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user