mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-25 14:52:14 +00:00
fsrepo: Refactor to extract datastore internals
License: MIT Signed-off-by: Tommi Virtanen <tv@eagain.net>
This commit is contained in:
parent
bc9ceab87e
commit
efe932a2f2
4
dht.go
4
dht.go
@ -44,7 +44,7 @@ type IpfsDHT struct {
|
|||||||
self peer.ID // Local peer (yourself)
|
self peer.ID // Local peer (yourself)
|
||||||
peerstore peer.Peerstore // Peer Registry
|
peerstore peer.Peerstore // Peer Registry
|
||||||
|
|
||||||
datastore ds.ThreadSafeDatastore // Local data
|
datastore ds.Datastore // Local data
|
||||||
|
|
||||||
routingTable *kb.RoutingTable // Array of routing tables for differently distanced nodes
|
routingTable *kb.RoutingTable // Array of routing tables for differently distanced nodes
|
||||||
providers *ProviderManager
|
providers *ProviderManager
|
||||||
@ -60,7 +60,7 @@ type IpfsDHT struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewDHT creates a new DHT object with the given peer as the 'local' host
|
// NewDHT creates a new DHT object with the given peer as the 'local' host
|
||||||
func NewDHT(ctx context.Context, h host.Host, dstore ds.ThreadSafeDatastore) *IpfsDHT {
|
func NewDHT(ctx context.Context, h host.Host, dstore ds.Datastore) *IpfsDHT {
|
||||||
dht := new(IpfsDHT)
|
dht := new(IpfsDHT)
|
||||||
dht.datastore = dstore
|
dht.datastore = dstore
|
||||||
dht.self = h.ID()
|
dht.self = h.ID()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user