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

object put --pin option #4095

Merged
merged 3 commits into from
Aug 12, 2017
Merged

object put --pin option #4095

merged 3 commits into from
Aug 12, 2017

Conversation

magik6k
Copy link
Member

@magik6k magik6k commented Jul 27, 2017

Closes #4092

Based off #4004. The question now is what to do about object patch * commands.

@whyrusleeping
Copy link
Member

@magik6k while you're at it, could you do the same for ipfs dag put ?

@magik6k
Copy link
Member Author

magik6k commented Jul 29, 2017

dag put has --pin, I even linked to that PR here(#4004)

@whyrusleeping
Copy link
Member

facepalm
I'm sorry, carry on. Will review soon.

if dopin {
defer n.Blockstore.PinLock().Unlock()
}

output, err := objectPut(n, input, inputenc, datafieldenc)
Copy link
Member

Choose a reason for hiding this comment

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

could we make objectPut just return a cid? It returns an Object type for some reason that contains a stringed cid and an array of links for some reason. It doesnt ever use the links, seems like we could make this a little cleaner

@whyrusleeping
Copy link
Member

@magik6k one comment about a 'nice to have', then would be good to rebase on latest master to try for greener CI

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@magik6k
Copy link
Member Author

magik6k commented Jul 31, 2017

@whyrusleeping done

},
Marshalers: cmds.MarshalerMap{
cmds.Text: func(res cmds.Response) (io.Reader, error) {
object := res.Output().(*Object)
return strings.NewReader("added " + object.Hash + "\n"), nil
object := res.Output().(*cid.Cid)
Copy link
Member

Choose a reason for hiding this comment

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

We should keep this the same, and wrap the cid in an Object type when calling SetOutput above, otherwise we're changing the API. this is the last nitpick, i promise :)

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@magik6k
Copy link
Member Author

magik6k commented Jul 31, 2017

@whyrusleeping done

@whyrusleeping whyrusleeping merged commit 50bb128 into master Aug 12, 2017
@whyrusleeping whyrusleeping deleted the feat/object-pin branch August 12, 2017 21:32
@mitar
Copy link

mitar commented Aug 13, 2017

Thanks! Awesome!

@magik6k magik6k added this to the Ipfs 0.4.11 milestone Aug 13, 2017
@magik6k magik6k restored the feat/object-pin branch November 27, 2017 03:34
@magik6k magik6k deleted the feat/object-pin branch November 27, 2017 03:48
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