swarm, cmd: gofmt updates"

This commit is contained in:
Kiel barry 2018-06-07 17:43:27 -07:00
parent 2158dbc10a
commit e802c8a383
6 changed files with 10 additions and 11 deletions

View file

@ -25,9 +25,9 @@ import (
const ( const (
SwarmfsVersion = "0.1" SwarmfsVersion = "0.1"
mountTimeout = time.Second * 5 mountTimeout = time.Second * 5
unmountTimeout = time.Second * 10 unmountTimeout = time.Second * 10
maxFuseMounts = 5 maxFuseMounts = 5
) )
var ( var (
@ -56,7 +56,7 @@ func NewSwarmFS(api *api.API) *SwarmFS {
} }
// NewInode increments the Inode, which needs to be unique. // NewInode increments the Inode, which needs to be unique.
// They are used for caching inside fuse // They are used for caching inside fuse
func NewInode() uint64 { func NewInode() uint64 {
inodeLock.Lock() inodeLock.Lock()

View file

@ -83,8 +83,8 @@ func (d *Depo) HandleUnsyncedKeysMsg(req *unsyncedKeysMsgData, p *peer) error {
} }
// HandleDeliveryRequestMsg 1) serves actual chunks asked by the remote peer // HandleDeliveryRequestMsg 1) serves actual chunks asked by the remote peer
// by pushing to the delivery queue (sync db) of the correct priority // by pushing to the delivery queue (sync db) of the correct priority
// (remote peer is free to reprioritize), 2) the message implies remote peer // (remote peer is free to reprioritize), 2) the message implies remote peer
// wants more, so trigger for 3) new outgoing unsynced keys message is fired. // wants more, so trigger for 3) new outgoing unsynced keys message is fired.
func (d *Depo) HandleDeliveryRequestMsg(req *deliveryRequestMsgData, p *peer) error { func (d *Depo) HandleDeliveryRequestMsg(req *deliveryRequestMsgData, p *peer) error {
deliver := req.Deliver deliver := req.Deliver

View file

@ -223,7 +223,6 @@ func (h *Hive) keepAlive() {
} }
} }
func (h *Hive) Stop() error { func (h *Hive) Stop() error {
// closing toggle channel quits the updateloop // closing toggle channel quits the updateloop
close(h.quit) close(h.quit)

View file

@ -93,7 +93,7 @@ type Node interface {
Drop() Drop()
} }
// New is a public constructor. Addr is the base address of the table // New is a public constructor. Addr is the base address of the table
// and params is KadParams configuration. // and params is KadParams configuration.
func New(addr Address, params *KadParams) *Kademlia { func New(addr Address, params *KadParams) *Kademlia {
buckets := make([][]Node, params.MaxProx+1) buckets := make([][]Node, params.MaxProx+1)

View file

@ -66,7 +66,7 @@ type syncState struct {
synced chan bool // signal that sync stage finished synced chan bool // signal that sync stage finished
} }
// DbAccess is the wrapper of db-s to provide mockable custom // DbAccess is the wrapper of db-s to provide mockable custom
// local chunk store access to syncer. // local chunk store access to syncer.
type DbAccess struct { type DbAccess struct {
db *storage.DbStore db *storage.DbStore

View file

@ -59,7 +59,7 @@ type Params struct {
// serialisable to send with Protocol. // serialisable to send with Protocol.
type Promise interface{} type Promise interface{}
// Protocol is the interface for the peer protocol for testing or external // Protocol is the interface for the peer protocol for testing or external
// alternative payment. // alternative payment.
type Protocol interface { type Protocol interface {
Pay(int, Promise) // units, payment proof Pay(int, Promise) // units, payment proof
@ -112,7 +112,7 @@ func New(local *Params, pm Payment, proto Protocol) (self *Swap, err error) {
return return
} }
// SetRemote is the entry point for setting remote swap profile // SetRemote is the entry point for setting remote swap profile
// (e.g from handshake or other message). // (e.g from handshake or other message).
func (s *Swap) SetRemote(remote *Profile) { func (s *Swap) SetRemote(remote *Profile) {
defer s.lock.Unlock() defer s.lock.Unlock()