{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/comments/70432906","id":70432906,"diff_hunk":"@@ -143,6 +143,57 @@ func (hh *httpHandlers) countHandler(w http.ResponseWriter, r *http.Request) {\n \t}\n }\n \n+func (hh *httpHandlers) idsHandler(w http.ResponseWriter, r *http.Request) {\n+\n+\tidService, ok := hh.s.(rwapi.IDService)\n+\tif !ok {\n+\t\tw.WriteHeader(http.StatusNotImplemented)\n+\t\treturn\n+\t}\n+\n+\tids := make(chan rwapi.IDEntry, 4096)\n+\terrs := make(chan error)\n+\n+\tstop := make(chan struct{})\n+\tdefer close(stop)\n+\n+\tgo func() {\n+\t\tidService.IDs(ids, errs, stop)\n+\t\tclose(ids)\n+\t}()\n+\n+\tw.Header().Add(\"Content-Type\", \"application/json\")\n+\n+\tenc := json.NewEncoder(w)\n+\n+\tvar err error\n+\tfor err == nil {\n+\t\tselect {\n+\t\tcase id, ok := <-ids:\n+\t\t\tif !ok {\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t\terr = enc.Encode(id)\n+\t\tcase err = <-errs:\n+\t\t}\n+\t}\n+\n+\tlog.Errorf(err.Error())\n+\n+\t// at this point, the best we can do is close the connection to inform\n+\t// the client of the error, because we've already said \"200\"\n+\tconn, _, err := w.(http.Hijacker).Hijack()","path":"baseftrwapp/http_handlers.go","position":43,"original_position":43,"commit_id":"8c6e3cb346abb83e342c469ebc1c7c3e9533b022","original_commit_id":"8c6e3cb346abb83e342c469ebc1c7c3e9533b022","user":{"login":"tosan88","id":5280120,"avatar_url":"https://avatars.githubusercontent.com/u/5280120?v=3","gravatar_id":"","url":"https://api.github.com/users/tosan88","html_url":"https://github.com/tosan88","followers_url":"https://api.github.com/users/tosan88/followers","following_url":"https://api.github.com/users/tosan88/following{/other_user}","gists_url":"https://api.github.com/users/tosan88/gists{/gist_id}","starred_url":"https://api.github.com/users/tosan88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tosan88/subscriptions","organizations_url":"https://api.github.com/users/tosan88/orgs","repos_url":"https://api.github.com/users/tosan88/repos","events_url":"https://api.github.com/users/tosan88/events{/privacy}","received_events_url":"https://api.github.com/users/tosan88/received_events","type":"User","site_admin":false},"body":"can you please explain why is this call needed? I don't quite understand it...","created_at":"2016-07-12T13:03:00Z","updated_at":"2016-07-12T13:03:00Z","html_url":"https://github.com/Financial-Times/base-ft-rw-app-go/pull/14#discussion_r70432906","pull_request_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/comments/70432906"},"html":{"href":"https://github.com/Financial-Times/base-ft-rw-app-go/pull/14#discussion_r70432906"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14","id":77095042,"html_url":"https://github.com/Financial-Times/base-ft-rw-app-go/pull/14","diff_url":"https://github.com/Financial-Times/base-ft-rw-app-go/pull/14.diff","patch_url":"https://github.com/Financial-Times/base-ft-rw-app-go/pull/14.patch","issue_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/14","number":14,"state":"closed","locked":false,"title":"Enable __ids if backend service supports it","user":{"login":"martingartonft","id":5197575,"avatar_url":"https://avatars.githubusercontent.com/u/5197575?v=3","gravatar_id":"","url":"https://api.github.com/users/martingartonft","html_url":"https://github.com/martingartonft","followers_url":"https://api.github.com/users/martingartonft/followers","following_url":"https://api.github.com/users/martingartonft/following{/other_user}","gists_url":"https://api.github.com/users/martingartonft/gists{/gist_id}","starred_url":"https://api.github.com/users/martingartonft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martingartonft/subscriptions","organizations_url":"https://api.github.com/users/martingartonft/orgs","repos_url":"https://api.github.com/users/martingartonft/repos","events_url":"https://api.github.com/users/martingartonft/events{/privacy}","received_events_url":"https://api.github.com/users/martingartonft/received_events","type":"User","site_admin":false},"body":"This adds a __ids endpoint.  This will work only if implemented by the\r\nService being used. Otherwise we return HTTP 501 Not Implemented.","created_at":"2016-07-12T10:19:47Z","updated_at":"2016-07-12T13:03:00Z","closed_at":"2016-07-12T11:52:56Z","merged_at":"2016-07-12T11:52:56Z","merge_commit_sha":"47721ea5a02dc57a5c12136f632c4231e7dcc641","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/14/comments","statuses_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/statuses/8c6e3cb346abb83e342c469ebc1c7c3e9533b022","head":{"label":"Financial-Times:ids","ref":"ids","sha":"8c6e3cb346abb83e342c469ebc1c7c3e9533b022","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":49427601,"name":"base-ft-rw-app-go","full_name":"Financial-Times/base-ft-rw-app-go","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/base-ft-rw-app-go","description":"Base code for a read/write http microservice in Go","fork":false,"url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go","forks_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/forks","keys_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/teams","hooks_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/events","assignees_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/tags","blobs_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/subscription","commits_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/merges","archive_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/downloads","issues_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/deployments","created_at":"2016-01-11T13:18:17Z","updated_at":"2016-01-11T13:32:13Z","pushed_at":"2016-07-12T11:53:41Z","git_url":"git://github.com/Financial-Times/base-ft-rw-app-go.git","ssh_url":"git@github.com:Financial-Times/base-ft-rw-app-go.git","clone_url":"https://github.com/Financial-Times/base-ft-rw-app-go.git","svn_url":"https://github.com/Financial-Times/base-ft-rw-app-go","homepage":null,"size":2499,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"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":"Financial-Times:master","ref":"master","sha":"5165741816db9d497b4e25372e2085e43baf6ec8","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":49427601,"name":"base-ft-rw-app-go","full_name":"Financial-Times/base-ft-rw-app-go","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/base-ft-rw-app-go","description":"Base code for a read/write http microservice in Go","fork":false,"url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go","forks_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/forks","keys_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/teams","hooks_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/events","assignees_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/tags","blobs_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/subscription","commits_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/merges","archive_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/downloads","issues_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/deployments","created_at":"2016-01-11T13:18:17Z","updated_at":"2016-01-11T13:32:13Z","pushed_at":"2016-07-12T11:53:41Z","git_url":"git://github.com/Financial-Times/base-ft-rw-app-go.git","ssh_url":"git@github.com:Financial-Times/base-ft-rw-app-go.git","clone_url":"https://github.com/Financial-Times/base-ft-rw-app-go.git","svn_url":"https://github.com/Financial-Times/base-ft-rw-app-go","homepage":null,"size":2499,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"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"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14"},"html":{"href":"https://github.com/Financial-Times/base-ft-rw-app-go/pull/14"},"issue":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/14"},"comments":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/base-ft-rw-app-go/statuses/8c6e3cb346abb83e342c469ebc1c7c3e9533b022"}}}}
{"actor":{"display_login":"tosan88"}}