-
Notifications
You must be signed in to change notification settings - Fork 124
doc: Documents the offset/length arguments to ipfs.files.cat and friends #242
doc: Documents the offset/length arguments to ipfs.files.cat and friends #242
Conversation
SPEC/FILES.md
Outdated
@@ -161,9 +161,9 @@ pull( | |||
|
|||
##### `Go` **WIP** | |||
|
|||
##### `JavaScript` - ipfs.files.cat(ipfsPath, [callback]) | |||
##### `JavaScript` - ipfs.files.cat(ipfsPath, [begin], [end], [callback]) |
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 args like this? Let's add options
and have that begin and end there.
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.
Fair enough, will change. I've noticed that we have a ipfs.files.read
function that accepts offset
and count
- it might be better to use that instead of begin
and end
to be consistent. What do you think?
Also, I can't find an implementation of that in js-ipfs but it looks like it could just call through to ipfs.files.cat
?
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.
offset and count
👍
ipfs.files.read
This is a MFS specific operation.
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.
offset and count
👍
Done
SPEC/FILES.md
Outdated
@@ -197,9 +199,9 @@ A great source of [examples][] can be found in the tests for this API. | |||
|
|||
##### `Go` **WIP** | |||
|
|||
##### `JavaScript` - ipfs.files.catReadableStream(ipfsPath) -> [Readable Stream][rs] | |||
##### `JavaScript` - ipfs.files.catReadableStream(ipfsPath, [begin], [end]) -> [Readable Stream][rs] |
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.
Same
SPEC/FILES.md
Outdated
@@ -225,9 +230,9 @@ A great source of [examples][] can be found in the tests for this API. | |||
|
|||
##### `Go` **WIP** | |||
|
|||
##### `JavaScript` - ipfs.files.catPullStream(ipfsPath) -> [Pull Stream][rs] | |||
##### `JavaScript` - ipfs.files.catPullStream(ipfsPath, [begin], [end]) -> [Pull Stream][rs] |
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.
Same
f21ef75
to
7fd182e
Compare
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.
@achingbrain This PR is missing tests. The tests need to pass in both js-ipfs and js-ipfs-api. I do understand that go-ipfs doesn't support offset reads in .cat yet, but that can be shimmed in js-ipfs-api until go-ipfs ships that feature.
The go documentation uses |
@diasdavid I was going to move some of the tests from @richardschneider Yes, we'd discussed that on the outdated changes that Github has hidden above. The currently go-only |
7fd182e
to
ffa4f76
Compare
ffa4f76
to
4b39a4f
Compare
After a straw poll in the js-dev catchup it was decided that @diasdavid I've added some tests for stream slices that should only run for js-ipfs. There's quite a lot of scope for test duplication across all these modules, what's the general approach? In depth tests here and 'smoke test' style tests in dependencies? |
Requires ipfs-inactive/js-ipfs-unixfs-engine#207 and ipfs/js-ipfs#1231 to be merged first.