-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Core API refinements and efficiency improvements #3493
Conversation
core/coreapi/interface/interface.go
Outdated
// ID() CoreID | ||
// Version() CoreVersion | ||
// } | ||
type Ref interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I object to such type for API methods parameters. See my comment in #3490 .
blocked on #3490 |
7241c02
to
c6dc74b
Compare
@lgierth progress here? I think its probably safe to move this to the 0.4.7 milestone for now? |
Yes good to move, it needs the two changes we discussed but which I haven't posted here yet (will dig them up). |
@lgierth any progress here since last update? |
will take care of this first thing in the docs sprint, so we can get it into 0.4.8 |
c6dc74b
to
963a812
Compare
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
The new coreiface.Path maps a path to the cid.Cid resulting from a full path resolution. The path is internally represented as a go-ipfs/path.Path, but that doesn't matter to the outside. Apart from the path-to-CID mapping, it also aims to hold all resolved segment CIDs of the path. Right now it only exposes Root(), and only for flat paths a la /ipfs/Qmfoo. In other cases, the root is nil. In the future, resolution will internally use go-ipfs/path.Resolver.ResolvePathComponents and thus always return the proper resolved segments, via Root(), or a future Segments() func. - Add coreiface.Path with Cid() and Root(). - Add CoreAPI.ResolvePath() for getting a coreiface.Path. - All functions now expect and return coreiface.Path. - Add ParsePath() and ParseCid() for constructing a coreiface.Path. - Add coreiface.Node and Link which are simply go-ipld-node.Node and Link. - Add CoreAPI.ResolveNode() for getting a Node from a Path. License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
963a812
to
ee45b8d
Compare
coreapi: make the interfaces path centric The new coreiface.Path maps a path to the cid.Cid The path is internally represented as a go-ipfs/path.Path, Apart from the path-to-CID mapping, it also aims to hold all In the future, resolution will internally use
|
Add(context.Context, io.Reader) (*cid.Cid, error) | ||
Cat(context.Context, string) (Reader, error) | ||
Ls(context.Context, string) ([]*Link, error) | ||
Add(context.Context, io.Reader) (Path, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm... this one feels weird. I like that Cat
takes a path and returns a reader, and that Add
is the inverse operation, but it just feels weird that Add
returns a path...
I think i'll get over it. The Path
in question can be thought of as /ipfs/Cid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, thanks @lgierth :)
We're this much closer to having the gateway extracted!
cc @hsanjuan @keks @kevina @Kubuxu
Closes #3490
commit e1c190a
Author: Lars Gierth larsg@systemli.org
Date: Wed Nov 16 06:21:15 2016 +0100
commit 2e15ba9
Author: Lars Gierth larsg@systemli.org
Date: Fri Dec 9 16:35:28 2016 +0100
commit 7241c02
Author: Lars Gierth larsg@systemli.org
Date: Fri Dec 9 16:49:24 2016 +0100