{"action":"created","comment":{"url":"https://api.github.com/repos/gravitational/trace/pulls/comments/157048052","pull_request_review_id":83628760,"id":157048052,"diff_hunk":"@@ -19,6 +19,21 @@ const (\n // UDPOptionSetter represents functional arguments passed to ELKHook\n type UDPOptionSetter func(f *UDPHook)\n \n+// ClientNet sets clientNet option in UDPHook\n+// Usage: hook, err := NewUDPHook(ClientNet(\"tcp\"))\n+func ClientNet(clientNet string) UDPOptionSetter  {\n+\treturn func(f *UDPHook) {\n+\t\tf.clientNet = clientNet\n+\t}\n+}\n+// ClientAddr sets clientAddr option in UDPHook\n+// Usage: hook, err := NewUDPHook(ClientAddr(\"192.168.1.1:65000\"))\n+func ClientAddr(clientAddr string) UDPOptionSetter  {","path":"udphook.go","position":13,"original_position":13,"commit_id":"af4587478b36f73c1e224e3b0face1642c445df5","original_commit_id":"af4587478b36f73c1e224e3b0face1642c445df5","user":{"login":"klizhentas","id":13717,"avatar_url":"https://avatars1.githubusercontent.com/u/13717?v=4","gravatar_id":"","url":"https://api.github.com/users/klizhentas","html_url":"https://github.com/klizhentas","followers_url":"https://api.github.com/users/klizhentas/followers","following_url":"https://api.github.com/users/klizhentas/following{/other_user}","gists_url":"https://api.github.com/users/klizhentas/gists{/gist_id}","starred_url":"https://api.github.com/users/klizhentas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klizhentas/subscriptions","organizations_url":"https://api.github.com/users/klizhentas/orgs","repos_url":"https://api.github.com/users/klizhentas/repos","events_url":"https://api.github.com/users/klizhentas/events{/privacy}","received_events_url":"https://api.github.com/users/klizhentas/received_events","type":"User","site_admin":false},"body":"overall makes sense, one request though - instead of two functional argument parameters, let's make it one:\r\n\r\n```go\r\nfunc Target(network, addr string) UDPOptionSetter {\r\n    return func(f *UDPHook) {\r\n          f.targetNet = network\r\n          f.targetAddr = addr\r\n    }\r\n}\r\n```","created_at":"2017-12-14T20:04:52Z","updated_at":"2017-12-14T20:04:53Z","html_url":"https://github.com/gravitational/trace/pull/42#discussion_r157048052","pull_request_url":"https://api.github.com/repos/gravitational/trace/pulls/42","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gravitational/trace/pulls/comments/157048052"},"html":{"href":"https://github.com/gravitational/trace/pull/42#discussion_r157048052"},"pull_request":{"href":"https://api.github.com/repos/gravitational/trace/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/gravitational/trace/pulls/42","id":158358910,"html_url":"https://github.com/gravitational/trace/pull/42","diff_url":"https://github.com/gravitational/trace/pull/42.diff","patch_url":"https://github.com/gravitational/trace/pull/42.patch","issue_url":"https://api.github.com/repos/gravitational/trace/issues/42","number":42,"state":"open","locked":false,"title":"Added UDPOPtionSetters: ClientNet and ClientAddr. Setters bug fixed. …","user":{"login":"lisitsky","id":183324,"avatar_url":"https://avatars0.githubusercontent.com/u/183324?v=4","gravatar_id":"","url":"https://api.github.com/users/lisitsky","html_url":"https://github.com/lisitsky","followers_url":"https://api.github.com/users/lisitsky/followers","following_url":"https://api.github.com/users/lisitsky/following{/other_user}","gists_url":"https://api.github.com/users/lisitsky/gists{/gist_id}","starred_url":"https://api.github.com/users/lisitsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisitsky/subscriptions","organizations_url":"https://api.github.com/users/lisitsky/orgs","repos_url":"https://api.github.com/users/lisitsky/repos","events_url":"https://api.github.com/users/lisitsky/events{/privacy}","received_events_url":"https://api.github.com/users/lisitsky/received_events","type":"User","site_admin":false},"body":"I've added `UDPOptionSetters` to set clientNet and clientAddr with tests.\r\nAlso I've added `TestUDPHook_Fire` to ensure all settings are applied correctly and system can work.\r\nDuring this I've found that real net and addr were hardcoded in line 94:\r\n\r\n    resolvedAddr, err := net.ResolveUDPAddr(\"udp\", \"127.0.0.1:5000\")\r\n\r\nWhen I change it to required settins tests TestHook and TestTrace start to produce enormouse number of error messages. But tests themselves are correct.\r\nLooks like in some another place there's a code relying on the hardcode above. Could you check it? Thank you.","created_at":"2017-12-14T13:36:43Z","updated_at":"2017-12-14T20:04:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9b3c4018d03dcdc7aa2c2d14f0e1355edd55895","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/gravitational/trace/pulls/42/commits","review_comments_url":"https://api.github.com/repos/gravitational/trace/pulls/42/comments","review_comment_url":"https://api.github.com/repos/gravitational/trace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gravitational/trace/issues/42/comments","statuses_url":"https://api.github.com/repos/gravitational/trace/statuses/af4587478b36f73c1e224e3b0face1642c445df5","head":{"label":"lisitsky:master","ref":"master","sha":"af4587478b36f73c1e224e3b0face1642c445df5","user":{"login":"lisitsky","id":183324,"avatar_url":"https://avatars0.githubusercontent.com/u/183324?v=4","gravatar_id":"","url":"https://api.github.com/users/lisitsky","html_url":"https://github.com/lisitsky","followers_url":"https://api.github.com/users/lisitsky/followers","following_url":"https://api.github.com/users/lisitsky/following{/other_user}","gists_url":"https://api.github.com/users/lisitsky/gists{/gist_id}","starred_url":"https://api.github.com/users/lisitsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisitsky/subscriptions","organizations_url":"https://api.github.com/users/lisitsky/orgs","repos_url":"https://api.github.com/users/lisitsky/repos","events_url":"https://api.github.com/users/lisitsky/events{/privacy}","received_events_url":"https://api.github.com/users/lisitsky/received_events","type":"User","site_admin":false},"repo":{"id":114218795,"name":"trace","full_name":"lisitsky/trace","owner":{"login":"lisitsky","id":183324,"avatar_url":"https://avatars0.githubusercontent.com/u/183324?v=4","gravatar_id":"","url":"https://api.github.com/users/lisitsky","html_url":"https://github.com/lisitsky","followers_url":"https://api.github.com/users/lisitsky/followers","following_url":"https://api.github.com/users/lisitsky/following{/other_user}","gists_url":"https://api.github.com/users/lisitsky/gists{/gist_id}","starred_url":"https://api.github.com/users/lisitsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisitsky/subscriptions","organizations_url":"https://api.github.com/users/lisitsky/orgs","repos_url":"https://api.github.com/users/lisitsky/repos","events_url":"https://api.github.com/users/lisitsky/events{/privacy}","received_events_url":"https://api.github.com/users/lisitsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lisitsky/trace","description":"Package for error handling and error reporting","fork":true,"url":"https://api.github.com/repos/lisitsky/trace","forks_url":"https://api.github.com/repos/lisitsky/trace/forks","keys_url":"https://api.github.com/repos/lisitsky/trace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lisitsky/trace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lisitsky/trace/teams","hooks_url":"https://api.github.com/repos/lisitsky/trace/hooks","issue_events_url":"https://api.github.com/repos/lisitsky/trace/issues/events{/number}","events_url":"https://api.github.com/repos/lisitsky/trace/events","assignees_url":"https://api.github.com/repos/lisitsky/trace/assignees{/user}","branches_url":"https://api.github.com/repos/lisitsky/trace/branches{/branch}","tags_url":"https://api.github.com/repos/lisitsky/trace/tags","blobs_url":"https://api.github.com/repos/lisitsky/trace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lisitsky/trace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lisitsky/trace/git/refs{/sha}","trees_url":"https://api.github.com/repos/lisitsky/trace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lisitsky/trace/statuses/{sha}","languages_url":"https://api.github.com/repos/lisitsky/trace/languages","stargazers_url":"https://api.github.com/repos/lisitsky/trace/stargazers","contributors_url":"https://api.github.com/repos/lisitsky/trace/contributors","subscribers_url":"https://api.github.com/repos/lisitsky/trace/subscribers","subscription_url":"https://api.github.com/repos/lisitsky/trace/subscription","commits_url":"https://api.github.com/repos/lisitsky/trace/commits{/sha}","git_commits_url":"https://api.github.com/repos/lisitsky/trace/git/commits{/sha}","comments_url":"https://api.github.com/repos/lisitsky/trace/comments{/number}","issue_comment_url":"https://api.github.com/repos/lisitsky/trace/issues/comments{/number}","contents_url":"https://api.github.com/repos/lisitsky/trace/contents/{+path}","compare_url":"https://api.github.com/repos/lisitsky/trace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lisitsky/trace/merges","archive_url":"https://api.github.com/repos/lisitsky/trace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lisitsky/trace/downloads","issues_url":"https://api.github.com/repos/lisitsky/trace/issues{/number}","pulls_url":"https://api.github.com/repos/lisitsky/trace/pulls{/number}","milestones_url":"https://api.github.com/repos/lisitsky/trace/milestones{/number}","notifications_url":"https://api.github.com/repos/lisitsky/trace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lisitsky/trace/labels{/name}","releases_url":"https://api.github.com/repos/lisitsky/trace/releases{/id}","deployments_url":"https://api.github.com/repos/lisitsky/trace/deployments","created_at":"2017-12-14T07:44:26Z","updated_at":"2017-12-14T07:44:28Z","pushed_at":"2017-12-14T13:28:09Z","git_url":"git://github.com/lisitsky/trace.git","ssh_url":"git@github.com:lisitsky/trace.git","clone_url":"https://github.com/lisitsky/trace.git","svn_url":"https://github.com/lisitsky/trace","homepage":null,"size":65,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gravitational:master","ref":"master","sha":"0bd13642feb8f57acc0d8e3a568edc34e05a74b9","user":{"login":"gravitational","id":10781132,"avatar_url":"https://avatars2.githubusercontent.com/u/10781132?v=4","gravatar_id":"","url":"https://api.github.com/users/gravitational","html_url":"https://github.com/gravitational","followers_url":"https://api.github.com/users/gravitational/followers","following_url":"https://api.github.com/users/gravitational/following{/other_user}","gists_url":"https://api.github.com/users/gravitational/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitational/subscriptions","organizations_url":"https://api.github.com/users/gravitational/orgs","repos_url":"https://api.github.com/users/gravitational/repos","events_url":"https://api.github.com/users/gravitational/events{/privacy}","received_events_url":"https://api.github.com/users/gravitational/received_events","type":"Organization","site_admin":false},"repo":{"id":39968310,"name":"trace","full_name":"gravitational/trace","owner":{"login":"gravitational","id":10781132,"avatar_url":"https://avatars2.githubusercontent.com/u/10781132?v=4","gravatar_id":"","url":"https://api.github.com/users/gravitational","html_url":"https://github.com/gravitational","followers_url":"https://api.github.com/users/gravitational/followers","following_url":"https://api.github.com/users/gravitational/following{/other_user}","gists_url":"https://api.github.com/users/gravitational/gists{/gist_id}","starred_url":"https://api.github.com/users/gravitational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravitational/subscriptions","organizations_url":"https://api.github.com/users/gravitational/orgs","repos_url":"https://api.github.com/users/gravitational/repos","events_url":"https://api.github.com/users/gravitational/events{/privacy}","received_events_url":"https://api.github.com/users/gravitational/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gravitational/trace","description":"Package for error handling and error reporting","fork":false,"url":"https://api.github.com/repos/gravitational/trace","forks_url":"https://api.github.com/repos/gravitational/trace/forks","keys_url":"https://api.github.com/repos/gravitational/trace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gravitational/trace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gravitational/trace/teams","hooks_url":"https://api.github.com/repos/gravitational/trace/hooks","issue_events_url":"https://api.github.com/repos/gravitational/trace/issues/events{/number}","events_url":"https://api.github.com/repos/gravitational/trace/events","assignees_url":"https://api.github.com/repos/gravitational/trace/assignees{/user}","branches_url":"https://api.github.com/repos/gravitational/trace/branches{/branch}","tags_url":"https://api.github.com/repos/gravitational/trace/tags","blobs_url":"https://api.github.com/repos/gravitational/trace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gravitational/trace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gravitational/trace/git/refs{/sha}","trees_url":"https://api.github.com/repos/gravitational/trace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gravitational/trace/statuses/{sha}","languages_url":"https://api.github.com/repos/gravitational/trace/languages","stargazers_url":"https://api.github.com/repos/gravitational/trace/stargazers","contributors_url":"https://api.github.com/repos/gravitational/trace/contributors","subscribers_url":"https://api.github.com/repos/gravitational/trace/subscribers","subscription_url":"https://api.github.com/repos/gravitational/trace/subscription","commits_url":"https://api.github.com/repos/gravitational/trace/commits{/sha}","git_commits_url":"https://api.github.com/repos/gravitational/trace/git/commits{/sha}","comments_url":"https://api.github.com/repos/gravitational/trace/comments{/number}","issue_comment_url":"https://api.github.com/repos/gravitational/trace/issues/comments{/number}","contents_url":"https://api.github.com/repos/gravitational/trace/contents/{+path}","compare_url":"https://api.github.com/repos/gravitational/trace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gravitational/trace/merges","archive_url":"https://api.github.com/repos/gravitational/trace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gravitational/trace/downloads","issues_url":"https://api.github.com/repos/gravitational/trace/issues{/number}","pulls_url":"https://api.github.com/repos/gravitational/trace/pulls{/number}","milestones_url":"https://api.github.com/repos/gravitational/trace/milestones{/number}","notifications_url":"https://api.github.com/repos/gravitational/trace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gravitational/trace/labels{/name}","releases_url":"https://api.github.com/repos/gravitational/trace/releases{/id}","deployments_url":"https://api.github.com/repos/gravitational/trace/deployments","created_at":"2015-07-30T19:21:33Z","updated_at":"2017-10-10T11:29:48Z","pushed_at":"2017-12-14T13:36:44Z","git_url":"git://github.com/gravitational/trace.git","ssh_url":"git@github.com:gravitational/trace.git","clone_url":"https://github.com/gravitational/trace.git","svn_url":"https://github.com/gravitational/trace","homepage":null,"size":63,"stargazers_count":27,"watchers_count":27,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":4,"open_issues":6,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gravitational/trace/pulls/42"},"html":{"href":"https://github.com/gravitational/trace/pull/42"},"issue":{"href":"https://api.github.com/repos/gravitational/trace/issues/42"},"comments":{"href":"https://api.github.com/repos/gravitational/trace/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/gravitational/trace/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/gravitational/trace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gravitational/trace/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/gravitational/trace/statuses/af4587478b36f73c1e224e3b0face1642c445df5"}},"author_association":"NONE"}}
{"actor":{"display_login":"klizhentas"}}