From a7e1bf0f15ffad372b07313769af6a542fd2f086 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 22 Oct 2018 21:20:31 +0300 Subject: [PATCH] call the routing interface BasicRouting, alias to top level type --- config/config.go | 4 ++-- libp2p.go | 3 +++ p2p/host/relay/autorelay_test.go | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/config.go b/config/config.go index aa06705c..3d06fdca 100644 --- a/config/config.go +++ b/config/config.go @@ -35,12 +35,12 @@ type AddrsFactory = bhost.AddrsFactory // NATManagerC is a NATManager constructor. type NATManagerC func(inet.Network) bhost.NATManager -type Routing interface { +type BasicRouting interface { routing.ContentRouting routing.PeerRouting } -type RoutingC func(host.Host) (Routing, error) +type RoutingC func(host.Host) (BasicRouting, error) // Config describes a set of settings for a libp2p node // diff --git a/libp2p.go b/libp2p.go index ad026ad4..6c928c31 100644 --- a/libp2p.go +++ b/libp2p.go @@ -15,6 +15,9 @@ type Config = config.Config // (`libp2p.New`). type Option = config.Option +// BasicRouting is the combination of PeerRouting and ContentRouting +type BasicRouting = config.BasicRouting + // ChainOptions chains multiple options into a single option. func ChainOptions(opts ...Option) Option { return func(cfg *Config) error { diff --git a/p2p/host/relay/autorelay_test.go b/p2p/host/relay/autorelay_test.go index 38e7f518..ff4d8507 100644 --- a/p2p/host/relay/autorelay_test.go +++ b/p2p/host/relay/autorelay_test.go @@ -8,7 +8,6 @@ import ( "time" libp2p "github.com/libp2p/go-libp2p" - config "github.com/libp2p/go-libp2p/config" relay "github.com/libp2p/go-libp2p/p2p/host/relay" ggio "github.com/gogo/protobuf/io" @@ -137,7 +136,7 @@ func TestAutoRelay(t *testing.T) { defer cancel() mtab := newMockRoutingTable() - makeRouting := func(h host.Host) (config.Routing, error) { + makeRouting := func(h host.Host) (libp2p.BasicRouting, error) { mr := newMockRouting(h, mtab) return mr, nil }