{"action":"created","comment":{"url":"https://api.github.com/repos/mendersoftware/artifacts/pulls/comments/80656731","pull_request_review_id":1698579,"id":80656731,"diff_hunk":"@@ -101,7 +99,24 @@ func (rp *GenericParser) ParseHeader(tr *tar.Reader, hdr *tar.Header, hPath stri\n \treturn nil\n }\n \n+// Default data parser what writes the uncompressed data to `w`.\n func parseData(r io.Reader, w io.Writer, uFiles map[string]UpdateFile) error {\n+\treturn parseDataWithHandler(r,\n+\t\tfunc(dr io.Reader, uf UpdateFile) error {\n+\t\t\tif _, err := io.Copy(w, dr); err != nil {\n+\t\t\t\treturn errors.Wrapf(err, \"parser: can not read data: %v\", uf.Name)\n+\t\t\t}\n+\t\t\treturn nil\n+\t\t},\n+\t\tuFiles)\n+}\n+\n+// Caller provided update data stream handler. Parameter `r` is a decompressed\n+// data stream, `uf` contains basic information about update. The handler shall\n+// return nil if no errors occur.\n+type parseDataHandlerFunc func(r io.Reader, uf UpdateFile) error","path":"parser/generic_parser.go","position":41,"original_position":41,"commit_id":"5c344b772141e0293b54b134f9b8ad3b31cfd0b7","original_commit_id":"5c344b772141e0293b54b134f9b8ad3b31cfd0b7","user":{"login":"bboozzoo","id":41870,"avatar_url":"https://avatars.githubusercontent.com/u/41870?v=3","gravatar_id":"","url":"https://api.github.com/users/bboozzoo","html_url":"https://github.com/bboozzoo","followers_url":"https://api.github.com/users/bboozzoo/followers","following_url":"https://api.github.com/users/bboozzoo/following{/other_user}","gists_url":"https://api.github.com/users/bboozzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bboozzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboozzoo/subscriptions","organizations_url":"https://api.github.com/users/bboozzoo/orgs","repos_url":"https://api.github.com/users/bboozzoo/repos","events_url":"https://api.github.com/users/bboozzoo/events{/privacy}","received_events_url":"https://api.github.com/users/bboozzoo/received_events","type":"User","site_admin":false},"body":"Actually not ok. Neither `parseData` nor `parseDataWithHandler` are exported, so there's little sense in exporting a type that you cannot use.","created_at":"2016-09-27T09:50:48Z","updated_at":"2016-09-27T09:50:48Z","html_url":"https://github.com/mendersoftware/artifacts/pull/20#discussion_r80656731","pull_request_url":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/mendersoftware/artifacts/pulls/comments/80656731"},"html":{"href":"https://github.com/mendersoftware/artifacts/pull/20#discussion_r80656731"},"pull_request":{"href":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20","id":86880381,"html_url":"https://github.com/mendersoftware/artifacts/pull/20","diff_url":"https://github.com/mendersoftware/artifacts/pull/20.diff","patch_url":"https://github.com/mendersoftware/artifacts/pull/20.patch","issue_url":"https://api.github.com/repos/mendersoftware/artifacts/issues/20","number":20,"state":"open","locked":false,"title":"Support for passing incoming update data stream to the caller","user":{"login":"bboozzoo","id":41870,"avatar_url":"https://avatars.githubusercontent.com/u/41870?v=3","gravatar_id":"","url":"https://api.github.com/users/bboozzoo","html_url":"https://github.com/bboozzoo","followers_url":"https://api.github.com/users/bboozzoo/followers","following_url":"https://api.github.com/users/bboozzoo/following{/other_user}","gists_url":"https://api.github.com/users/bboozzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bboozzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboozzoo/subscriptions","organizations_url":"https://api.github.com/users/bboozzoo/orgs","repos_url":"https://api.github.com/users/bboozzoo/repos","events_url":"https://api.github.com/users/bboozzoo/events{/privacy}","received_events_url":"https://api.github.com/users/bboozzoo/received_events","type":"User","site_admin":false},"body":"The user of `RootfsParser` can provide `DataFunc` to receive a decompressed update data stream along with information about device type and current update.\r\n\r\nAdditional minor enhacements that remove the need for specialized `New..Parser`.\r\n\r\nDo not merge yet, still missing tests.\r\n\r\n@pasinskim @kacf ","created_at":"2016-09-27T08:09:16Z","updated_at":"2016-09-27T09:50:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57ed41351e9bb7c2e60b106a73cf5bdbaddf8a3b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20/commits","review_comments_url":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20/comments","review_comment_url":"https://api.github.com/repos/mendersoftware/artifacts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mendersoftware/artifacts/issues/20/comments","statuses_url":"https://api.github.com/repos/mendersoftware/artifacts/statuses/5c344b772141e0293b54b134f9b8ad3b31cfd0b7","head":{"label":"bboozzoo:bboozzoo/rootfs-stream","ref":"bboozzoo/rootfs-stream","sha":"5c344b772141e0293b54b134f9b8ad3b31cfd0b7","user":{"login":"bboozzoo","id":41870,"avatar_url":"https://avatars.githubusercontent.com/u/41870?v=3","gravatar_id":"","url":"https://api.github.com/users/bboozzoo","html_url":"https://github.com/bboozzoo","followers_url":"https://api.github.com/users/bboozzoo/followers","following_url":"https://api.github.com/users/bboozzoo/following{/other_user}","gists_url":"https://api.github.com/users/bboozzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bboozzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboozzoo/subscriptions","organizations_url":"https://api.github.com/users/bboozzoo/orgs","repos_url":"https://api.github.com/users/bboozzoo/repos","events_url":"https://api.github.com/users/bboozzoo/events{/privacy}","received_events_url":"https://api.github.com/users/bboozzoo/received_events","type":"User","site_admin":false},"repo":{"id":68921269,"name":"artifacts-1","full_name":"bboozzoo/artifacts-1","owner":{"login":"bboozzoo","id":41870,"avatar_url":"https://avatars.githubusercontent.com/u/41870?v=3","gravatar_id":"","url":"https://api.github.com/users/bboozzoo","html_url":"https://github.com/bboozzoo","followers_url":"https://api.github.com/users/bboozzoo/followers","following_url":"https://api.github.com/users/bboozzoo/following{/other_user}","gists_url":"https://api.github.com/users/bboozzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bboozzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboozzoo/subscriptions","organizations_url":"https://api.github.com/users/bboozzoo/orgs","repos_url":"https://api.github.com/users/bboozzoo/repos","events_url":"https://api.github.com/users/bboozzoo/events{/privacy}","received_events_url":"https://api.github.com/users/bboozzoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bboozzoo/artifacts-1","description":null,"fork":true,"url":"https://api.github.com/repos/bboozzoo/artifacts-1","forks_url":"https://api.github.com/repos/bboozzoo/artifacts-1/forks","keys_url":"https://api.github.com/repos/bboozzoo/artifacts-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bboozzoo/artifacts-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bboozzoo/artifacts-1/teams","hooks_url":"https://api.github.com/repos/bboozzoo/artifacts-1/hooks","issue_events_url":"https://api.github.com/repos/bboozzoo/artifacts-1/issues/events{/number}","events_url":"https://api.github.com/repos/bboozzoo/artifacts-1/events","assignees_url":"https://api.github.com/repos/bboozzoo/artifacts-1/assignees{/user}","branches_url":"https://api.github.com/repos/bboozzoo/artifacts-1/branches{/branch}","tags_url":"https://api.github.com/repos/bboozzoo/artifacts-1/tags","blobs_url":"https://api.github.com/repos/bboozzoo/artifacts-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bboozzoo/artifacts-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bboozzoo/artifacts-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/bboozzoo/artifacts-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bboozzoo/artifacts-1/statuses/{sha}","languages_url":"https://api.github.com/repos/bboozzoo/artifacts-1/languages","stargazers_url":"https://api.github.com/repos/bboozzoo/artifacts-1/stargazers","contributors_url":"https://api.github.com/repos/bboozzoo/artifacts-1/contributors","subscribers_url":"https://api.github.com/repos/bboozzoo/artifacts-1/subscribers","subscription_url":"https://api.github.com/repos/bboozzoo/artifacts-1/subscription","commits_url":"https://api.github.com/repos/bboozzoo/artifacts-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/bboozzoo/artifacts-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/bboozzoo/artifacts-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/bboozzoo/artifacts-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/bboozzoo/artifacts-1/contents/{+path}","compare_url":"https://api.github.com/repos/bboozzoo/artifacts-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bboozzoo/artifacts-1/merges","archive_url":"https://api.github.com/repos/bboozzoo/artifacts-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bboozzoo/artifacts-1/downloads","issues_url":"https://api.github.com/repos/bboozzoo/artifacts-1/issues{/number}","pulls_url":"https://api.github.com/repos/bboozzoo/artifacts-1/pulls{/number}","milestones_url":"https://api.github.com/repos/bboozzoo/artifacts-1/milestones{/number}","notifications_url":"https://api.github.com/repos/bboozzoo/artifacts-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bboozzoo/artifacts-1/labels{/name}","releases_url":"https://api.github.com/repos/bboozzoo/artifacts-1/releases{/id}","deployments_url":"https://api.github.com/repos/bboozzoo/artifacts-1/deployments","created_at":"2016-09-22T12:56:30Z","updated_at":"2016-09-22T12:56:31Z","pushed_at":"2016-09-27T08:07:03Z","git_url":"git://github.com/bboozzoo/artifacts-1.git","ssh_url":"git@github.com:bboozzoo/artifacts-1.git","clone_url":"https://github.com/bboozzoo/artifacts-1.git","svn_url":"https://github.com/bboozzoo/artifacts-1","homepage":null,"size":125,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"mendersoftware:master","ref":"master","sha":"20c666c0665ec8b67112ec4252b9781e2d38c883","user":{"login":"mendersoftware","id":15040539,"avatar_url":"https://avatars.githubusercontent.com/u/15040539?v=3","gravatar_id":"","url":"https://api.github.com/users/mendersoftware","html_url":"https://github.com/mendersoftware","followers_url":"https://api.github.com/users/mendersoftware/followers","following_url":"https://api.github.com/users/mendersoftware/following{/other_user}","gists_url":"https://api.github.com/users/mendersoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mendersoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendersoftware/subscriptions","organizations_url":"https://api.github.com/users/mendersoftware/orgs","repos_url":"https://api.github.com/users/mendersoftware/repos","events_url":"https://api.github.com/users/mendersoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mendersoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":66545284,"name":"artifacts","full_name":"mendersoftware/artifacts","owner":{"login":"mendersoftware","id":15040539,"avatar_url":"https://avatars.githubusercontent.com/u/15040539?v=3","gravatar_id":"","url":"https://api.github.com/users/mendersoftware","html_url":"https://github.com/mendersoftware","followers_url":"https://api.github.com/users/mendersoftware/followers","following_url":"https://api.github.com/users/mendersoftware/following{/other_user}","gists_url":"https://api.github.com/users/mendersoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mendersoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendersoftware/subscriptions","organizations_url":"https://api.github.com/users/mendersoftware/orgs","repos_url":"https://api.github.com/users/mendersoftware/repos","events_url":"https://api.github.com/users/mendersoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mendersoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mendersoftware/artifacts","description":null,"fork":false,"url":"https://api.github.com/repos/mendersoftware/artifacts","forks_url":"https://api.github.com/repos/mendersoftware/artifacts/forks","keys_url":"https://api.github.com/repos/mendersoftware/artifacts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mendersoftware/artifacts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mendersoftware/artifacts/teams","hooks_url":"https://api.github.com/repos/mendersoftware/artifacts/hooks","issue_events_url":"https://api.github.com/repos/mendersoftware/artifacts/issues/events{/number}","events_url":"https://api.github.com/repos/mendersoftware/artifacts/events","assignees_url":"https://api.github.com/repos/mendersoftware/artifacts/assignees{/user}","branches_url":"https://api.github.com/repos/mendersoftware/artifacts/branches{/branch}","tags_url":"https://api.github.com/repos/mendersoftware/artifacts/tags","blobs_url":"https://api.github.com/repos/mendersoftware/artifacts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mendersoftware/artifacts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mendersoftware/artifacts/git/refs{/sha}","trees_url":"https://api.github.com/repos/mendersoftware/artifacts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mendersoftware/artifacts/statuses/{sha}","languages_url":"https://api.github.com/repos/mendersoftware/artifacts/languages","stargazers_url":"https://api.github.com/repos/mendersoftware/artifacts/stargazers","contributors_url":"https://api.github.com/repos/mendersoftware/artifacts/contributors","subscribers_url":"https://api.github.com/repos/mendersoftware/artifacts/subscribers","subscription_url":"https://api.github.com/repos/mendersoftware/artifacts/subscription","commits_url":"https://api.github.com/repos/mendersoftware/artifacts/commits{/sha}","git_commits_url":"https://api.github.com/repos/mendersoftware/artifacts/git/commits{/sha}","comments_url":"https://api.github.com/repos/mendersoftware/artifacts/comments{/number}","issue_comment_url":"https://api.github.com/repos/mendersoftware/artifacts/issues/comments{/number}","contents_url":"https://api.github.com/repos/mendersoftware/artifacts/contents/{+path}","compare_url":"https://api.github.com/repos/mendersoftware/artifacts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mendersoftware/artifacts/merges","archive_url":"https://api.github.com/repos/mendersoftware/artifacts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mendersoftware/artifacts/downloads","issues_url":"https://api.github.com/repos/mendersoftware/artifacts/issues{/number}","pulls_url":"https://api.github.com/repos/mendersoftware/artifacts/pulls{/number}","milestones_url":"https://api.github.com/repos/mendersoftware/artifacts/milestones{/number}","notifications_url":"https://api.github.com/repos/mendersoftware/artifacts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mendersoftware/artifacts/labels{/name}","releases_url":"https://api.github.com/repos/mendersoftware/artifacts/releases{/id}","deployments_url":"https://api.github.com/repos/mendersoftware/artifacts/deployments","created_at":"2016-08-25T09:36:28Z","updated_at":"2016-08-25T12:46:28Z","pushed_at":"2016-09-27T09:39:29Z","git_url":"git://github.com/mendersoftware/artifacts.git","ssh_url":"git@github.com:mendersoftware/artifacts.git","clone_url":"https://github.com/mendersoftware/artifacts.git","svn_url":"https://github.com/mendersoftware/artifacts","homepage":null,"size":144,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20"},"html":{"href":"https://github.com/mendersoftware/artifacts/pull/20"},"issue":{"href":"https://api.github.com/repos/mendersoftware/artifacts/issues/20"},"comments":{"href":"https://api.github.com/repos/mendersoftware/artifacts/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/mendersoftware/artifacts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mendersoftware/artifacts/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/mendersoftware/artifacts/statuses/5c344b772141e0293b54b134f9b8ad3b31cfd0b7"}}}}
{"actor":{"display_login":"bboozzoo"}}