diff --git a/examples/chat-with-mdns/mdns.go b/examples/chat-with-mdns/mdns.go index f80eff337b..178f7c2042 100644 --- a/examples/chat-with-mdns/mdns.go +++ b/examples/chat-with-mdns/mdns.go @@ -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 { @@ -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) } diff --git a/examples/ipfs-camp-2019/06-Pubsub/main.go b/examples/ipfs-camp-2019/06-Pubsub/main.go index a16fe064da..95b83b99f8 100644 --- a/examples/ipfs-camp-2019/06-Pubsub/main.go +++ b/examples/ipfs-camp-2019/06-Pubsub/main.go @@ -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" diff --git a/examples/ipfs-camp-2019/07-Messaging/main.go b/examples/ipfs-camp-2019/07-Messaging/main.go index 20dd2769b5..afa4a70b84 100644 --- a/examples/ipfs-camp-2019/07-Messaging/main.go +++ b/examples/ipfs-camp-2019/07-Messaging/main.go @@ -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" diff --git a/examples/ipfs-camp-2019/08-End/main.go b/examples/ipfs-camp-2019/08-End/main.go index 7674820639..de786d1b35 100644 --- a/examples/ipfs-camp-2019/08-End/main.go +++ b/examples/ipfs-camp-2019/08-End/main.go @@ -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" diff --git a/examples/pubsub/chat/main.go b/examples/pubsub/chat/main.go index 1c7bd7cf17..5e3cd53dd7 100644 --- a/examples/pubsub/chat/main.go +++ b/examples/pubsub/chat/main.go @@ -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. diff --git a/p2p/mdns/mdns.go b/p2p/discovery/mdns/mdns.go similarity index 100% rename from p2p/mdns/mdns.go rename to p2p/discovery/mdns/mdns.go diff --git a/p2p/mdns/mdns_test.go b/p2p/discovery/mdns/mdns_test.go similarity index 100% rename from p2p/mdns/mdns_test.go rename to p2p/discovery/mdns/mdns_test.go diff --git a/p2p/mdns_legacy/mdns.go b/p2p/discovery/mdns_legacy/mdns.go similarity index 98% rename from p2p/mdns_legacy/mdns.go rename to p2p/discovery/mdns_legacy/mdns.go index 1a045366bb..7472aea4af 100644 --- a/p2p/mdns_legacy/mdns.go +++ b/p2p/discovery/mdns_legacy/mdns.go @@ -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" diff --git a/p2p/mdns_legacy/mdns_test.go b/p2p/discovery/mdns_legacy/mdns_test.go similarity index 100% rename from p2p/mdns_legacy/mdns_test.go rename to p2p/discovery/mdns_legacy/mdns_test.go