kubo/thirdparty
Hector Sanjuan 2bd401c5c6 Feat: Arbitrary-depth recursive pin levels.
This implements #5133 introducing an option to limit how deep we fetch and store
the DAG associated to a recursive pin ("--max-depth"). This feature
comes motivated by the need to fetch and pin partial DAGs in order to do
DAG sharding with IPFS Cluster.

This means that, when pinning something to --max-depth, the DAG will be
fetched only to that depth and not more.

In order to get this, the PR introduces new recursive pin types: "recursive1"
means: the given CID is pinned along with its direct children (maxDepth=1)

"recursive2" means: the given CID is pinned along with its direct children
and its grandchildren.

And so on...

This required introducing "maxDepth" limits to all the functions walking down
DAGs (in merkledag, pin, core/commands, core/coreapi, exchange/reprovide modules).

maxDepth == -1 effectively acts as no-limit, and all these functions behave like
they did before.

In order to facilitate the task, a new CID Set type has been added:
thirdparty/recpinset. This set carries the MaxDepth associated to every Cid.
This allows to shortcut exploring already explored branches just like the original
cid.Set does. It also allows to store the Recursive pinset (and replaces cid.Set).
recpinset should be moved outside to a different repo eventually.

TODO: tests
TODO: refs -r with --max-depth

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-06-21 14:35:42 +02:00
..
assert add False method 2015-01-23 19:06:29 -08:00
dir misc: Fix a few typos 2018-03-30 09:47:22 +02:00
math2 move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -08:00
notifier fix govet warnings 2018-03-22 17:31:22 +01:00
pollEndpoint gx update go-log, sys, go-crypto 2018-06-08 22:36:24 -07:00
recpinset Feat: Arbitrary-depth recursive pin levels. 2018-06-21 14:35:42 +02:00
unit golint util/, thirdparty/ 2015-06-18 10:03:57 +07:00
verifbs gx update go-log, sys, go-crypto 2018-06-08 22:36:24 -07:00
verifcid gx update go-log, sys, go-crypto 2018-06-08 22:36:24 -07:00
README.md Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs 2015-03-31 12:52:25 -07:00

thirdparty consists of Golang packages that contain no go-ipfs dependencies and may be vendored ipfs/go-ipfs at a later date.

packages in under this directory must not import packages under ipfs/go-ipfs that are not also under thirdparty.