rename p2p/discovery/backoff package, run go mod tidy
This commit is contained in:
parent
d3243b522b
commit
7c0be24a4c
1
go.mod
1
go.mod
|
@ -8,6 +8,7 @@ require (
|
|||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/hashicorp/golang-lru v0.5.4
|
||||
github.com/huin/goupnp v1.0.2 // indirect
|
||||
github.com/ipfs/go-cid v0.0.7
|
||||
github.com/ipfs/go-datastore v0.5.0
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
package discovery
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"math"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
)
|
||||
|
||||
var log = logging.Logger("discovery-backoff")
|
||||
|
||||
type BackoffFactory func() BackoffStrategy
|
||||
|
||||
// BackoffStrategy describes how backoff will be implemented. BackoffStratgies are stateful.
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package discovery
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"math/rand"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
func checkDelay(bkf BackoffStrategy, expected time.Duration, t *testing.T) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package discovery
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package discovery
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package discovery
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
|
||||
"github.com/libp2p/go-libp2p-core/host"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package discovery
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package discovery
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
|
Loading…
Reference in New Issue