Skip to content

Commit

Permalink
dag: move GetMany from DAGService to NodeGetter
Browse files Browse the repository at this point in the history
This will allow many consumers of `DAGService` to take `NodeGetter` instead and
implementing `GetMany` for all `NodeGetter`s is pretty trivial.
  • Loading branch information
Stebalien committed Aug 17, 2017
1 parent 8a8e458 commit 617ad76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions merkledag.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type NodeGetter interface {
// machine; consider setting a deadline in the context.
Get(context.Context, *cid.Cid) (Node, error)

// GetMany returns a channel of NodeOptions given a set of CIDs.
GetMany(context.Context, []*cid.Cid) <-chan *NodeOption

// TODO(ipfs/go-ipfs#4009): Remove this method after fixing.

// OfflineNodeGetter returns an version of this NodeGetter that will
Expand Down Expand Up @@ -70,9 +73,6 @@ type DAGService interface {
// If the node is not in this DAG, Remove returns ErrNotFound.
Remove(*cid.Cid) error

// GetMany returns a channel of NodeOptions given a set of CIDs.
GetMany(context.Context, []*cid.Cid) <-chan *NodeOption

// AddMany adds many nodes to this DAG.
//
// Consider using NewBatch instead of calling this directly if you need
Expand Down

0 comments on commit 617ad76

Please sign in to comment.