fsrepo: Refactor to extract datastore internals

License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
This commit is contained in:
Tommi Virtanen 2015-05-20 08:50:36 -07:00 committed by Jeromy
parent bc9ceab87e
commit efe932a2f2

4
dht.go
View File

@ -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()