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

Adding a mirror method #277

Merged
merged 5 commits into from Jun 4, 2020
Merged

Adding a mirror method #277

merged 5 commits into from Jun 4, 2020

Conversation

andrewosh
Copy link
Contributor

Right now download is used to download the latest versions of specific files/directories within a drive. It'd be possible to extend this to support downloading all previous versions of those files/directories as well, but doing so might complicate the usage (i.e. drive.download('/my-directory', { allVersions: true}).

The UX there gets even trickier when considering mounts. What if /my-directory was previously a mount? It can get hard to reason about.

This PR adds a mirror method that does a full sync of a drive's metadata/content at the Hypercore level. It currently syncs all mounts as well, but this can be made configurable in the future.

Any thoughts on introducing an additional method for this behavior?

@andrewosh andrewosh requested a review from mafintosh June 2, 2020 21:08
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@andrewosh andrewosh merged commit 9435cb7 into master Jun 4, 2020
@andrewosh andrewosh deleted the mirroring branch June 4, 2020 16:26
@todrobbins
Copy link
Contributor

“You did it...”

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.

None yet

3 participants