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

Move index generation functionality to root v2 package #154

Merged
merged 1 commit into from
Jul 13, 2021
Merged

Move index generation functionality to root v2 package #154

merged 1 commit into from
Jul 13, 2021

Conversation

masih
Copy link
Member

@masih masih commented Jul 13, 2021

Move index generation functionality to root, because they read/write CAR
files. This leaves the index package to only contain the index
implementation itself.

Move index.Attach to root while at it following the same logic. Add
TODOs to the implementation of Attach to make it more robust. As is it
could result in corrupt v2 files if offset includes padding since v2
header is not updated in this function.

Add tests to generate index and move existing tests to correspond to the
go file containing generation functionality.

@masih masih requested a review from mvdan July 13, 2021 15:05
Move index generation functionality to root, because they read/write CAR
files. This leaves the `index` package to only contain the index
implementation itself.

Move `index.Attach` to root while at it following the same logic. Add
TODOs to the implementation of Attach to make it more robust. As is it
_could_ result in corrupt v2 files if offset includes padding since v2
header is not updated in this function.

Add tests to generate index and move existing tests to correspond to the
go file containing generation functionality.
Copy link
Contributor

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this means we can now move parts of internalio to the root package. Not for now, though.

@masih
Copy link
Member Author

masih commented Jul 13, 2021

I wonder if this means we can now move parts of internalio to the root package. Not for now, though.

Earlier reviews suggested moving more io utilities to internal: #145

Either works I have no preference. The rule I follow is if it's used in more than one place then move to internal otherwise leave in package that utilises it. What do you think?

@masih masih merged commit e31ad12 into ipld:wip-v2 Jul 13, 2021
@masih masih deleted the mv-idx-gen branch July 13, 2021 15:34
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.

2 participants