Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose selector traversal options for SelectiveCar #251

Merged
merged 6 commits into from
Oct 1, 2021

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Oct 1, 2021

Expose Options for NewSelectiveCar() for two new features available in go-ipld-prime:

  1. traversal.LinkVisitOnlyOnce which I've called TraverseLinksOnlyOnce here - defaulting to false
  2. traversal.Budget#LinkBudget which I've called MaxTraversalLinks here - defaulting to disabled

I've gone with the same Options pattern as in v2 and taken @masih's advice here to keep it generic (rather than use SelectiveCarOptions) so the same pattern can be used for the non-selective CAR usage functions. We'll just have to be clear about what options apply to what functions I suppose.

I've put Traverse in both option names for this reason - to try and make it clear that they are for selector traversal. But, in the future we could retire the merkledag Walk use here and replace it with ipld-prime's traversal (but with LinkVisitOnlyOnce enabled by default which would make it equivalent in functionality). So both of these options would make sense for that case too. I'm open to critique of the naming if anyone has stronger opinions.

I also extracted TestRoundtripSelective to the new selectivecar_test.go, but the other two top-level tests in there are new.

options.go Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
selectivecar_test.go Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
@hannahhoward hannahhoward merged commit c93f536 into master Oct 1, 2021
@masih masih deleted the rvagg/selective-traversal-options branch October 4, 2021 10:55
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
Jorropo pushed a commit to ipfs/boxo that referenced this pull request Mar 22, 2023
…l-options

Expose selector traversal options for SelectiveCar

This commit was moved from ipld/go-car@c93f536
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants