{"action":"created","comment":{"url":"https://api.github.com/repos/heindrichpaul/card-api/pulls/comments/288970815","pull_request_review_id":243769520,"id":288970815,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4ODk3MDgxNQ==","diff_hunk":"@@ -0,0 +1,67 @@\n+package api\n+\n+import (\n+\t\"fmt\"\n+\t\"net/http\"\n+\t\"net/url\"\n+\t\"strconv\"\n+\n+\t\"github.com/gorilla/mux\"\n+\t\"github.com/heindrichpaul/card-api/deckmanager\"\n+)\n+\n+type CardAPI struct {\n+\tRouter    *mux.Router\n+\tdAPI      *deckAPI\n+\tpAPI      *pileAPI\n+\tlogErrors bool\n+}\n+\n+func NewAPI(log bool) *CardAPI {\n+\tcardAPI := &CardAPI{\n+\t\tRouter:    mux.NewRouter(),\n+\t\tlogErrors: log,\n+\t}\n+\n+\tcardAPI.registerAPIs()\n+\treturn cardAPI\n+}\n+\n+func (z *CardAPI) registerAPIs() {\n+\tdeckManager := deckmanager.NewDeckManager()\n+\tz.dAPI = newDeckAPI(z.Router, deckManager)\n+\tz.dAPI.register()\n+\tz.pAPI = newPileAPI(z.Router, deckManager)\n+\tz.pAPI.register()\n+}\n+\n+func handleError(w http.ResponseWriter, r *http.Request, e *apiError) {\n+\tw.Header().Set(\"Content-Type\", \"application/json\")\n+\tw.WriteHeader(http.StatusInternalServerError)\n+\te.logRequest(r)\n+\teJSON, err := e.marshal()\n+\tif err == nil {\n+\t\tfmt.Fprintf(w, string(eJSON))\n+\t\treturn\n+\t}\n+}\n+\n+func getBooleanValue(v url.Values, key string) bool {\n+\tboolean, err := strconv.ParseBool(v.Get(key))\n+\tif err != nil {\n+\t\tboolean = false\n+\t}\n+\treturn boolean\n+}\n+\n+func getIntWithDefaultValueAs1(v url.Values, key string) int {\n+\tnumber, err := strconv.Atoi(v.Get(key))\n+\tif err != nil {\n+\t\tnumber = 1\n+\t}\n+\treturn number\n+}\n+\n+func getStringValue(v url.Values, key string) string {","path":"api/api.go","position":65,"original_position":65,"commit_id":"660c9db540b74995b86f7c302bc35a4c309e3acd","original_commit_id":"660c9db540b74995b86f7c302bc35a4c309e3acd","user":{"login":"golangcibot","id":42910462,"node_id":"MDQ6VXNlcjQyOTEwNDYy","avatar_url":"https://avatars1.githubusercontent.com/u/42910462?v=4","gravatar_id":"","url":"https://api.github.com/users/golangcibot","html_url":"https://github.com/golangcibot","followers_url":"https://api.github.com/users/golangcibot/followers","following_url":"https://api.github.com/users/golangcibot/following{/other_user}","gists_url":"https://api.github.com/users/golangcibot/gists{/gist_id}","starred_url":"https://api.github.com/users/golangcibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golangcibot/subscriptions","organizations_url":"https://api.github.com/users/golangcibot/orgs","repos_url":"https://api.github.com/users/golangcibot/repos","events_url":"https://api.github.com/users/golangcibot/events{/privacy}","received_events_url":"https://api.github.com/users/golangcibot/received_events","type":"User","site_admin":false},"body":"`getStringValue` is unused (from `deadcode`)","created_at":"2019-05-30T12:31:57Z","updated_at":"2019-05-30T12:31:57Z","html_url":"https://github.com/heindrichpaul/card-api/pull/8#discussion_r288970815","pull_request_url":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/heindrichpaul/card-api/pulls/comments/288970815"},"html":{"href":"https://github.com/heindrichpaul/card-api/pull/8#discussion_r288970815"},"pull_request":{"href":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8","id":283390412,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgzMzkwNDEy","html_url":"https://github.com/heindrichpaul/card-api/pull/8","diff_url":"https://github.com/heindrichpaul/card-api/pull/8.diff","patch_url":"https://github.com/heindrichpaul/card-api/pull/8.patch","issue_url":"https://api.github.com/repos/heindrichpaul/card-api/issues/8","number":8,"state":"open","locked":false,"title":"Added better error handling and deck endpoints","user":{"login":"heindrichpaul","id":4306590,"node_id":"MDQ6VXNlcjQzMDY1OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4306590?v=4","gravatar_id":"","url":"https://api.github.com/users/heindrichpaul","html_url":"https://github.com/heindrichpaul","followers_url":"https://api.github.com/users/heindrichpaul/followers","following_url":"https://api.github.com/users/heindrichpaul/following{/other_user}","gists_url":"https://api.github.com/users/heindrichpaul/gists{/gist_id}","starred_url":"https://api.github.com/users/heindrichpaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heindrichpaul/subscriptions","organizations_url":"https://api.github.com/users/heindrichpaul/orgs","repos_url":"https://api.github.com/users/heindrichpaul/repos","events_url":"https://api.github.com/users/heindrichpaul/events{/privacy}","received_events_url":"https://api.github.com/users/heindrichpaul/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-05-29T18:59:45Z","updated_at":"2019-05-30T12:31:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8fe751200c6cf629982338df68d22aa27a416c2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pencilpainter","id":4491825,"node_id":"MDQ6VXNlcjQ0OTE4MjU=","avatar_url":"https://avatars2.githubusercontent.com/u/4491825?v=4","gravatar_id":"","url":"https://api.github.com/users/pencilpainter","html_url":"https://github.com/pencilpainter","followers_url":"https://api.github.com/users/pencilpainter/followers","following_url":"https://api.github.com/users/pencilpainter/following{/other_user}","gists_url":"https://api.github.com/users/pencilpainter/gists{/gist_id}","starred_url":"https://api.github.com/users/pencilpainter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pencilpainter/subscriptions","organizations_url":"https://api.github.com/users/pencilpainter/orgs","repos_url":"https://api.github.com/users/pencilpainter/repos","events_url":"https://api.github.com/users/pencilpainter/events{/privacy}","received_events_url":"https://api.github.com/users/pencilpainter/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8/commits","review_comments_url":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8/comments","review_comment_url":"https://api.github.com/repos/heindrichpaul/card-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heindrichpaul/card-api/issues/8/comments","statuses_url":"https://api.github.com/repos/heindrichpaul/card-api/statuses/660c9db540b74995b86f7c302bc35a4c309e3acd","head":{"label":"heindrichpaul:feature/DeckManager","ref":"feature/DeckManager","sha":"660c9db540b74995b86f7c302bc35a4c309e3acd","user":{"login":"heindrichpaul","id":4306590,"node_id":"MDQ6VXNlcjQzMDY1OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4306590?v=4","gravatar_id":"","url":"https://api.github.com/users/heindrichpaul","html_url":"https://github.com/heindrichpaul","followers_url":"https://api.github.com/users/heindrichpaul/followers","following_url":"https://api.github.com/users/heindrichpaul/following{/other_user}","gists_url":"https://api.github.com/users/heindrichpaul/gists{/gist_id}","starred_url":"https://api.github.com/users/heindrichpaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heindrichpaul/subscriptions","organizations_url":"https://api.github.com/users/heindrichpaul/orgs","repos_url":"https://api.github.com/users/heindrichpaul/repos","events_url":"https://api.github.com/users/heindrichpaul/events{/privacy}","received_events_url":"https://api.github.com/users/heindrichpaul/received_events","type":"User","site_admin":false},"repo":{"id":154299170,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQyOTkxNzA=","name":"card-api","full_name":"heindrichpaul/card-api","private":false,"owner":{"login":"heindrichpaul","id":4306590,"node_id":"MDQ6VXNlcjQzMDY1OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4306590?v=4","gravatar_id":"","url":"https://api.github.com/users/heindrichpaul","html_url":"https://github.com/heindrichpaul","followers_url":"https://api.github.com/users/heindrichpaul/followers","following_url":"https://api.github.com/users/heindrichpaul/following{/other_user}","gists_url":"https://api.github.com/users/heindrichpaul/gists{/gist_id}","starred_url":"https://api.github.com/users/heindrichpaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heindrichpaul/subscriptions","organizations_url":"https://api.github.com/users/heindrichpaul/orgs","repos_url":"https://api.github.com/users/heindrichpaul/repos","events_url":"https://api.github.com/users/heindrichpaul/events{/privacy}","received_events_url":"https://api.github.com/users/heindrichpaul/received_events","type":"User","site_admin":false},"html_url":"https://github.com/heindrichpaul/card-api","description":"A Deck API written in Go based upon https://github.com/crobertsbmw/deckofcards","fork":false,"url":"https://api.github.com/repos/heindrichpaul/card-api","forks_url":"https://api.github.com/repos/heindrichpaul/card-api/forks","keys_url":"https://api.github.com/repos/heindrichpaul/card-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heindrichpaul/card-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heindrichpaul/card-api/teams","hooks_url":"https://api.github.com/repos/heindrichpaul/card-api/hooks","issue_events_url":"https://api.github.com/repos/heindrichpaul/card-api/issues/events{/number}","events_url":"https://api.github.com/repos/heindrichpaul/card-api/events","assignees_url":"https://api.github.com/repos/heindrichpaul/card-api/assignees{/user}","branches_url":"https://api.github.com/repos/heindrichpaul/card-api/branches{/branch}","tags_url":"https://api.github.com/repos/heindrichpaul/card-api/tags","blobs_url":"https://api.github.com/repos/heindrichpaul/card-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heindrichpaul/card-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heindrichpaul/card-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/heindrichpaul/card-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heindrichpaul/card-api/statuses/{sha}","languages_url":"https://api.github.com/repos/heindrichpaul/card-api/languages","stargazers_url":"https://api.github.com/repos/heindrichpaul/card-api/stargazers","contributors_url":"https://api.github.com/repos/heindrichpaul/card-api/contributors","subscribers_url":"https://api.github.com/repos/heindrichpaul/card-api/subscribers","subscription_url":"https://api.github.com/repos/heindrichpaul/card-api/subscription","commits_url":"https://api.github.com/repos/heindrichpaul/card-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/heindrichpaul/card-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/heindrichpaul/card-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/heindrichpaul/card-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/heindrichpaul/card-api/contents/{+path}","compare_url":"https://api.github.com/repos/heindrichpaul/card-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heindrichpaul/card-api/merges","archive_url":"https://api.github.com/repos/heindrichpaul/card-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heindrichpaul/card-api/downloads","issues_url":"https://api.github.com/repos/heindrichpaul/card-api/issues{/number}","pulls_url":"https://api.github.com/repos/heindrichpaul/card-api/pulls{/number}","milestones_url":"https://api.github.com/repos/heindrichpaul/card-api/milestones{/number}","notifications_url":"https://api.github.com/repos/heindrichpaul/card-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heindrichpaul/card-api/labels{/name}","releases_url":"https://api.github.com/repos/heindrichpaul/card-api/releases{/id}","deployments_url":"https://api.github.com/repos/heindrichpaul/card-api/deployments","created_at":"2018-10-23T09:19:29Z","updated_at":"2019-05-15T20:13:28Z","pushed_at":"2019-05-30T12:31:46Z","git_url":"git://github.com/heindrichpaul/card-api.git","ssh_url":"git@github.com:heindrichpaul/card-api.git","clone_url":"https://github.com/heindrichpaul/card-api.git","svn_url":"https://github.com/heindrichpaul/card-api","homepage":"","size":5122,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"heindrichpaul:master","ref":"master","sha":"cc3bf514d31116ffbde91d2bef3165bb6dd09ca0","user":{"login":"heindrichpaul","id":4306590,"node_id":"MDQ6VXNlcjQzMDY1OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4306590?v=4","gravatar_id":"","url":"https://api.github.com/users/heindrichpaul","html_url":"https://github.com/heindrichpaul","followers_url":"https://api.github.com/users/heindrichpaul/followers","following_url":"https://api.github.com/users/heindrichpaul/following{/other_user}","gists_url":"https://api.github.com/users/heindrichpaul/gists{/gist_id}","starred_url":"https://api.github.com/users/heindrichpaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heindrichpaul/subscriptions","organizations_url":"https://api.github.com/users/heindrichpaul/orgs","repos_url":"https://api.github.com/users/heindrichpaul/repos","events_url":"https://api.github.com/users/heindrichpaul/events{/privacy}","received_events_url":"https://api.github.com/users/heindrichpaul/received_events","type":"User","site_admin":false},"repo":{"id":154299170,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQyOTkxNzA=","name":"card-api","full_name":"heindrichpaul/card-api","private":false,"owner":{"login":"heindrichpaul","id":4306590,"node_id":"MDQ6VXNlcjQzMDY1OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4306590?v=4","gravatar_id":"","url":"https://api.github.com/users/heindrichpaul","html_url":"https://github.com/heindrichpaul","followers_url":"https://api.github.com/users/heindrichpaul/followers","following_url":"https://api.github.com/users/heindrichpaul/following{/other_user}","gists_url":"https://api.github.com/users/heindrichpaul/gists{/gist_id}","starred_url":"https://api.github.com/users/heindrichpaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heindrichpaul/subscriptions","organizations_url":"https://api.github.com/users/heindrichpaul/orgs","repos_url":"https://api.github.com/users/heindrichpaul/repos","events_url":"https://api.github.com/users/heindrichpaul/events{/privacy}","received_events_url":"https://api.github.com/users/heindrichpaul/received_events","type":"User","site_admin":false},"html_url":"https://github.com/heindrichpaul/card-api","description":"A Deck API written in Go based upon https://github.com/crobertsbmw/deckofcards","fork":false,"url":"https://api.github.com/repos/heindrichpaul/card-api","forks_url":"https://api.github.com/repos/heindrichpaul/card-api/forks","keys_url":"https://api.github.com/repos/heindrichpaul/card-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heindrichpaul/card-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heindrichpaul/card-api/teams","hooks_url":"https://api.github.com/repos/heindrichpaul/card-api/hooks","issue_events_url":"https://api.github.com/repos/heindrichpaul/card-api/issues/events{/number}","events_url":"https://api.github.com/repos/heindrichpaul/card-api/events","assignees_url":"https://api.github.com/repos/heindrichpaul/card-api/assignees{/user}","branches_url":"https://api.github.com/repos/heindrichpaul/card-api/branches{/branch}","tags_url":"https://api.github.com/repos/heindrichpaul/card-api/tags","blobs_url":"https://api.github.com/repos/heindrichpaul/card-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heindrichpaul/card-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heindrichpaul/card-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/heindrichpaul/card-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heindrichpaul/card-api/statuses/{sha}","languages_url":"https://api.github.com/repos/heindrichpaul/card-api/languages","stargazers_url":"https://api.github.com/repos/heindrichpaul/card-api/stargazers","contributors_url":"https://api.github.com/repos/heindrichpaul/card-api/contributors","subscribers_url":"https://api.github.com/repos/heindrichpaul/card-api/subscribers","subscription_url":"https://api.github.com/repos/heindrichpaul/card-api/subscription","commits_url":"https://api.github.com/repos/heindrichpaul/card-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/heindrichpaul/card-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/heindrichpaul/card-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/heindrichpaul/card-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/heindrichpaul/card-api/contents/{+path}","compare_url":"https://api.github.com/repos/heindrichpaul/card-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heindrichpaul/card-api/merges","archive_url":"https://api.github.com/repos/heindrichpaul/card-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heindrichpaul/card-api/downloads","issues_url":"https://api.github.com/repos/heindrichpaul/card-api/issues{/number}","pulls_url":"https://api.github.com/repos/heindrichpaul/card-api/pulls{/number}","milestones_url":"https://api.github.com/repos/heindrichpaul/card-api/milestones{/number}","notifications_url":"https://api.github.com/repos/heindrichpaul/card-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heindrichpaul/card-api/labels{/name}","releases_url":"https://api.github.com/repos/heindrichpaul/card-api/releases{/id}","deployments_url":"https://api.github.com/repos/heindrichpaul/card-api/deployments","created_at":"2018-10-23T09:19:29Z","updated_at":"2019-05-15T20:13:28Z","pushed_at":"2019-05-30T12:31:46Z","git_url":"git://github.com/heindrichpaul/card-api.git","ssh_url":"git@github.com:heindrichpaul/card-api.git","clone_url":"https://github.com/heindrichpaul/card-api.git","svn_url":"https://github.com/heindrichpaul/card-api","homepage":"","size":5122,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8"},"html":{"href":"https://github.com/heindrichpaul/card-api/pull/8"},"issue":{"href":"https://api.github.com/repos/heindrichpaul/card-api/issues/8"},"comments":{"href":"https://api.github.com/repos/heindrichpaul/card-api/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/heindrichpaul/card-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heindrichpaul/card-api/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/heindrichpaul/card-api/statuses/660c9db540b74995b86f7c302bc35a4c309e3acd"}},"author_association":"OWNER"}}
{"actor":{"display_login":"golangcibot"}}