{"action":"created","comment":{"url":"https://api.github.com/repos/clouway/nsqcycle/pulls/comments/134417737","pull_request_review_id":57704515,"id":134417737,"diff_hunk":"@@ -0,0 +1,79 @@\n+package nsqtest\n+\n+import (\n+\t\"fmt\"\n+\n+\t\"github.com/bitly/go-nsq\"\n+\t\"gopkg.in/ory-am/dockertest.v3\"\n+)\n+\n+type Server struct {\n+\trepository string\n+\ttag        string\n+\tcmd        []string\n+}\n+\n+func NewServer(repository string, tag string, cmd []string) *Server {\n+\treturn &Server{repository: repository, tag: tag, cmd: cmd}\n+}\n+\n+func (s *Server) Run() (*Nsq, error) {\n+\tpool, err := dockertest.NewPool(\"\")\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\toptions := &dockertest.RunOptions{\n+\t\tRepository: s.repository,\n+\t\tTag:        s.tag,\n+\t\tCmd:        s.cmd,\n+\t}\n+\n+\tresource := new(dockertest.Resource)\n+\n+\tif err := pool.Retry(func() error {\n+\t\tvar err error\n+\t\tresource, err = pool.RunWithOptions(options)\n+\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\treturn nil\n+\t}); err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\treturn &Nsq{\n+\t\tHost: fmt.Sprintf(\"localhost:%s\", resource.GetPort(\"4150/tcp\")),\n+\n+\t\tpool:     pool,\n+\t\tresource: resource,\n+\t}, nil\n+}\n+\n+type Nsq struct {\n+\tHost string\n+\n+\tpool     *dockertest.Pool\n+\tresource *dockertest.Resource\n+}\n+\n+func (n *Nsq) NewProducer(config *nsq.Config) (*nsq.Producer, error) {\n+\tp, err := nsq.NewProducer(n.Host, config)\n+\treturn p, err\n+}\n+\n+func (n *Nsq) NewConsumer(cr *ConsumerRequest, config *nsq.Config) (*nsq.Consumer, error) {","path":"nsqtest/nsq.go","position":67,"original_position":67,"commit_id":"ba321e69810606f78d8e6e59a8480d452e8e13f9","original_commit_id":"ba321e69810606f78d8e6e59a8480d452e8e13f9","user":{"login":"FeNoMeNa","id":3286412,"avatar_url":"https://avatars2.githubusercontent.com/u/3286412?v=4","gravatar_id":"","url":"https://api.github.com/users/FeNoMeNa","html_url":"https://github.com/FeNoMeNa","followers_url":"https://api.github.com/users/FeNoMeNa/followers","following_url":"https://api.github.com/users/FeNoMeNa/following{/other_user}","gists_url":"https://api.github.com/users/FeNoMeNa/gists{/gist_id}","starred_url":"https://api.github.com/users/FeNoMeNa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FeNoMeNa/subscriptions","organizations_url":"https://api.github.com/users/FeNoMeNa/orgs","repos_url":"https://api.github.com/users/FeNoMeNa/repos","events_url":"https://api.github.com/users/FeNoMeNa/events{/privacy}","received_events_url":"https://api.github.com/users/FeNoMeNa/received_events","type":"User","site_admin":false},"body":".","created_at":"2017-08-22T08:40:19Z","updated_at":"2017-08-22T08:40:19Z","html_url":"https://github.com/clouway/nsqcycle/pull/1#discussion_r134417737","pull_request_url":"https://api.github.com/repos/clouway/nsqcycle/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/clouway/nsqcycle/pulls/comments/134417737"},"html":{"href":"https://github.com/clouway/nsqcycle/pull/1#discussion_r134417737"},"pull_request":{"href":"https://api.github.com/repos/clouway/nsqcycle/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/clouway/nsqcycle/pulls/1","id":136918943,"html_url":"https://github.com/clouway/nsqcycle/pull/1","diff_url":"https://github.com/clouway/nsqcycle/pull/1.diff","patch_url":"https://github.com/clouway/nsqcycle/pull/1.patch","issue_url":"https://api.github.com/repos/clouway/nsqcycle/issues/1","number":1,"state":"open","locked":false,"title":"nsqtest: added initial infrastructure","user":{"login":"iliyanmotovski","id":25475203,"avatar_url":"https://avatars3.githubusercontent.com/u/25475203?v=4","gravatar_id":"","url":"https://api.github.com/users/iliyanmotovski","html_url":"https://github.com/iliyanmotovski","followers_url":"https://api.github.com/users/iliyanmotovski/followers","following_url":"https://api.github.com/users/iliyanmotovski/following{/other_user}","gists_url":"https://api.github.com/users/iliyanmotovski/gists{/gist_id}","starred_url":"https://api.github.com/users/iliyanmotovski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iliyanmotovski/subscriptions","organizations_url":"https://api.github.com/users/iliyanmotovski/orgs","repos_url":"https://api.github.com/users/iliyanmotovski/repos","events_url":"https://api.github.com/users/iliyanmotovski/events{/privacy}","received_events_url":"https://api.github.com/users/iliyanmotovski/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-22T08:25:51Z","updated_at":"2017-08-22T08:40:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c660ba97bbbf5b8b0ef74f677b0659a4149e77ea","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mgenov","id":209223,"avatar_url":"https://avatars3.githubusercontent.com/u/209223?v=4","gravatar_id":"","url":"https://api.github.com/users/mgenov","html_url":"https://github.com/mgenov","followers_url":"https://api.github.com/users/mgenov/followers","following_url":"https://api.github.com/users/mgenov/following{/other_user}","gists_url":"https://api.github.com/users/mgenov/gists{/gist_id}","starred_url":"https://api.github.com/users/mgenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgenov/subscriptions","organizations_url":"https://api.github.com/users/mgenov/orgs","repos_url":"https://api.github.com/users/mgenov/repos","events_url":"https://api.github.com/users/mgenov/events{/privacy}","received_events_url":"https://api.github.com/users/mgenov/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/clouway/nsqcycle/pulls/1/commits","review_comments_url":"https://api.github.com/repos/clouway/nsqcycle/pulls/1/comments","review_comment_url":"https://api.github.com/repos/clouway/nsqcycle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clouway/nsqcycle/issues/1/comments","statuses_url":"https://api.github.com/repos/clouway/nsqcycle/statuses/ba321e69810606f78d8e6e59a8480d452e8e13f9","head":{"label":"iliyanmotovski:initial","ref":"initial","sha":"ba321e69810606f78d8e6e59a8480d452e8e13f9","user":{"login":"iliyanmotovski","id":25475203,"avatar_url":"https://avatars3.githubusercontent.com/u/25475203?v=4","gravatar_id":"","url":"https://api.github.com/users/iliyanmotovski","html_url":"https://github.com/iliyanmotovski","followers_url":"https://api.github.com/users/iliyanmotovski/followers","following_url":"https://api.github.com/users/iliyanmotovski/following{/other_user}","gists_url":"https://api.github.com/users/iliyanmotovski/gists{/gist_id}","starred_url":"https://api.github.com/users/iliyanmotovski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iliyanmotovski/subscriptions","organizations_url":"https://api.github.com/users/iliyanmotovski/orgs","repos_url":"https://api.github.com/users/iliyanmotovski/repos","events_url":"https://api.github.com/users/iliyanmotovski/events{/privacy}","received_events_url":"https://api.github.com/users/iliyanmotovski/received_events","type":"User","site_admin":false},"repo":{"id":101037939,"name":"nsqcycle","full_name":"iliyanmotovski/nsqcycle","owner":{"login":"iliyanmotovski","id":25475203,"avatar_url":"https://avatars3.githubusercontent.com/u/25475203?v=4","gravatar_id":"","url":"https://api.github.com/users/iliyanmotovski","html_url":"https://github.com/iliyanmotovski","followers_url":"https://api.github.com/users/iliyanmotovski/followers","following_url":"https://api.github.com/users/iliyanmotovski/following{/other_user}","gists_url":"https://api.github.com/users/iliyanmotovski/gists{/gist_id}","starred_url":"https://api.github.com/users/iliyanmotovski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iliyanmotovski/subscriptions","organizations_url":"https://api.github.com/users/iliyanmotovski/orgs","repos_url":"https://api.github.com/users/iliyanmotovski/repos","events_url":"https://api.github.com/users/iliyanmotovski/events{/privacy}","received_events_url":"https://api.github.com/users/iliyanmotovski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iliyanmotovski/nsqcycle","description":"NSQ Testing Package","fork":true,"url":"https://api.github.com/repos/iliyanmotovski/nsqcycle","forks_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/forks","keys_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/teams","hooks_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/hooks","issue_events_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/issues/events{/number}","events_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/events","assignees_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/assignees{/user}","branches_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/branches{/branch}","tags_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/tags","blobs_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/git/refs{/sha}","trees_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/statuses/{sha}","languages_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/languages","stargazers_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/stargazers","contributors_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/contributors","subscribers_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/subscribers","subscription_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/subscription","commits_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/commits{/sha}","git_commits_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/git/commits{/sha}","comments_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/comments{/number}","issue_comment_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/issues/comments{/number}","contents_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/contents/{+path}","compare_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/merges","archive_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/downloads","issues_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/issues{/number}","pulls_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/pulls{/number}","milestones_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/milestones{/number}","notifications_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/labels{/name}","releases_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/releases{/id}","deployments_url":"https://api.github.com/repos/iliyanmotovski/nsqcycle/deployments","created_at":"2017-08-22T08:04:52Z","updated_at":"2017-08-22T06:09:08Z","pushed_at":"2017-08-22T08:28:11Z","git_url":"git://github.com/iliyanmotovski/nsqcycle.git","ssh_url":"git@github.com:iliyanmotovski/nsqcycle.git","clone_url":"https://github.com/iliyanmotovski/nsqcycle.git","svn_url":"https://github.com/iliyanmotovski/nsqcycle","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":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":"clouway:master","ref":"master","sha":"894e9d397531ed72c06d4cfa71be55b8d1aeae30","user":{"login":"clouway","id":1746331,"avatar_url":"https://avatars2.githubusercontent.com/u/1746331?v=4","gravatar_id":"","url":"https://api.github.com/users/clouway","html_url":"https://github.com/clouway","followers_url":"https://api.github.com/users/clouway/followers","following_url":"https://api.github.com/users/clouway/following{/other_user}","gists_url":"https://api.github.com/users/clouway/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway/subscriptions","organizations_url":"https://api.github.com/users/clouway/orgs","repos_url":"https://api.github.com/users/clouway/repos","events_url":"https://api.github.com/users/clouway/events{/privacy}","received_events_url":"https://api.github.com/users/clouway/received_events","type":"Organization","site_admin":false},"repo":{"id":101027457,"name":"nsqcycle","full_name":"clouway/nsqcycle","owner":{"login":"clouway","id":1746331,"avatar_url":"https://avatars2.githubusercontent.com/u/1746331?v=4","gravatar_id":"","url":"https://api.github.com/users/clouway","html_url":"https://github.com/clouway","followers_url":"https://api.github.com/users/clouway/followers","following_url":"https://api.github.com/users/clouway/following{/other_user}","gists_url":"https://api.github.com/users/clouway/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway/subscriptions","organizations_url":"https://api.github.com/users/clouway/orgs","repos_url":"https://api.github.com/users/clouway/repos","events_url":"https://api.github.com/users/clouway/events{/privacy}","received_events_url":"https://api.github.com/users/clouway/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clouway/nsqcycle","description":"NSQ Testing Package","fork":false,"url":"https://api.github.com/repos/clouway/nsqcycle","forks_url":"https://api.github.com/repos/clouway/nsqcycle/forks","keys_url":"https://api.github.com/repos/clouway/nsqcycle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clouway/nsqcycle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clouway/nsqcycle/teams","hooks_url":"https://api.github.com/repos/clouway/nsqcycle/hooks","issue_events_url":"https://api.github.com/repos/clouway/nsqcycle/issues/events{/number}","events_url":"https://api.github.com/repos/clouway/nsqcycle/events","assignees_url":"https://api.github.com/repos/clouway/nsqcycle/assignees{/user}","branches_url":"https://api.github.com/repos/clouway/nsqcycle/branches{/branch}","tags_url":"https://api.github.com/repos/clouway/nsqcycle/tags","blobs_url":"https://api.github.com/repos/clouway/nsqcycle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clouway/nsqcycle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clouway/nsqcycle/git/refs{/sha}","trees_url":"https://api.github.com/repos/clouway/nsqcycle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clouway/nsqcycle/statuses/{sha}","languages_url":"https://api.github.com/repos/clouway/nsqcycle/languages","stargazers_url":"https://api.github.com/repos/clouway/nsqcycle/stargazers","contributors_url":"https://api.github.com/repos/clouway/nsqcycle/contributors","subscribers_url":"https://api.github.com/repos/clouway/nsqcycle/subscribers","subscription_url":"https://api.github.com/repos/clouway/nsqcycle/subscription","commits_url":"https://api.github.com/repos/clouway/nsqcycle/commits{/sha}","git_commits_url":"https://api.github.com/repos/clouway/nsqcycle/git/commits{/sha}","comments_url":"https://api.github.com/repos/clouway/nsqcycle/comments{/number}","issue_comment_url":"https://api.github.com/repos/clouway/nsqcycle/issues/comments{/number}","contents_url":"https://api.github.com/repos/clouway/nsqcycle/contents/{+path}","compare_url":"https://api.github.com/repos/clouway/nsqcycle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clouway/nsqcycle/merges","archive_url":"https://api.github.com/repos/clouway/nsqcycle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clouway/nsqcycle/downloads","issues_url":"https://api.github.com/repos/clouway/nsqcycle/issues{/number}","pulls_url":"https://api.github.com/repos/clouway/nsqcycle/pulls{/number}","milestones_url":"https://api.github.com/repos/clouway/nsqcycle/milestones{/number}","notifications_url":"https://api.github.com/repos/clouway/nsqcycle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clouway/nsqcycle/labels{/name}","releases_url":"https://api.github.com/repos/clouway/nsqcycle/releases{/id}","deployments_url":"https://api.github.com/repos/clouway/nsqcycle/deployments","created_at":"2017-08-22T06:09:08Z","updated_at":"2017-08-22T06:09:08Z","pushed_at":"2017-08-22T08:28:12Z","git_url":"git://github.com/clouway/nsqcycle.git","ssh_url":"git@github.com:clouway/nsqcycle.git","clone_url":"https://github.com/clouway/nsqcycle.git","svn_url":"https://github.com/clouway/nsqcycle","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clouway/nsqcycle/pulls/1"},"html":{"href":"https://github.com/clouway/nsqcycle/pull/1"},"issue":{"href":"https://api.github.com/repos/clouway/nsqcycle/issues/1"},"comments":{"href":"https://api.github.com/repos/clouway/nsqcycle/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/clouway/nsqcycle/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/clouway/nsqcycle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clouway/nsqcycle/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/clouway/nsqcycle/statuses/ba321e69810606f78d8e6e59a8480d452e8e13f9"}}}}
{"actor":{"display_login":"FeNoMeNa"}}