{"action":"created","comment":{"url":"https://api.github.com/repos/getlantern/lantern/pulls/comments/33392639","id":33392639,"diff_hunk":"@@ -0,0 +1,90 @@\n+// Service for discovering Lantern instances in the local network\n+package localdiscovery\n+\n+import (\n+\t\"sync\"\n+\t\"time\"\n+\n+\t\"github.com/getlantern/flashlight/ui\"\n+\t\"github.com/getlantern/golog\"\n+\t\"github.com/getlantern/multicast\"\n+)\n+\n+const (\n+\tmessageType  = `LocalDiscovery`\n+\tupdatePeriod = 10\n+)\n+\n+var (\n+\tlog           = golog.LoggerFor(\"flashlight.localdiscovery\")\n+\tservice       *ui.Service\n+\tmc            *multicast.Multicast\n+\tlastPeers     []multicast.PeerInfo\n+\tpeersMutex    sync.Mutex\n+)\n+\n+func Start(advertise bool, portToAdvertise string) {\n+\tif service != nil {\n+\t\t// Dev error: this service shouldn't be started unless stopped\n+\t\tpanic(\"The \" + messageType + \" service is already registered\")\n+\t\treturn\n+\t}\n+\n+\tvar err error\n+\tservice, err = ui.Register(messageType, nil, func(write func(interface{}) error) error {\n+\t\treturn write(buildPeersList())\n+\t})\n+\tif err != nil {\n+\t\tlog.Errorf(\"Unable to register Local Discovery service: %q\", err)\n+\t\treturn\n+\t}\n+\n+\tmc = multicast.JoinMulticast()\n+\n+\tmc.AddPeerCallback = func(peer string, peersInfo []multicast.PeerInfo) {","path":"src/github.com/getlantern/flashlight/localdiscovery/localdiscovery.go","position":44,"original_position":44,"commit_id":"c9046f11a8519f6f802ef1bff7bc3c7185d3ef9b","original_commit_id":"c9046f11a8519f6f802ef1bff7bc3c7185d3ef9b","user":{"login":"myleshorton","id":1143966,"avatar_url":"https://avatars.githubusercontent.com/u/1143966?v=3","gravatar_id":"","url":"https://api.github.com/users/myleshorton","html_url":"https://github.com/myleshorton","followers_url":"https://api.github.com/users/myleshorton/followers","following_url":"https://api.github.com/users/myleshorton/following{/other_user}","gists_url":"https://api.github.com/users/myleshorton/gists{/gist_id}","starred_url":"https://api.github.com/users/myleshorton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myleshorton/subscriptions","organizations_url":"https://api.github.com/users/myleshorton/orgs","repos_url":"https://api.github.com/users/myleshorton/repos","events_url":"https://api.github.com/users/myleshorton/events{/privacy}","received_events_url":"https://api.github.com/users/myleshorton/received_events","type":"User","site_admin":false},"body":"You could override it as well with one that takes no args and just passes empty functions...","created_at":"2015-06-26T20:27:52Z","updated_at":"2015-06-26T20:27:52Z","html_url":"https://github.com/getlantern/lantern/pull/2646#discussion_r33392639","pull_request_url":"https://api.github.com/repos/getlantern/lantern/pulls/2646","_links":{"self":{"href":"https://api.github.com/repos/getlantern/lantern/pulls/comments/33392639"},"html":{"href":"https://github.com/getlantern/lantern/pull/2646#discussion_r33392639"},"pull_request":{"href":"https://api.github.com/repos/getlantern/lantern/pulls/2646"}}},"pull_request":{"url":"https://api.github.com/repos/getlantern/lantern/pulls/2646","id":37824793,"html_url":"https://github.com/getlantern/lantern/pull/2646","diff_url":"https://github.com/getlantern/lantern/pull/2646.diff","patch_url":"https://github.com/getlantern/lantern/pull/2646.patch","issue_url":"https://api.github.com/repos/getlantern/lantern/issues/2646","number":2646,"state":"open","locked":false,"title":"Lanter Pi + ARM target (issues 2669, 2463, 2463 and 1617)","user":{"login":"uaalto","id":12701448,"avatar_url":"https://avatars.githubusercontent.com/u/12701448?v=3","gravatar_id":"","url":"https://api.github.com/users/uaalto","html_url":"https://github.com/uaalto","followers_url":"https://api.github.com/users/uaalto/followers","following_url":"https://api.github.com/users/uaalto/following{/other_user}","gists_url":"https://api.github.com/users/uaalto/gists{/gist_id}","starred_url":"https://api.github.com/users/uaalto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uaalto/subscriptions","organizations_url":"https://api.github.com/users/uaalto/orgs","repos_url":"https://api.github.com/users/uaalto/repos","events_url":"https://api.github.com/users/uaalto/events{/privacy}","received_events_url":"https://api.github.com/users/uaalto/received_events","type":"User","site_admin":false},"body":"Support for cross-compiling Lantern ARM target using Docker. Builds a __headless__ version.\r\nCloses https://github.com/getlantern/lantern/issues/2463\r\n\r\nIssue https://github.com/getlantern/lantern/issues/1617 also would be closed. Remaining step for Lantern Pi is: https://github.com/getlantern/lantern/issues/2462 ","created_at":"2015-06-16T18:16:12Z","updated_at":"2015-06-26T20:27:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b24adaadbce315ddde7a6c9e8553526c60fb9c33","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/getlantern/lantern/pulls/2646/commits","review_comments_url":"https://api.github.com/repos/getlantern/lantern/pulls/2646/comments","review_comment_url":"https://api.github.com/repos/getlantern/lantern/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getlantern/lantern/issues/2646/comments","statuses_url":"https://api.github.com/repos/getlantern/lantern/statuses/c9046f11a8519f6f802ef1bff7bc3c7185d3ef9b","head":{"label":"getlantern:lantern-arm","ref":"lantern-arm","sha":"c9046f11a8519f6f802ef1bff7bc3c7185d3ef9b","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":1380117,"name":"lantern","full_name":"getlantern/lantern","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/lantern","description":"Defeat censorship. Share access to the open internet with people around the world through your social network.","fork":false,"url":"https://api.github.com/repos/getlantern/lantern","forks_url":"https://api.github.com/repos/getlantern/lantern/forks","keys_url":"https://api.github.com/repos/getlantern/lantern/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/lantern/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/lantern/teams","hooks_url":"https://api.github.com/repos/getlantern/lantern/hooks","issue_events_url":"https://api.github.com/repos/getlantern/lantern/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/lantern/events","assignees_url":"https://api.github.com/repos/getlantern/lantern/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/lantern/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/lantern/tags","blobs_url":"https://api.github.com/repos/getlantern/lantern/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/lantern/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/lantern/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/lantern/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/lantern/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/lantern/languages","stargazers_url":"https://api.github.com/repos/getlantern/lantern/stargazers","contributors_url":"https://api.github.com/repos/getlantern/lantern/contributors","subscribers_url":"https://api.github.com/repos/getlantern/lantern/subscribers","subscription_url":"https://api.github.com/repos/getlantern/lantern/subscription","commits_url":"https://api.github.com/repos/getlantern/lantern/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/lantern/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/lantern/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/lantern/issues/comments{/number}","contents_url":"https://api.github.com/repos/getlantern/lantern/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/lantern/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/lantern/merges","archive_url":"https://api.github.com/repos/getlantern/lantern/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/lantern/downloads","issues_url":"https://api.github.com/repos/getlantern/lantern/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/lantern/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/lantern/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/lantern/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/lantern/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/lantern/releases{/id}","created_at":"2011-02-17T22:12:29Z","updated_at":"2015-06-26T10:41:49Z","pushed_at":"2015-06-26T15:54:55Z","git_url":"git://github.com/getlantern/lantern.git","ssh_url":"git@github.com:getlantern/lantern.git","clone_url":"https://github.com/getlantern/lantern.git","svn_url":"https://github.com/getlantern/lantern","homepage":"https://getlantern.org","size":902554,"stargazers_count":1338,"watchers_count":1338,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":275,"mirror_url":null,"open_issues_count":376,"forks":275,"open_issues":376,"watchers":1338,"default_branch":"valencia"}},"base":{"label":"getlantern:valencia","ref":"valencia","sha":"7f243f487a6a92f9c11769b9087069bcf29af20f","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":1380117,"name":"lantern","full_name":"getlantern/lantern","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/lantern","description":"Defeat censorship. Share access to the open internet with people around the world through your social network.","fork":false,"url":"https://api.github.com/repos/getlantern/lantern","forks_url":"https://api.github.com/repos/getlantern/lantern/forks","keys_url":"https://api.github.com/repos/getlantern/lantern/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/lantern/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/lantern/teams","hooks_url":"https://api.github.com/repos/getlantern/lantern/hooks","issue_events_url":"https://api.github.com/repos/getlantern/lantern/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/lantern/events","assignees_url":"https://api.github.com/repos/getlantern/lantern/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/lantern/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/lantern/tags","blobs_url":"https://api.github.com/repos/getlantern/lantern/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/lantern/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/lantern/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/lantern/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/lantern/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/lantern/languages","stargazers_url":"https://api.github.com/repos/getlantern/lantern/stargazers","contributors_url":"https://api.github.com/repos/getlantern/lantern/contributors","subscribers_url":"https://api.github.com/repos/getlantern/lantern/subscribers","subscription_url":"https://api.github.com/repos/getlantern/lantern/subscription","commits_url":"https://api.github.com/repos/getlantern/lantern/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/lantern/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/lantern/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/lantern/issues/comments{/number}","contents_url":"https://api.github.com/repos/getlantern/lantern/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/lantern/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/lantern/merges","archive_url":"https://api.github.com/repos/getlantern/lantern/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/lantern/downloads","issues_url":"https://api.github.com/repos/getlantern/lantern/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/lantern/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/lantern/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/lantern/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/lantern/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/lantern/releases{/id}","created_at":"2011-02-17T22:12:29Z","updated_at":"2015-06-26T10:41:49Z","pushed_at":"2015-06-26T15:54:55Z","git_url":"git://github.com/getlantern/lantern.git","ssh_url":"git@github.com:getlantern/lantern.git","clone_url":"https://github.com/getlantern/lantern.git","svn_url":"https://github.com/getlantern/lantern","homepage":"https://getlantern.org","size":902554,"stargazers_count":1338,"watchers_count":1338,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":275,"mirror_url":null,"open_issues_count":376,"forks":275,"open_issues":376,"watchers":1338,"default_branch":"valencia"}},"_links":{"self":{"href":"https://api.github.com/repos/getlantern/lantern/pulls/2646"},"html":{"href":"https://github.com/getlantern/lantern/pull/2646"},"issue":{"href":"https://api.github.com/repos/getlantern/lantern/issues/2646"},"comments":{"href":"https://api.github.com/repos/getlantern/lantern/issues/2646/comments"},"review_comments":{"href":"https://api.github.com/repos/getlantern/lantern/pulls/2646/comments"},"review_comment":{"href":"https://api.github.com/repos/getlantern/lantern/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getlantern/lantern/pulls/2646/commits"},"statuses":{"href":"https://api.github.com/repos/getlantern/lantern/statuses/c9046f11a8519f6f802ef1bff7bc3c7185d3ef9b"}}}}