{"action":"created","comment":{"url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/comments/74683878","id":74683878,"diff_hunk":"@@ -0,0 +1,125 @@\n+package server\n+\n+import (\n+\t\"github.com/julienschmidt/httprouter\"\n+\t\"github.com/justinas/alice\"\n+\t\"github.com/rs/cors\"\n+\t\"net/http\"\n+\t\"os\"\n+)\n+\n+// AuthType stores the auth type used to determine if a route needs to check the token\n+type AuthType int\n+\n+const (\n+\t// AUTHNONE means no checking the token\n+\tAUTHNONE AuthType = 1\n+\t// AUTHTOKEN means check for a valid JWT\n+\tAUTHTOKEN AuthType = 2\n+)\n+\n+type (\n+\troute struct {\n+\t\tAuthType AuthType\n+\t\tHandler  httprouter.Handle\n+\t}\n+\n+\t// RouteMap contains the routes used by the application, as a\n+\t// [HTTP Verb][httprouter Path string]Route map\n+\tRouteMap map[string]map[string]route\n+\n+\t// Config is used to create the server struct\n+\tConfig struct {\n+\t\tRoutes      RouteMap\n+\t\tMiddlewares []alice.Constructor\n+\t}\n+\n+\tserver struct {\n+\t\tConfig\n+\t\tRouter   httprouter.Handle\n+\t\tPort     string\n+\t\trouter   *httprouter.Router\n+\t\thandlers alice.Chain\n+\t}\n+)\n+\n+// CreateRoute takes an AuthType and a handler, and returns a route struct\n+func CreateRoute(auth AuthType, handler httprouter.Handle) route {","path":"server/server.go","position":47,"original_position":47,"commit_id":"e37c82b4d4dbba37869e2683578b6245c12ff9a3","original_commit_id":"e37c82b4d4dbba37869e2683578b6245c12ff9a3","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"exported func CreateRoute returns unexported type server.route, which can be annoying to use","created_at":"2016-08-13T08:10:17Z","updated_at":"2016-08-13T08:10:17Z","html_url":"https://github.com/seanhagen/list-all-org-prs/pull/1#discussion_r74683878","pull_request_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/comments/74683878"},"html":{"href":"https://github.com/seanhagen/list-all-org-prs/pull/1#discussion_r74683878"},"pull_request":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1","id":81205463,"html_url":"https://github.com/seanhagen/list-all-org-prs/pull/1","diff_url":"https://github.com/seanhagen/list-all-org-prs/pull/1.diff","patch_url":"https://github.com/seanhagen/list-all-org-prs/pull/1.patch","issue_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/1","number":1,"state":"open","locked":false,"title":"Setting things up","user":{"login":"seanhagen","id":444767,"avatar_url":"https://avatars.githubusercontent.com/u/444767?v=3","gravatar_id":"","url":"https://api.github.com/users/seanhagen","html_url":"https://github.com/seanhagen","followers_url":"https://api.github.com/users/seanhagen/followers","following_url":"https://api.github.com/users/seanhagen/following{/other_user}","gists_url":"https://api.github.com/users/seanhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/seanhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanhagen/subscriptions","organizations_url":"https://api.github.com/users/seanhagen/orgs","repos_url":"https://api.github.com/users/seanhagen/repos","events_url":"https://api.github.com/users/seanhagen/events{/privacy}","received_events_url":"https://api.github.com/users/seanhagen/received_events","type":"User","site_admin":false},"body":"Getting CI and whatnot set up.","created_at":"2016-08-13T03:11:46Z","updated_at":"2016-08-13T08:10:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59b45e2b786bcaf1b30dafb367404132708c7f31","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1/commits","review_comments_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1/comments","review_comment_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/1/comments","statuses_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/statuses/e37c82b4d4dbba37869e2683578b6245c12ff9a3","head":{"label":"seanhagen:setting-up-the-server","ref":"setting-up-the-server","sha":"e37c82b4d4dbba37869e2683578b6245c12ff9a3","user":{"login":"seanhagen","id":444767,"avatar_url":"https://avatars.githubusercontent.com/u/444767?v=3","gravatar_id":"","url":"https://api.github.com/users/seanhagen","html_url":"https://github.com/seanhagen","followers_url":"https://api.github.com/users/seanhagen/followers","following_url":"https://api.github.com/users/seanhagen/following{/other_user}","gists_url":"https://api.github.com/users/seanhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/seanhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanhagen/subscriptions","organizations_url":"https://api.github.com/users/seanhagen/orgs","repos_url":"https://api.github.com/users/seanhagen/repos","events_url":"https://api.github.com/users/seanhagen/events{/privacy}","received_events_url":"https://api.github.com/users/seanhagen/received_events","type":"User","site_admin":false},"repo":{"id":65587244,"name":"list-all-org-prs","full_name":"seanhagen/list-all-org-prs","owner":{"login":"seanhagen","id":444767,"avatar_url":"https://avatars.githubusercontent.com/u/444767?v=3","gravatar_id":"","url":"https://api.github.com/users/seanhagen","html_url":"https://github.com/seanhagen","followers_url":"https://api.github.com/users/seanhagen/followers","following_url":"https://api.github.com/users/seanhagen/following{/other_user}","gists_url":"https://api.github.com/users/seanhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/seanhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanhagen/subscriptions","organizations_url":"https://api.github.com/users/seanhagen/orgs","repos_url":"https://api.github.com/users/seanhagen/repos","events_url":"https://api.github.com/users/seanhagen/events{/privacy}","received_events_url":"https://api.github.com/users/seanhagen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seanhagen/list-all-org-prs","description":"List all the open PRs for a GitHub Organization","fork":false,"url":"https://api.github.com/repos/seanhagen/list-all-org-prs","forks_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/forks","keys_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/teams","hooks_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/hooks","issue_events_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/events{/number}","events_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/events","assignees_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/assignees{/user}","branches_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/branches{/branch}","tags_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/tags","blobs_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/refs{/sha}","trees_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/statuses/{sha}","languages_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/languages","stargazers_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/stargazers","contributors_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/contributors","subscribers_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/subscribers","subscription_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/subscription","commits_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/commits{/sha}","git_commits_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/commits{/sha}","comments_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/comments{/number}","issue_comment_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/comments{/number}","contents_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/contents/{+path}","compare_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/merges","archive_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/downloads","issues_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues{/number}","pulls_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls{/number}","milestones_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/milestones{/number}","notifications_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/labels{/name}","releases_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/releases{/id}","deployments_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/deployments","created_at":"2016-08-12T22:33:21Z","updated_at":"2016-08-13T02:33:24Z","pushed_at":"2016-08-13T08:10:10Z","git_url":"git://github.com/seanhagen/list-all-org-prs.git","ssh_url":"git@github.com:seanhagen/list-all-org-prs.git","clone_url":"https://github.com/seanhagen/list-all-org-prs.git","svn_url":"https://github.com/seanhagen/list-all-org-prs","homepage":null,"size":10,"stargazers_count":0,"watchers_count":0,"language":"Makefile","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"seanhagen:master","ref":"master","sha":"7e20a91dcf34eaa9f7f17c91fdc01a17f2a0c7ef","user":{"login":"seanhagen","id":444767,"avatar_url":"https://avatars.githubusercontent.com/u/444767?v=3","gravatar_id":"","url":"https://api.github.com/users/seanhagen","html_url":"https://github.com/seanhagen","followers_url":"https://api.github.com/users/seanhagen/followers","following_url":"https://api.github.com/users/seanhagen/following{/other_user}","gists_url":"https://api.github.com/users/seanhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/seanhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanhagen/subscriptions","organizations_url":"https://api.github.com/users/seanhagen/orgs","repos_url":"https://api.github.com/users/seanhagen/repos","events_url":"https://api.github.com/users/seanhagen/events{/privacy}","received_events_url":"https://api.github.com/users/seanhagen/received_events","type":"User","site_admin":false},"repo":{"id":65587244,"name":"list-all-org-prs","full_name":"seanhagen/list-all-org-prs","owner":{"login":"seanhagen","id":444767,"avatar_url":"https://avatars.githubusercontent.com/u/444767?v=3","gravatar_id":"","url":"https://api.github.com/users/seanhagen","html_url":"https://github.com/seanhagen","followers_url":"https://api.github.com/users/seanhagen/followers","following_url":"https://api.github.com/users/seanhagen/following{/other_user}","gists_url":"https://api.github.com/users/seanhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/seanhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanhagen/subscriptions","organizations_url":"https://api.github.com/users/seanhagen/orgs","repos_url":"https://api.github.com/users/seanhagen/repos","events_url":"https://api.github.com/users/seanhagen/events{/privacy}","received_events_url":"https://api.github.com/users/seanhagen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seanhagen/list-all-org-prs","description":"List all the open PRs for a GitHub Organization","fork":false,"url":"https://api.github.com/repos/seanhagen/list-all-org-prs","forks_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/forks","keys_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/teams","hooks_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/hooks","issue_events_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/events{/number}","events_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/events","assignees_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/assignees{/user}","branches_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/branches{/branch}","tags_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/tags","blobs_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/refs{/sha}","trees_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/statuses/{sha}","languages_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/languages","stargazers_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/stargazers","contributors_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/contributors","subscribers_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/subscribers","subscription_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/subscription","commits_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/commits{/sha}","git_commits_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/git/commits{/sha}","comments_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/comments{/number}","issue_comment_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/comments{/number}","contents_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/contents/{+path}","compare_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/merges","archive_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/downloads","issues_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues{/number}","pulls_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls{/number}","milestones_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/milestones{/number}","notifications_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/labels{/name}","releases_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/releases{/id}","deployments_url":"https://api.github.com/repos/seanhagen/list-all-org-prs/deployments","created_at":"2016-08-12T22:33:21Z","updated_at":"2016-08-13T02:33:24Z","pushed_at":"2016-08-13T08:10:10Z","git_url":"git://github.com/seanhagen/list-all-org-prs.git","ssh_url":"git@github.com:seanhagen/list-all-org-prs.git","clone_url":"https://github.com/seanhagen/list-all-org-prs.git","svn_url":"https://github.com/seanhagen/list-all-org-prs","homepage":null,"size":10,"stargazers_count":0,"watchers_count":0,"language":"Makefile","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1"},"html":{"href":"https://github.com/seanhagen/list-all-org-prs/pull/1"},"issue":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/1"},"comments":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/seanhagen/list-all-org-prs/statuses/e37c82b4d4dbba37869e2683578b6245c12ff9a3"}}}}
{"actor":{"display_login":"houndci-bot"}}