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

Feature Request: 'dag.Copy' function #40

Open
whyrusleeping opened this issue Aug 27, 2018 · 5 comments
Open

Feature Request: 'dag.Copy' function #40

whyrusleeping opened this issue Aug 27, 2018 · 5 comments
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue

Comments

@whyrusleeping
Copy link
Member

Similar to io.Copy, I want a dag.Copy (or ipld.Copy) function that transfers a given graph from a source dagservice to a target dagservice.

@whyrusleeping whyrusleeping added help wanted Seeking public contribution on this issue exp/novice Someone with a little familiarity can pick up labels Aug 27, 2018
@kjzz
Copy link
Contributor

kjzz commented Sep 4, 2018

hello @whyrusleeping , i am interested in this issue.Can u explain more clear about how ipld.Copy use?Thx

@whyrusleeping
Copy link
Member Author

Hey @kjzz, I'm imagining the function signature would look like:

func Copy(from, to DAGService, root *cid.Cid) error

And the function would just recursively load each object from the from dagservice, and write it to the to dagservice.

@warpfork
Copy link
Member

warpfork commented Sep 4, 2018

Something a bit more idempotent might be nice.

func EnsureReplicated(root Cid, at DAGService, from ...DAGService)

?

@whyrusleeping
Copy link
Member Author

@warpfork I think the implementation could be smart, but Copy has better textual semantics (people more easily understand 'copy'). Though maybe theres a middle ground here?

@kjzz
Copy link
Contributor

kjzz commented Sep 5, 2018

hey @whyrusleeping , i have open a pr about the featiure.Can you help me check it if my pr #41 meet the requirements?any question ,please ping me. Thx a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue
Projects
None yet
Development

No branches or pull requests

3 participants