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

First pass implementation #1

Merged
merged 32 commits into from
Jul 4, 2023
Merged

First pass implementation #1

merged 32 commits into from
Jul 4, 2023

Conversation

Jake-Shadle
Copy link
Member

This is a first pass implementation of the crate. It mostly does the same thing (including copied code for the metadata structures) as crates-index, with some notable differences.

  • IndexCache is allows R/W access to the metadata cache entries located in registry/index/<dir>/.cache. All methods are public, and is used by the registry specific implementations.
  • SparseIndex and GitIndex build on top of IndexCache with registry specific functionality. Notably neither of them do any network I/O on their own, and thus are always available.
  • git feature adds the RemoteGitIndex type which uses gix to allow both remote fetch/clone operations for a local index, as well as the ability to read git blobs to populate the local .cache
  • sparse feature adds the Async/RemoteSparseIndex types which are backed by reqwest for making requests and handling responses for remote HTTP sparse index servers
  • The functionality for determining the local paths for a registry index the same way that cargo does is publicly exposed so that end users can use it without potentially needing to duplicate the same logic.

Initial implementation includes:

- Reading/writing cache entries
- Sans (network) I/O SparseIndex
- Reqwest backed Async/RemoteSparseIndex
- Sans (network) I/O GitIndex
- gix backed RemoteGitIndex
For now, this makes the cache entries written by this library exactly
match those from cargo. The format doesn't change often so this is
probably fine, but if it becomes too tedious in the future can have a
nicer way to validate the cache entries are semantically the same as
this is really only for testing purposes
@Jake-Shadle Jake-Shadle merged commit a42c510 into main Jul 4, 2023
@Jake-Shadle Jake-Shadle deleted the impl branch July 4, 2023 15:19
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.

1 participant