Skip to content

Commit

Permalink
move the mdns packages p2p/discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Aug 18, 2021
1 parent 6b1dae0 commit bc695b3
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/chat-with-mdns/mdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
discovery "github.com/libp2p/go-libp2p/p2p/mdns_legacy"
mdns "github.com/libp2p/go-libp2p/p2p/discovery/mdns_legacy"
)

type discoveryNotifee struct {
Expand All @@ -21,7 +21,7 @@ func (n *discoveryNotifee) HandlePeerFound(pi peer.AddrInfo) {
//Initialize the MDNS service
func initMDNS(ctx context.Context, peerhost host.Host, rendezvous string) chan peer.AddrInfo {
// An hour might be a long long period in practical applications. But this is fine for us
ser, err := discovery.NewMdnsService(ctx, peerhost, time.Hour, rendezvous)
ser, err := mdns.NewMdnsService(ctx, peerhost, time.Hour, rendezvous)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ipfs-camp-2019/06-Pubsub/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
mplex "github.com/libp2p/go-libp2p-mplex"
tls "github.com/libp2p/go-libp2p-tls"
yamux "github.com/libp2p/go-libp2p-yamux"
"github.com/libp2p/go-libp2p/p2p/mdns"
"github.com/libp2p/go-libp2p/p2p/discovery/mdns"
"github.com/libp2p/go-tcp-transport"
ws "github.com/libp2p/go-ws-transport"
"github.com/multiformats/go-multiaddr"
Expand Down
2 changes: 1 addition & 1 deletion examples/ipfs-camp-2019/07-Messaging/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
pubsub "github.com/libp2p/go-libp2p-pubsub"
tls "github.com/libp2p/go-libp2p-tls"
yamux "github.com/libp2p/go-libp2p-yamux"
"github.com/libp2p/go-libp2p/p2p/mdns"
"github.com/libp2p/go-libp2p/p2p/discovery/mdns"
"github.com/libp2p/go-tcp-transport"
ws "github.com/libp2p/go-ws-transport"
"github.com/multiformats/go-multiaddr"
Expand Down
2 changes: 1 addition & 1 deletion examples/ipfs-camp-2019/08-End/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
pubsub "github.com/libp2p/go-libp2p-pubsub"
tls "github.com/libp2p/go-libp2p-tls"
yamux "github.com/libp2p/go-libp2p-yamux"
"github.com/libp2p/go-libp2p/p2p/mdns"
"github.com/libp2p/go-libp2p/p2p/discovery/mdns"
"github.com/libp2p/go-tcp-transport"
ws "github.com/libp2p/go-ws-transport"
"github.com/multiformats/go-multiaddr"
Expand Down
6 changes: 2 additions & 4 deletions examples/pubsub/chat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import (
"time"

"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/p2p/mdns"

"github.com/libp2p/go-libp2p-core/host"

"github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/p2p/discovery/mdns"
)

// DiscoveryInterval is how often we re-publish our mDNS records.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
mdnsnew "github.com/libp2p/go-libp2p/p2p/mdns"
mdnsnew "github.com/libp2p/go-libp2p/p2p/discovery/mdns"

logging "github.com/ipfs/go-log/v2"
ma "github.com/multiformats/go-multiaddr"
Expand Down
File renamed without changes.

0 comments on commit bc695b3

Please sign in to comment.