{"action":"created","comment":{"url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments/82099272","pull_request_review_id":3030153,"id":82099272,"diff_hunk":"@@ -0,0 +1,324 @@\n+package recorder\n+\n+import (\n+\t\"bytes\"\n+\t\"encoding/base64\"\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"hash/fnv\"\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"path/filepath\"\n+\t\"sort\"\n+\t\"strings\"\n+\t\"unicode\"\n+\n+\t\"go.uber.org/yarpc/transport\"\n+\t\"golang.org/x/net/context\"\n+\t\"gopkg.in/yaml.v2\"\n+)\n+\n+var recorderFlag = flag.String(\"recorder\", \"replay\",\n+\t`replay: replay from recorded request/response pairs.\n+overwrite: record all request/response pairs, overwriting records.\n+append: replay existing and record new request/response pairs.`)\n+\n+// Recorder records & replay yarpc requests on the client side.\n+//\n+// For recording, the client must be connected and able to issue requests to a\n+// remote service. Every request and its response is recorded into a YAML file,\n+// under the directory \"testdata/recordings\".\n+//\n+// During replay, the client doesn't need to be connected, for any recorded\n+// request Recorder will return the recorded response. Any new request will\n+// return an error.\n+type Recorder struct {\n+\tmode       Mode\n+\tlogger     Logger\n+\trecordsDir string\n+}\n+\n+const recorderDir = \"testdata/recordings\"\n+\n+// Mode the different replay and recording modes.\n+type Mode int\n+\n+const (\n+\t// invalidMode is private and used to represent invalid modes.\n+\tinvalidMode = iota + 1","path":"yarpctest/recorder/recorder.go","position":null,"original_position":48,"commit_id":"8a97c4e392fb7c48df36da604cc8190e288162c9","original_commit_id":"73992c71117e74b36ce6f72562dee6af31e1634c","user":{"login":"bombela","id":216204,"avatar_url":"https://avatars.githubusercontent.com/u/216204?v=3","gravatar_id":"","url":"https://api.github.com/users/bombela","html_url":"https://github.com/bombela","followers_url":"https://api.github.com/users/bombela/followers","following_url":"https://api.github.com/users/bombela/following{/other_user}","gists_url":"https://api.github.com/users/bombela/gists{/gist_id}","starred_url":"https://api.github.com/users/bombela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bombela/subscriptions","organizations_url":"https://api.github.com/users/bombela/orgs","repos_url":"https://api.github.com/users/bombela/repos","events_url":"https://api.github.com/users/bombela/events{/privacy}","received_events_url":"https://api.github.com/users/bombela/received_events","type":"User","site_admin":false},"body":":+1: I misunderstood how iota works.","created_at":"2016-10-06T00:36:24Z","updated_at":"2016-10-06T01:00:08Z","html_url":"https://github.com/yarpc/yarpc-go/pull/365#discussion_r82099272","pull_request_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365","_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments/82099272"},"html":{"href":"https://github.com/yarpc/yarpc-go/pull/365#discussion_r82099272"},"pull_request":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365"}}},"pull_request":{"url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365","id":87418996,"html_url":"https://github.com/yarpc/yarpc-go/pull/365","diff_url":"https://github.com/yarpc/yarpc-go/pull/365.diff","patch_url":"https://github.com/yarpc/yarpc-go/pull/365.patch","issue_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/365","number":365,"state":"open","locked":false,"title":"A recorder filter.","user":{"login":"bombela","id":216204,"avatar_url":"https://avatars.githubusercontent.com/u/216204?v=3","gravatar_id":"","url":"https://api.github.com/users/bombela","html_url":"https://github.com/bombela","followers_url":"https://api.github.com/users/bombela/followers","following_url":"https://api.github.com/users/bombela/following{/other_user}","gists_url":"https://api.github.com/users/bombela/gists{/gist_id}","starred_url":"https://api.github.com/users/bombela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bombela/subscriptions","organizations_url":"https://api.github.com/users/bombela/orgs","repos_url":"https://api.github.com/users/bombela/repos","events_url":"https://api.github.com/users/bombela/events{/privacy}","received_events_url":"https://api.github.com/users/bombela/received_events","type":"User","site_admin":false},"body":"This recorder intercepts yarpc calls, offering to record the request/response\npairs in overwrite or append mode, and replay them.\n\nThe recorder is in its own package. A cmdline flag is used to control the mode\n(recording/replay).","created_at":"2016-09-30T00:52:34Z","updated_at":"2016-10-06T01:00:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b6f34a4cd557ac96bb4ea3bacb7ff26dbbcfd86","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365/commits","review_comments_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365/comments","review_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/365/comments","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/8a97c4e392fb7c48df36da604cc8190e288162c9","head":{"label":"yarpc:vcr","ref":"vcr","sha":"8a97c4e392fb7c48df36da604cc8190e288162c9","user":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"repo":{"id":50390111,"name":"yarpc-go","full_name":"yarpc/yarpc-go","owner":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarpc/yarpc-go","description":"YARPC for Golang","fork":false,"url":"https://api.github.com/repos/yarpc/yarpc-go","forks_url":"https://api.github.com/repos/yarpc/yarpc-go/forks","keys_url":"https://api.github.com/repos/yarpc/yarpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarpc/yarpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarpc/yarpc-go/teams","hooks_url":"https://api.github.com/repos/yarpc/yarpc-go/hooks","issue_events_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/yarpc/yarpc-go/events","assignees_url":"https://api.github.com/repos/yarpc/yarpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/yarpc/yarpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/yarpc/yarpc-go/tags","blobs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarpc/yarpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarpc/yarpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/yarpc/yarpc-go/languages","stargazers_url":"https://api.github.com/repos/yarpc/yarpc-go/stargazers","contributors_url":"https://api.github.com/repos/yarpc/yarpc-go/contributors","subscribers_url":"https://api.github.com/repos/yarpc/yarpc-go/subscribers","subscription_url":"https://api.github.com/repos/yarpc/yarpc-go/subscription","commits_url":"https://api.github.com/repos/yarpc/yarpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarpc/yarpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarpc/yarpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/yarpc/yarpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarpc/yarpc-go/merges","archive_url":"https://api.github.com/repos/yarpc/yarpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarpc/yarpc-go/downloads","issues_url":"https://api.github.com/repos/yarpc/yarpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/yarpc/yarpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/yarpc/yarpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarpc/yarpc-go/labels{/name}","releases_url":"https://api.github.com/repos/yarpc/yarpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/yarpc/yarpc-go/deployments","created_at":"2016-01-26T00:04:14Z","updated_at":"2016-09-30T22:49:25Z","pushed_at":"2016-10-06T00:59:59Z","git_url":"git://github.com/yarpc/yarpc-go.git","ssh_url":"git@github.com:yarpc/yarpc-go.git","clone_url":"https://github.com/yarpc/yarpc-go.git","svn_url":"https://github.com/yarpc/yarpc-go","homepage":"","size":7024,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":54,"forks":2,"open_issues":54,"watchers":6,"default_branch":"dev"}},"base":{"label":"yarpc:dev","ref":"dev","sha":"02510b74613671b0c9e7b60b790baa28845b081e","user":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"repo":{"id":50390111,"name":"yarpc-go","full_name":"yarpc/yarpc-go","owner":{"login":"yarpc","id":16569504,"avatar_url":"https://avatars.githubusercontent.com/u/16569504?v=3","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yarpc/yarpc-go","description":"YARPC for Golang","fork":false,"url":"https://api.github.com/repos/yarpc/yarpc-go","forks_url":"https://api.github.com/repos/yarpc/yarpc-go/forks","keys_url":"https://api.github.com/repos/yarpc/yarpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarpc/yarpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarpc/yarpc-go/teams","hooks_url":"https://api.github.com/repos/yarpc/yarpc-go/hooks","issue_events_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/yarpc/yarpc-go/events","assignees_url":"https://api.github.com/repos/yarpc/yarpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/yarpc/yarpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/yarpc/yarpc-go/tags","blobs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarpc/yarpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarpc/yarpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/yarpc/yarpc-go/languages","stargazers_url":"https://api.github.com/repos/yarpc/yarpc-go/stargazers","contributors_url":"https://api.github.com/repos/yarpc/yarpc-go/contributors","subscribers_url":"https://api.github.com/repos/yarpc/yarpc-go/subscribers","subscription_url":"https://api.github.com/repos/yarpc/yarpc-go/subscription","commits_url":"https://api.github.com/repos/yarpc/yarpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarpc/yarpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarpc/yarpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/yarpc/yarpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarpc/yarpc-go/merges","archive_url":"https://api.github.com/repos/yarpc/yarpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarpc/yarpc-go/downloads","issues_url":"https://api.github.com/repos/yarpc/yarpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/yarpc/yarpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/yarpc/yarpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarpc/yarpc-go/labels{/name}","releases_url":"https://api.github.com/repos/yarpc/yarpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/yarpc/yarpc-go/deployments","created_at":"2016-01-26T00:04:14Z","updated_at":"2016-09-30T22:49:25Z","pushed_at":"2016-10-06T00:59:59Z","git_url":"git://github.com/yarpc/yarpc-go.git","ssh_url":"git@github.com:yarpc/yarpc-go.git","clone_url":"https://github.com/yarpc/yarpc-go.git","svn_url":"https://github.com/yarpc/yarpc-go","homepage":"","size":7024,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":54,"forks":2,"open_issues":54,"watchers":6,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365"},"html":{"href":"https://github.com/yarpc/yarpc-go/pull/365"},"issue":{"href":"https://api.github.com/repos/yarpc/yarpc-go/issues/365"},"comments":{"href":"https://api.github.com/repos/yarpc/yarpc-go/issues/365/comments"},"review_comments":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365/comments"},"review_comment":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/365/commits"},"statuses":{"href":"https://api.github.com/repos/yarpc/yarpc-go/statuses/8a97c4e392fb7c48df36da604cc8190e288162c9"}}}}
{"actor":{"display_login":"bombela"}}