{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/go-ipld/pulls/comments/55518970","id":55518970,"diff_hunk":"@@ -187,3 +188,91 @@ func LinkCast(v interface{}) (l Link, ok bool) {\n \t}\n \treturn l, true\n }\n+\n+func (n Node) Read(fun stream.ReadFun) error {\n+\terr := read(n, fun, []interface{}{})\n+\tif err == stream.NodeReadAbort {\n+\t\terr = nil\n+\t}\n+\treturn err\n+}\n+\n+func read(curr interface{}, fun stream.ReadFun, path []interface{}) error {","path":"memory/node.go","position":45,"original_position":45,"commit_id":"cabb3634de4d892da239200947097753e367aa59","original_commit_id":"cabb3634de4d892da239200947097753e367aa59","user":{"login":"mildred","id":33804,"avatar_url":"https://avatars.githubusercontent.com/u/33804?v=3","gravatar_id":"","url":"https://api.github.com/users/mildred","html_url":"https://github.com/mildred","followers_url":"https://api.github.com/users/mildred/followers","following_url":"https://api.github.com/users/mildred/following{/other_user}","gists_url":"https://api.github.com/users/mildred/gists{/gist_id}","starred_url":"https://api.github.com/users/mildred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mildred/subscriptions","organizations_url":"https://api.github.com/users/mildred/orgs","repos_url":"https://api.github.com/users/mildred/repos","events_url":"https://api.github.com/users/mildred/events{/privacy}","received_events_url":"https://api.github.com/users/mildred/received_events","type":"User","site_admin":false},"body":"Not much can be changed, it's just going through the datastructure. I could improve the NodeReadSkip lines though","created_at":"2016-03-09T13:45:28Z","updated_at":"2016-03-09T13:45:28Z","html_url":"https://github.com/ipfs/go-ipld/pull/19#discussion_r55518970","pull_request_url":"https://api.github.com/repos/ipfs/go-ipld/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-ipld/pulls/comments/55518970"},"html":{"href":"https://github.com/ipfs/go-ipld/pull/19#discussion_r55518970"},"pull_request":{"href":"https://api.github.com/repos/ipfs/go-ipld/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/ipfs/go-ipld/pulls/19","id":54625512,"html_url":"https://github.com/ipfs/go-ipld/pull/19","diff_url":"https://github.com/ipfs/go-ipld/pull/19.diff","patch_url":"https://github.com/ipfs/go-ipld/pull/19.patch","issue_url":"https://api.github.com/repos/ipfs/go-ipld/issues/19","number":19,"state":"open","locked":false,"title":"Add NodeReader interface","user":{"login":"mildred","id":33804,"avatar_url":"https://avatars.githubusercontent.com/u/33804?v=3","gravatar_id":"","url":"https://api.github.com/users/mildred","html_url":"https://github.com/mildred","followers_url":"https://api.github.com/users/mildred/followers","following_url":"https://api.github.com/users/mildred/following{/other_user}","gists_url":"https://api.github.com/users/mildred/gists{/gist_id}","starred_url":"https://api.github.com/users/mildred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mildred/subscriptions","organizations_url":"https://api.github.com/users/mildred/orgs","repos_url":"https://api.github.com/users/mildred/repos","events_url":"https://api.github.com/users/mildred/events{/privacy}","received_events_url":"https://api.github.com/users/mildred/received_events","type":"User","site_admin":false},"body":"- [x] jbenet/go-multicodec#9: cbor & json: add HeaderPath variable\r\n- [x] whyrusleeping/cbor#3: Allow streaming interface to CBOR\r\n- [x] implement NodeReader for protocol buffers\r\n- [ ] [Check multicodec headers](#discussion_r54835160) **(and update the spec)**\r\n\r\n------------\r\n\r\nSee issue ipfs/go-ipld#17\r\n\r\nDo not merge yet, tests are still needed, and I would like to use this interface in some places instead of the Node type. This will allow implementations that do not require buffering the whole node in memory.","created_at":"2015-12-27T23:08:16Z","updated_at":"2016-03-09T13:45:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e86588fbc57cc9aea7aa4697b9dca815da2188b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/go-ipld/pulls/19/commits","review_comments_url":"https://api.github.com/repos/ipfs/go-ipld/pulls/19/comments","review_comment_url":"https://api.github.com/repos/ipfs/go-ipld/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/go-ipld/issues/19/comments","statuses_url":"https://api.github.com/repos/ipfs/go-ipld/statuses/cabb3634de4d892da239200947097753e367aa59","head":{"label":"mildred:reader","ref":"reader","sha":"cabb3634de4d892da239200947097753e367aa59","user":{"login":"mildred","id":33804,"avatar_url":"https://avatars.githubusercontent.com/u/33804?v=3","gravatar_id":"","url":"https://api.github.com/users/mildred","html_url":"https://github.com/mildred","followers_url":"https://api.github.com/users/mildred/followers","following_url":"https://api.github.com/users/mildred/following{/other_user}","gists_url":"https://api.github.com/users/mildred/gists{/gist_id}","starred_url":"https://api.github.com/users/mildred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mildred/subscriptions","organizations_url":"https://api.github.com/users/mildred/orgs","repos_url":"https://api.github.com/users/mildred/repos","events_url":"https://api.github.com/users/mildred/events{/privacy}","received_events_url":"https://api.github.com/users/mildred/received_events","type":"User","site_admin":false},"repo":{"id":42093648,"name":"go-ipld","full_name":"mildred/go-ipld","owner":{"login":"mildred","id":33804,"avatar_url":"https://avatars.githubusercontent.com/u/33804?v=3","gravatar_id":"","url":"https://api.github.com/users/mildred","html_url":"https://github.com/mildred","followers_url":"https://api.github.com/users/mildred/followers","following_url":"https://api.github.com/users/mildred/following{/other_user}","gists_url":"https://api.github.com/users/mildred/gists{/gist_id}","starred_url":"https://api.github.com/users/mildred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mildred/subscriptions","organizations_url":"https://api.github.com/users/mildred/orgs","repos_url":"https://api.github.com/users/mildred/repos","events_url":"https://api.github.com/users/mildred/events{/privacy}","received_events_url":"https://api.github.com/users/mildred/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mildred/go-ipld","description":null,"fork":true,"url":"https://api.github.com/repos/mildred/go-ipld","forks_url":"https://api.github.com/repos/mildred/go-ipld/forks","keys_url":"https://api.github.com/repos/mildred/go-ipld/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mildred/go-ipld/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mildred/go-ipld/teams","hooks_url":"https://api.github.com/repos/mildred/go-ipld/hooks","issue_events_url":"https://api.github.com/repos/mildred/go-ipld/issues/events{/number}","events_url":"https://api.github.com/repos/mildred/go-ipld/events","assignees_url":"https://api.github.com/repos/mildred/go-ipld/assignees{/user}","branches_url":"https://api.github.com/repos/mildred/go-ipld/branches{/branch}","tags_url":"https://api.github.com/repos/mildred/go-ipld/tags","blobs_url":"https://api.github.com/repos/mildred/go-ipld/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mildred/go-ipld/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mildred/go-ipld/git/refs{/sha}","trees_url":"https://api.github.com/repos/mildred/go-ipld/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mildred/go-ipld/statuses/{sha}","languages_url":"https://api.github.com/repos/mildred/go-ipld/languages","stargazers_url":"https://api.github.com/repos/mildred/go-ipld/stargazers","contributors_url":"https://api.github.com/repos/mildred/go-ipld/contributors","subscribers_url":"https://api.github.com/repos/mildred/go-ipld/subscribers","subscription_url":"https://api.github.com/repos/mildred/go-ipld/subscription","commits_url":"https://api.github.com/repos/mildred/go-ipld/commits{/sha}","git_commits_url":"https://api.github.com/repos/mildred/go-ipld/git/commits{/sha}","comments_url":"https://api.github.com/repos/mildred/go-ipld/comments{/number}","issue_comment_url":"https://api.github.com/repos/mildred/go-ipld/issues/comments{/number}","contents_url":"https://api.github.com/repos/mildred/go-ipld/contents/{+path}","compare_url":"https://api.github.com/repos/mildred/go-ipld/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mildred/go-ipld/merges","archive_url":"https://api.github.com/repos/mildred/go-ipld/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mildred/go-ipld/downloads","issues_url":"https://api.github.com/repos/mildred/go-ipld/issues{/number}","pulls_url":"https://api.github.com/repos/mildred/go-ipld/pulls{/number}","milestones_url":"https://api.github.com/repos/mildred/go-ipld/milestones{/number}","notifications_url":"https://api.github.com/repos/mildred/go-ipld/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mildred/go-ipld/labels{/name}","releases_url":"https://api.github.com/repos/mildred/go-ipld/releases{/id}","deployments_url":"https://api.github.com/repos/mildred/go-ipld/deployments","created_at":"2015-09-08T06:18:28Z","updated_at":"2015-09-08T06:18:29Z","pushed_at":"2016-02-29T07:59:14Z","git_url":"git://github.com/mildred/go-ipld.git","ssh_url":"git@github.com:mildred/go-ipld.git","clone_url":"https://github.com/mildred/go-ipld.git","svn_url":"https://github.com/mildred/go-ipld","homepage":null,"size":153,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"2df676964f184077780ab13c05936f4dbdadfe75","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":39595597,"name":"go-ipld","full_name":"ipfs/go-ipld","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-ipld","description":"ipld","fork":false,"url":"https://api.github.com/repos/ipfs/go-ipld","forks_url":"https://api.github.com/repos/ipfs/go-ipld/forks","keys_url":"https://api.github.com/repos/ipfs/go-ipld/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-ipld/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-ipld/teams","hooks_url":"https://api.github.com/repos/ipfs/go-ipld/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-ipld/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-ipld/events","assignees_url":"https://api.github.com/repos/ipfs/go-ipld/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-ipld/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-ipld/tags","blobs_url":"https://api.github.com/repos/ipfs/go-ipld/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-ipld/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-ipld/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-ipld/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-ipld/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-ipld/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-ipld/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-ipld/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-ipld/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-ipld/subscription","commits_url":"https://api.github.com/repos/ipfs/go-ipld/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-ipld/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-ipld/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-ipld/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-ipld/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-ipld/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-ipld/merges","archive_url":"https://api.github.com/repos/ipfs/go-ipld/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-ipld/downloads","issues_url":"https://api.github.com/repos/ipfs/go-ipld/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-ipld/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-ipld/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-ipld/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-ipld/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-ipld/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/go-ipld/deployments","created_at":"2015-07-23T21:59:37Z","updated_at":"2016-02-15T21:38:46Z","pushed_at":"2016-02-29T07:59:15Z","git_url":"git://github.com/ipfs/go-ipld.git","ssh_url":"git@github.com:ipfs/go-ipld.git","clone_url":"https://github.com/ipfs/go-ipld.git","svn_url":"https://github.com/ipfs/go-ipld","homepage":"","size":43,"stargazers_count":14,"watchers_count":14,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-ipld/pulls/19"},"html":{"href":"https://github.com/ipfs/go-ipld/pull/19"},"issue":{"href":"https://api.github.com/repos/ipfs/go-ipld/issues/19"},"comments":{"href":"https://api.github.com/repos/ipfs/go-ipld/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/go-ipld/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/go-ipld/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/go-ipld/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/go-ipld/statuses/cabb3634de4d892da239200947097753e367aa59"}}}}