Commit a7e1bf0f authored by vyzo's avatar vyzo
Browse files

call the routing interface BasicRouting, alias to top level type

parent 89aef893
...@@ -35,12 +35,12 @@ type AddrsFactory = bhost.AddrsFactory ...@@ -35,12 +35,12 @@ type AddrsFactory = bhost.AddrsFactory
// NATManagerC is a NATManager constructor. // NATManagerC is a NATManager constructor.
type NATManagerC func(inet.Network) bhost.NATManager type NATManagerC func(inet.Network) bhost.NATManager
type Routing interface { type BasicRouting interface {
routing.ContentRouting routing.ContentRouting
routing.PeerRouting 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 // Config describes a set of settings for a libp2p node
// //
......
...@@ -15,6 +15,9 @@ type Config = config.Config ...@@ -15,6 +15,9 @@ type Config = config.Config
// (`libp2p.New`). // (`libp2p.New`).
type Option = config.Option type Option = config.Option
// BasicRouting is the combination of PeerRouting and ContentRouting
type BasicRouting = config.BasicRouting
// ChainOptions chains multiple options into a single option. // ChainOptions chains multiple options into a single option.
func ChainOptions(opts ...Option) Option { func ChainOptions(opts ...Option) Option {
return func(cfg *Config) error { return func(cfg *Config) error {
......
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"time" "time"
libp2p "github.com/libp2p/go-libp2p" libp2p "github.com/libp2p/go-libp2p"
config "github.com/libp2p/go-libp2p/config"
relay "github.com/libp2p/go-libp2p/p2p/host/relay" relay "github.com/libp2p/go-libp2p/p2p/host/relay"
ggio "github.com/gogo/protobuf/io" ggio "github.com/gogo/protobuf/io"
...@@ -137,7 +136,7 @@ func TestAutoRelay(t *testing.T) { ...@@ -137,7 +136,7 @@ func TestAutoRelay(t *testing.T) {
defer cancel() defer cancel()
mtab := newMockRoutingTable() mtab := newMockRoutingTable()
makeRouting := func(h host.Host) (config.Routing, error) { makeRouting := func(h host.Host) (libp2p.BasicRouting, error) {
mr := newMockRouting(h, mtab) mr := newMockRouting(h, mtab)
return mr, nil return mr, nil
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment