probe-lab / zikade

A Go implementation of the libp2p Kademlia DHT specification
Other
8 stars 3 forks source link

Add RoutingDHT struct that implements the routing.Routing interface and embeds the DHT #30

Open iand opened 9 months ago

iand commented 9 months ago

Migrated from https://github.com/libp2p/go-libp2p-kad-dht/issues/929

Given that many are not happy with the routing.Routing interface we could avoid "polluting" the DHT API with the routing.Routing methods. So I propose to do the following:

type RoutingDHT struct {
    *DHT
}

var _ routing.Routing = (*RoutingDHT)(nil)

func NewRoutingDHT(d *DHT) *RoutingDHT {
    return &RoutingDHT{DHT: d}
}

// routing.Routing methods...