{"action":"created","comment":{"url":"https://api.github.com/repos/flynn/flynn/pulls/comments/23821387","id":23821387,"diff_hunk":"@@ -0,0 +1,52 @@\n+package ctxhelper\n+\n+import (\n+\t\"github.com/flynn/flynn/Godeps/_workspace/src/github.com/julienschmidt/httprouter\"\n+\t\"github.com/flynn/flynn/Godeps/_workspace/src/golang.org/x/net/context\"\n+\tlog \"github.com/flynn/flynn/Godeps/_workspace/src/gopkg.in/inconshreveable/log15.v2\"\n+)\n+\n+type ctxKey string\n+\n+const (\n+\tctxKeyComponent ctxKey = \"component\"\n+\tctxKeyReqID            = \"req_id\"\n+\tctxKeyParams           = \"params\"\n+\tctxKeyLogger           = \"logger\"","path":"pkg/ctxhelper/ctxhelper.go","position":15,"original_position":15,"commit_id":"7a17cf20158c80e5d268c467849ea639e3f1b232","original_commit_id":"3edff769b3ff7f255b8f528317a8f37745110e44","user":{"login":"titanous","id":13026,"avatar_url":"https://avatars.githubusercontent.com/u/13026?v=3","gravatar_id":"","url":"https://api.github.com/users/titanous","html_url":"https://github.com/titanous","followers_url":"https://api.github.com/users/titanous/followers","following_url":"https://api.github.com/users/titanous/following{/other_user}","gists_url":"https://api.github.com/users/titanous/gists{/gist_id}","starred_url":"https://api.github.com/users/titanous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titanous/subscriptions","organizations_url":"https://api.github.com/users/titanous/orgs","repos_url":"https://api.github.com/users/titanous/repos","events_url":"https://api.github.com/users/titanous/events{/privacy}","received_events_url":"https://api.github.com/users/titanous/received_events","type":"User","site_admin":false},"body":"Fine with me.","created_at":"2015-01-30T02:55:30Z","updated_at":"2015-01-30T02:55:30Z","html_url":"https://github.com/flynn/flynn/pull/889#discussion_r23821387","pull_request_url":"https://api.github.com/repos/flynn/flynn/pulls/889","_links":{"self":{"href":"https://api.github.com/repos/flynn/flynn/pulls/comments/23821387"},"html":{"href":"https://github.com/flynn/flynn/pull/889#discussion_r23821387"},"pull_request":{"href":"https://api.github.com/repos/flynn/flynn/pulls/889"}}},"pull_request":{"url":"https://api.github.com/repos/flynn/flynn/pulls/889","id":28333961,"html_url":"https://github.com/flynn/flynn/pull/889","diff_url":"https://github.com/flynn/flynn/pull/889.diff","patch_url":"https://github.com/flynn/flynn/pull/889.patch","issue_url":"https://api.github.com/repos/flynn/flynn/issues/889","number":889,"state":"open","locked":false,"title":"Clean up context-based Handler type, move context setters/getters to ctxhelper pkg","user":{"login":"bgentry","id":114033,"avatar_url":"https://avatars.githubusercontent.com/u/114033?v=3","gravatar_id":"","url":"https://api.github.com/users/bgentry","html_url":"https://github.com/bgentry","followers_url":"https://api.github.com/users/bgentry/followers","following_url":"https://api.github.com/users/bgentry/following{/other_user}","gists_url":"https://api.github.com/users/bgentry/gists{/gist_id}","starred_url":"https://api.github.com/users/bgentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgentry/subscriptions","organizations_url":"https://api.github.com/users/bgentry/orgs","repos_url":"https://api.github.com/users/bgentry/repos","events_url":"https://api.github.com/users/bgentry/events{/privacy}","received_events_url":"https://api.github.com/users/bgentry/received_events","type":"User","site_admin":false},"body":"Following the conventions outlined in the [context blog post](https://blog.golang.org/context#TOC_3.2.), I've moved to context getters and setters to a separate subpackage. This allows the context keys to be internal, unexported types, and provides users of the package with stronger type guarantees (since you can't set something on a context with a key whose type you can't access).\r\n\r\nI also renamed the `Handle` type to `HandlerFunc` since it is analogous to `http.HandlerFunc`.\r\n\r\nFinally, I introduced an `httphelper.Handler` type that is analogous to `http.Handler`.\r\n\r\nI plan to use all this stuff to bring context into the router.","created_at":"2015-01-30T02:36:27Z","updated_at":"2015-01-30T02:55:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1407a7789c4fb5fa1b8eceb68d6113dfda4ad3c6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flynn/flynn/pulls/889/commits","review_comments_url":"https://api.github.com/repos/flynn/flynn/pulls/889/comments","review_comment_url":"https://api.github.com/repos/flynn/flynn/pulls/comments/{number}","comments_url":"https://api.github.com/repos/flynn/flynn/issues/889/comments","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/7a17cf20158c80e5d268c467849ea639e3f1b232","head":{"label":"bgentry:router-context","ref":"router-context","sha":"7a17cf20158c80e5d268c467849ea639e3f1b232","user":{"login":"bgentry","id":114033,"avatar_url":"https://avatars.githubusercontent.com/u/114033?v=3","gravatar_id":"","url":"https://api.github.com/users/bgentry","html_url":"https://github.com/bgentry","followers_url":"https://api.github.com/users/bgentry/followers","following_url":"https://api.github.com/users/bgentry/following{/other_user}","gists_url":"https://api.github.com/users/bgentry/gists{/gist_id}","starred_url":"https://api.github.com/users/bgentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgentry/subscriptions","organizations_url":"https://api.github.com/users/bgentry/orgs","repos_url":"https://api.github.com/users/bgentry/repos","events_url":"https://api.github.com/users/bgentry/events{/privacy}","received_events_url":"https://api.github.com/users/bgentry/received_events","type":"User","site_admin":false},"repo":{"id":29484741,"name":"flynn","full_name":"bgentry/flynn","owner":{"login":"bgentry","id":114033,"avatar_url":"https://avatars.githubusercontent.com/u/114033?v=3","gravatar_id":"","url":"https://api.github.com/users/bgentry","html_url":"https://github.com/bgentry","followers_url":"https://api.github.com/users/bgentry/followers","following_url":"https://api.github.com/users/bgentry/following{/other_user}","gists_url":"https://api.github.com/users/bgentry/gists{/gist_id}","starred_url":"https://api.github.com/users/bgentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgentry/subscriptions","organizations_url":"https://api.github.com/users/bgentry/orgs","repos_url":"https://api.github.com/users/bgentry/repos","events_url":"https://api.github.com/users/bgentry/events{/privacy}","received_events_url":"https://api.github.com/users/bgentry/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bgentry/flynn","description":"A next generation open source platform as a service (PaaS)","fork":true,"url":"https://api.github.com/repos/bgentry/flynn","forks_url":"https://api.github.com/repos/bgentry/flynn/forks","keys_url":"https://api.github.com/repos/bgentry/flynn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bgentry/flynn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bgentry/flynn/teams","hooks_url":"https://api.github.com/repos/bgentry/flynn/hooks","issue_events_url":"https://api.github.com/repos/bgentry/flynn/issues/events{/number}","events_url":"https://api.github.com/repos/bgentry/flynn/events","assignees_url":"https://api.github.com/repos/bgentry/flynn/assignees{/user}","branches_url":"https://api.github.com/repos/bgentry/flynn/branches{/branch}","tags_url":"https://api.github.com/repos/bgentry/flynn/tags","blobs_url":"https://api.github.com/repos/bgentry/flynn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bgentry/flynn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bgentry/flynn/git/refs{/sha}","trees_url":"https://api.github.com/repos/bgentry/flynn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bgentry/flynn/statuses/{sha}","languages_url":"https://api.github.com/repos/bgentry/flynn/languages","stargazers_url":"https://api.github.com/repos/bgentry/flynn/stargazers","contributors_url":"https://api.github.com/repos/bgentry/flynn/contributors","subscribers_url":"https://api.github.com/repos/bgentry/flynn/subscribers","subscription_url":"https://api.github.com/repos/bgentry/flynn/subscription","commits_url":"https://api.github.com/repos/bgentry/flynn/commits{/sha}","git_commits_url":"https://api.github.com/repos/bgentry/flynn/git/commits{/sha}","comments_url":"https://api.github.com/repos/bgentry/flynn/comments{/number}","issue_comment_url":"https://api.github.com/repos/bgentry/flynn/issues/comments/{number}","contents_url":"https://api.github.com/repos/bgentry/flynn/contents/{+path}","compare_url":"https://api.github.com/repos/bgentry/flynn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bgentry/flynn/merges","archive_url":"https://api.github.com/repos/bgentry/flynn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bgentry/flynn/downloads","issues_url":"https://api.github.com/repos/bgentry/flynn/issues{/number}","pulls_url":"https://api.github.com/repos/bgentry/flynn/pulls{/number}","milestones_url":"https://api.github.com/repos/bgentry/flynn/milestones{/number}","notifications_url":"https://api.github.com/repos/bgentry/flynn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bgentry/flynn/labels{/name}","releases_url":"https://api.github.com/repos/bgentry/flynn/releases{/id}","created_at":"2015-01-19T18:20:14Z","updated_at":"2015-01-29T18:42:10Z","pushed_at":"2015-01-30T02:51:14Z","git_url":"git://github.com/bgentry/flynn.git","ssh_url":"git@github.com:bgentry/flynn.git","clone_url":"https://github.com/bgentry/flynn.git","svn_url":"https://github.com/bgentry/flynn","homepage":"https://flynn.io","size":11359,"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":"flynn:master","ref":"master","sha":"f0762ce86d3e2f70a16d9c83ac9e5361bffd61ce","user":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"repo":{"id":11290232,"name":"flynn","full_name":"flynn/flynn","owner":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flynn/flynn","description":"A next generation open source platform as a service (PaaS)","fork":false,"url":"https://api.github.com/repos/flynn/flynn","forks_url":"https://api.github.com/repos/flynn/flynn/forks","keys_url":"https://api.github.com/repos/flynn/flynn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flynn/flynn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flynn/flynn/teams","hooks_url":"https://api.github.com/repos/flynn/flynn/hooks","issue_events_url":"https://api.github.com/repos/flynn/flynn/issues/events{/number}","events_url":"https://api.github.com/repos/flynn/flynn/events","assignees_url":"https://api.github.com/repos/flynn/flynn/assignees{/user}","branches_url":"https://api.github.com/repos/flynn/flynn/branches{/branch}","tags_url":"https://api.github.com/repos/flynn/flynn/tags","blobs_url":"https://api.github.com/repos/flynn/flynn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flynn/flynn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flynn/flynn/git/refs{/sha}","trees_url":"https://api.github.com/repos/flynn/flynn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/{sha}","languages_url":"https://api.github.com/repos/flynn/flynn/languages","stargazers_url":"https://api.github.com/repos/flynn/flynn/stargazers","contributors_url":"https://api.github.com/repos/flynn/flynn/contributors","subscribers_url":"https://api.github.com/repos/flynn/flynn/subscribers","subscription_url":"https://api.github.com/repos/flynn/flynn/subscription","commits_url":"https://api.github.com/repos/flynn/flynn/commits{/sha}","git_commits_url":"https://api.github.com/repos/flynn/flynn/git/commits{/sha}","comments_url":"https://api.github.com/repos/flynn/flynn/comments{/number}","issue_comment_url":"https://api.github.com/repos/flynn/flynn/issues/comments/{number}","contents_url":"https://api.github.com/repos/flynn/flynn/contents/{+path}","compare_url":"https://api.github.com/repos/flynn/flynn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flynn/flynn/merges","archive_url":"https://api.github.com/repos/flynn/flynn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flynn/flynn/downloads","issues_url":"https://api.github.com/repos/flynn/flynn/issues{/number}","pulls_url":"https://api.github.com/repos/flynn/flynn/pulls{/number}","milestones_url":"https://api.github.com/repos/flynn/flynn/milestones{/number}","notifications_url":"https://api.github.com/repos/flynn/flynn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flynn/flynn/labels{/name}","releases_url":"https://api.github.com/repos/flynn/flynn/releases{/id}","created_at":"2013-07-09T18:22:06Z","updated_at":"2015-01-30T02:26:14Z","pushed_at":"2015-01-30T02:51:32Z","git_url":"git://github.com/flynn/flynn.git","ssh_url":"git@github.com:flynn/flynn.git","clone_url":"https://github.com/flynn/flynn.git","svn_url":"https://github.com/flynn/flynn","homepage":"https://flynn.io","size":34727,"stargazers_count":3199,"watchers_count":3199,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":200,"mirror_url":null,"open_issues_count":116,"forks":200,"open_issues":116,"watchers":3199,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flynn/flynn/pulls/889"},"html":{"href":"https://github.com/flynn/flynn/pull/889"},"issue":{"href":"https://api.github.com/repos/flynn/flynn/issues/889"},"comments":{"href":"https://api.github.com/repos/flynn/flynn/issues/889/comments"},"review_comments":{"href":"https://api.github.com/repos/flynn/flynn/pulls/889/comments"},"review_comment":{"href":"https://api.github.com/repos/flynn/flynn/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/flynn/flynn/pulls/889/commits"},"statuses":{"href":"https://api.github.com/repos/flynn/flynn/statuses/7a17cf20158c80e5d268c467849ea639e3f1b232"}}}}