From 617ad76e48b8f56755a9df3ad9825ecd4be98eac Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 17 Aug 2017 13:55:42 -0700 Subject: [PATCH] dag: move GetMany from DAGService to NodeGetter This will allow many consumers of `DAGService` to take `NodeGetter` instead and implementing `GetMany` for all `NodeGetter`s is pretty trivial. --- merkledag.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/merkledag.go b/merkledag.go index ae5e150..17e326c 100644 --- a/merkledag.go +++ b/merkledag.go @@ -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 @@ -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