aboutsummaryrefslogtreecommitdiffstats
path: root/swarm
diff options
context:
space:
mode:
Diffstat (limited to 'swarm')
-rw-r--r--swarm/api/act.go2
-rw-r--r--swarm/api/api.go8
-rw-r--r--swarm/fuse/swarmfs.go8
-rw-r--r--swarm/fuse/swarmfs_unix.go2
-rw-r--r--swarm/network/stream/peer.go16
-rw-r--r--swarm/storage/ldbstore_test.go8
-rw-r--r--swarm/swarm.go2
7 files changed, 23 insertions, 23 deletions
diff --git a/swarm/api/act.go b/swarm/api/act.go
index 9566720b0..a79f1944b 100644
--- a/swarm/api/act.go
+++ b/swarm/api/act.go
@@ -33,7 +33,7 @@ var (
}
)
-const EMPTY_CREDENTIALS = ""
+const EmptyCredentials = ""
type AccessEntry struct {
Type AccessType
diff --git a/swarm/api/api.go b/swarm/api/api.go
index c6ca1b577..86c111923 100644
--- a/swarm/api/api.go
+++ b/swarm/api/api.go
@@ -431,7 +431,7 @@ func (a *API) Delete(ctx context.Context, addr string, path string) (storage.Add
apiDeleteFail.Inc(1)
return nil, err
}
- key, err := a.ResolveURI(ctx, uri, EMPTY_CREDENTIALS)
+ key, err := a.ResolveURI(ctx, uri, EmptyCredentials)
if err != nil {
return nil, err
@@ -643,7 +643,7 @@ func (a *API) AddFile(ctx context.Context, mhash, path, fname string, content []
apiAddFileFail.Inc(1)
return nil, "", err
}
- mkey, err := a.ResolveURI(ctx, uri, EMPTY_CREDENTIALS)
+ mkey, err := a.ResolveURI(ctx, uri, EmptyCredentials)
if err != nil {
apiAddFileFail.Inc(1)
return nil, "", err
@@ -760,7 +760,7 @@ func (a *API) RemoveFile(ctx context.Context, mhash string, path string, fname s
apiRmFileFail.Inc(1)
return "", err
}
- mkey, err := a.ResolveURI(ctx, uri, EMPTY_CREDENTIALS)
+ mkey, err := a.ResolveURI(ctx, uri, EmptyCredentials)
if err != nil {
apiRmFileFail.Inc(1)
return "", err
@@ -827,7 +827,7 @@ func (a *API) AppendFile(ctx context.Context, mhash, path, fname string, existin
apiAppendFileFail.Inc(1)
return nil, "", err
}
- mkey, err := a.ResolveURI(ctx, uri, EMPTY_CREDENTIALS)
+ mkey, err := a.ResolveURI(ctx, uri, EmptyCredentials)
if err != nil {
apiAppendFileFail.Inc(1)
return nil, "", err
diff --git a/swarm/fuse/swarmfs.go b/swarm/fuse/swarmfs.go
index c7aa983b7..db6aefb54 100644
--- a/swarm/fuse/swarmfs.go
+++ b/swarm/fuse/swarmfs.go
@@ -24,10 +24,10 @@ import (
)
const (
- Swarmfs_Version = "0.1"
- mountTimeout = time.Second * 5
- unmountTimeout = time.Second * 10
- maxFuseMounts = 5
+ SwarmFSVersion = "0.1"
+ mountTimeout = time.Second * 5
+ unmountTimeout = time.Second * 10
+ maxFUSEMounts = 5
)
var (
diff --git a/swarm/fuse/swarmfs_unix.go b/swarm/fuse/swarmfs_unix.go
index 9ff55cc32..54b879a4d 100644
--- a/swarm/fuse/swarmfs_unix.go
+++ b/swarm/fuse/swarmfs_unix.go
@@ -96,7 +96,7 @@ func (swarmfs *SwarmFS) Mount(mhash, mountpoint string) (*MountInfo, error) {
noOfActiveMounts := len(swarmfs.activeMounts)
log.Debug("swarmfs mount", "# active mounts", noOfActiveMounts)
- if noOfActiveMounts >= maxFuseMounts {
+ if noOfActiveMounts >= maxFUSEMounts {
return nil, errMaxMountCount
}
diff --git a/swarm/network/stream/peer.go b/swarm/network/stream/peer.go
index c59799e08..1d3868a66 100644
--- a/swarm/network/stream/peer.go
+++ b/swarm/network/stream/peer.go
@@ -101,20 +101,20 @@ func NewPeer(peer *protocols.Peer, streamer *Registry) *Peer {
for {
select {
case <-ticker.C:
- var len_maxi int
- var cap_maxi int
+ var lenMaxi int
+ var capMaxi int
for k := range pq.Queues {
- if len_maxi < len(pq.Queues[k]) {
- len_maxi = len(pq.Queues[k])
+ if lenMaxi < len(pq.Queues[k]) {
+ lenMaxi = len(pq.Queues[k])
}
- if cap_maxi < cap(pq.Queues[k]) {
- cap_maxi = cap(pq.Queues[k])
+ if capMaxi < cap(pq.Queues[k]) {
+ capMaxi = cap(pq.Queues[k])
}
}
- metrics.GetOrRegisterGauge(fmt.Sprintf("pq_len_%s", p.ID().TerminalString()), nil).Update(int64(len_maxi))
- metrics.GetOrRegisterGauge(fmt.Sprintf("pq_cap_%s", p.ID().TerminalString()), nil).Update(int64(cap_maxi))
+ metrics.GetOrRegisterGauge(fmt.Sprintf("pq_len_%s", p.ID().TerminalString()), nil).Update(int64(lenMaxi))
+ metrics.GetOrRegisterGauge(fmt.Sprintf("pq_cap_%s", p.ID().TerminalString()), nil).Update(int64(capMaxi))
case <-p.quit:
return
}
diff --git a/swarm/storage/ldbstore_test.go b/swarm/storage/ldbstore_test.go
index 9e7aba545..65b72acec 100644
--- a/swarm/storage/ldbstore_test.go
+++ b/swarm/storage/ldbstore_test.go
@@ -193,7 +193,7 @@ func testIterator(t *testing.T, mock bool) {
var i int
var poc uint
chunkkeys := NewAddressCollection(chunkcount)
- chunkkeys_results := NewAddressCollection(chunkcount)
+ chunkkeysResults := NewAddressCollection(chunkcount)
db, cleanup, err := newTestDbStore(mock, false)
defer cleanup()
@@ -218,7 +218,7 @@ func testIterator(t *testing.T, mock bool) {
for poc = 0; poc <= 255; poc++ {
err := db.SyncIterator(0, uint64(chunkkeys.Len()), uint8(poc), func(k Address, n uint64) bool {
log.Trace(fmt.Sprintf("Got key %v number %d poc %d", k, n, uint8(poc)))
- chunkkeys_results[n] = k
+ chunkkeysResults[n] = k
i++
return true
})
@@ -228,8 +228,8 @@ func testIterator(t *testing.T, mock bool) {
}
for i = 0; i < chunkcount; i++ {
- if !bytes.Equal(chunkkeys[i], chunkkeys_results[i]) {
- t.Fatalf("Chunk put #%d key '%v' does not match iterator's key '%v'", i, chunkkeys[i], chunkkeys_results[i])
+ if !bytes.Equal(chunkkeys[i], chunkkeysResults[i]) {
+ t.Fatalf("Chunk put #%d key '%v' does not match iterator's key '%v'", i, chunkkeys[i], chunkkeysResults[i])
}
}
diff --git a/swarm/swarm.go b/swarm/swarm.go
index 651ad97c7..b4b08c5c5 100644
--- a/swarm/swarm.go
+++ b/swarm/swarm.go
@@ -508,7 +508,7 @@ func (s *Swarm) APIs() []rpc.API {
},
{
Namespace: "swarmfs",
- Version: fuse.Swarmfs_Version,
+ Version: fuse.SwarmFSVersion,
Service: s.sfs,
Public: false,
},