rename p2p/discovery/backoff package, run go mod tidy

This commit is contained in:
Marten Seemann 2022-01-09 21:37:28 +04:00
parent d3243b522b
commit 7c0be24a4c
8 changed files with 16 additions and 9 deletions

1
go.mod
View File

@ -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

View File

@ -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.

View File

@ -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) {

View File

@ -1,4 +1,4 @@
package discovery
package backoff
import (
"context"

View File

@ -1,4 +1,4 @@
package discovery
package backoff
import (
"context"

View File

@ -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"
)

View File

@ -1,4 +1,4 @@
package discovery
package backoff
import (
"context"

View File

@ -1,4 +1,4 @@
package discovery
package backoff
import (
"context"