-
Notifications
You must be signed in to change notification settings - Fork 124
Conversation
API/dag/README.md
Outdated
- a CID in its String format concatenated with the path to be resolved | ||
- `options` - a object that might contain the following values: | ||
- `stream` - bool - if set to true, it will return a Node.js Readable Stream. | ||
- `pull` - bool - if set to true, it will return a pull-stream. |
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.
@dignifiedquire what is your take on this (options for streaming)? See #121
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 am not a big fan of this, if we want a streaming interface make it multiple methods, i.e.
.ls
callback, no streaming.lsStream
node stream.lsPull
pull stream
or sth like that
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.
Removed comment about JS specific things, section is under JavaScript so makes sense.
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.
@dignifiedquire understood. Right now it is PITA because we have places where 'xStream' is returning a pull-stream, other places where there is an option (really legacy) for buffer: true
and a lot of internals that are pull-streams and the 'external' (ie js-ipfs) is Node.js Streams for the sake of not breaking API.
I would be down to just sit, define a language for this different options (or through options object or through different methods) and then apply as a golden rule throughout all the modules.
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.
yes, we should try unify this api, agreed
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.
Ok, I'll come up with a proposal then based on things we've discussed. I've some cool ideas, I believe :D
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.
here you go #126
src/dag.js
Outdated
@@ -51,7 +51,7 @@ module.exports = (common) => { | |||
} | |||
}) | |||
|
|||
describe('.put', () => { | |||
describe.only('.put', () => { |
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.
please remove
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.
👍
b: [1, 2, 3], | ||
c: { | ||
ca: [5, 6, 7], | ||
cb: 'foo"' |
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.
why the "
?
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.
typo :)
} | ||
|
||
ipfs.dag.get('zdpuAmtur968yprkhG9N5Zxn6MFVoqAWBbhUAkNLJs2UtkTq5/a', errOrLog) | ||
// Returns: |
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.
logs, not returns
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.
👍
Given:
Tasks:
Other:
dag get --localResolve
vsdag resolve
#125